aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-02-04 13:10:28 -0500
committerKen Moore <moorekou@gmail.com>2016-02-04 13:10:28 -0500
commitdf9bf6b64ba0246203bf52a53ab1eb9338f18f44 (patch)
treed38a28e907a2d67504c846a425c221c639f0c778 /lumina-desktop
parentQuick patch to skip the desktop removal routine if the number of available X ... (diff)
downloadlumina-df9bf6b64ba0246203bf52a53ab1eb9338f18f44.tar.gz
lumina-df9bf6b64ba0246203bf52a53ab1eb9338f18f44.tar.bz2
lumina-df9bf6b64ba0246203bf52a53ab1eb9338f18f44.zip
Cleanup how the ~/Desktop/* shortcuts are removed a bit. Now it catches these special files and only runs the QFile::remove() function on it (just like deleteing the file from teh CLI), and the plugin itself is removed by the update routine later on after the filesystem watcher sees the change.
Diffstat (limited to 'lumina-desktop')
-rw-r--r--lumina-desktop/LDesktop.cpp4
-rw-r--r--lumina-desktop/LDesktopPluginSpace.h18
-rw-r--r--lumina-desktop/LSession.cpp15
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
bgstack15