diff options
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 4 | ||||
-rw-r--r-- | lumina-desktop/LDesktopPluginSpace.h | 18 | ||||
-rw-r--r-- | lumina-desktop/LSession.cpp | 15 |
3 files changed, 19 insertions, 18 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 4da38e78..b7259e86 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -362,7 +362,7 @@ void LDesktop::RemoveDeskPlugin(QString ID){ settings->setValue(DPREFIX+"pluginlist", plugs); settings->sync(); QTimer::singleShot(200, this, SLOT(UnlockSettings()) ); - }else if(ID.startsWith("applauncher::") ){ + }/*else if(ID.startsWith("applauncher::") ){ //This was a temporary plugin (desktop file?) check for existance/dir and remove it as necessary QString path = ID.section("---",0,0).section("::",1,50); //full file path QFileInfo info(path); @@ -373,7 +373,7 @@ void LDesktop::RemoveDeskPlugin(QString ID){ if(!info.isSymLink() && info.isDir()){ QProcess::startDetached("rm -r \""+path+"\""); } else{ QFile::remove(path); } //just remove the file/symlink directly } - } + }*/ } void LDesktop::IncreaseDesktopPluginIcons(){ diff --git a/lumina-desktop/LDesktopPluginSpace.h b/lumina-desktop/LDesktopPluginSpace.h index 51d594f8..5ef51930 100644 --- a/lumina-desktop/LDesktopPluginSpace.h +++ b/lumina-desktop/LDesktopPluginSpace.h @@ -16,6 +16,8 @@ #include <QDebug> #include <QFile> #include <QDir> +#include <QFileInfo> +#include <QProcess> #include "desktop-plugins/LDPlugin.h" @@ -158,14 +160,26 @@ private slots: setupDrag(ID, "resize"); } void RemoveItem(QString ID){ + //Special case - desktop file/dir link using the "applauncher" plugin + if(ID.startsWith("applauncher::")){ + QFileInfo info(ID.section("---",0,0).section("::",1,50) ); + if(info.exists() && info.absolutePath()==QDir::homePath()+"/Desktop"){ + qDebug() << "Deleting Desktop Item:" << info.absoluteFilePath(); + if(!info.isSymLink() && info.isDir()){ QProcess::startDetached("rm -r \""+info.absoluteFilePath()+"\""); } + else{ QFile::remove(info.absoluteFilePath()); } //just remove the file/symlink directly + emit PluginRemovedByUser(ID); + return; + } + } + //Any other type of plugin for(int i=0; i<ITEMS.length(); i++){ if(ITEMS[i]->whatsThis()==ID){ ITEMS[i]->Cleanup(); delete ITEMS.takeAt(i); - emit PluginRemovedByUser(ID); - return; + break; } } + emit PluginRemovedByUser(ID); } protected: diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index 7885b9b9..b33f19ee 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -157,7 +157,7 @@ void LSession::setupSession(){ watcher->addPath( QDir::homePath()+"/.lumina/LuminaDE/desktopsettings.conf" ); watcher->addPath( QDir::homePath()+"/.lumina/fluxbox-init" ); watcher->addPath( QDir::homePath()+"/.lumina/fluxbox-keys" ); - watcher->addPath( QDir::homePath() ); + watcher->addPath( QDir::homePath()+"/Desktop" ); //connect internal signals/slots connect(this->desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(screensChanged()) ); @@ -276,19 +276,6 @@ void LSession::launchStartupApps(){ qDebug() << " - - Screen Brightness:" << QString::number(tmp)+"%"; } QProcess::startDetached("nice lumina-open -autostart-apps"); - //Now get any XDG startup applications and launch them - /*QList<XDGDesktop> xdgapps = LXDG::findAutoStartFiles(); - for(int i=0; i<xdgapps.length(); i++){ - qDebug() << " - Auto-Starting File:" << xdgapps[i].filePath; - //splash->showScreen("app::"+xdgapps[i].name); - if(xdgapps[i].startupNotify){ - LSession::LaunchApplication("nice lumina-open \""+xdgapps[i].filePath+"\""); - }else{ - //Don't update the mouse cursor - QProcess::startDetached("nice lumina-open \""+xdgapps[i].filePath+"\""); - } - LSession::processEvents(); - }*/ //Re-load the screen brightness and volume settings from the previous session // Wait until after the XDG-autostart functions, since the audio system might be started that way |