aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LDesktop.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-08-20 17:06:02 -0400
committerKen Moore <moorekou@gmail.com>2015-08-20 17:06:02 -0400
commitdc3b0bcf558fef9f8e3f67d1a71df9a72d8a6c99 (patch)
tree81985cec66e7076397634da89bacf184eed41446 /lumina-desktop/LDesktop.cpp
parentAnother checkpoint in the lumina-fm backend overhaul - still not tied into th... (diff)
downloadlumina-dc3b0bcf558fef9f8e3f67d1a71df9a72d8a6c99.tar.gz
lumina-dc3b0bcf558fef9f8e3f67d1a71df9a72d8a6c99.tar.bz2
lumina-dc3b0bcf558fef9f8e3f67d1a71df9a72d8a6c99.zip
Add an additional option to desktop plugins where additional cleanup routines may be added (only used for some applaunchers right now). This now makes a desktop icon which was explicitly closed/removed by the user also delete the file from the desktop folder (instead of having that plugin get re-created at a later time)
Diffstat (limited to 'lumina-desktop/LDesktop.cpp')
-rw-r--r--lumina-desktop/LDesktop.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 8c2592c7..a326cbcb 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -555,6 +555,8 @@ void LDesktop::AlignDesktopPlugins(){
}
void LDesktop::DesktopPluginRemoved(QString ID, bool internal){
+ //NOTE: This function is only run when the plugin is deliberately removed
+ // The "internal" flag is for whether the plugin was closed by the user (external), or programmatically removed (internal)
//Close down that plugin instance (NOTE: the container might have already closed by the user)
if(DEBUG){ qDebug() << "Desktop Plugin Removed:" << ID; }
//First look for the container (just in case)
@@ -569,13 +571,18 @@ void LDesktop::DesktopPluginRemoved(QString ID, bool internal){
break;
}
}
-
+
//qDebug() << "PLUGINS:" << PLUGINS.length() << ID;
for(int i=0; i<PLUGINS.length(); i++){
if(PLUGINS[i]->ID() == ID){
//qDebug() << "- found ID";
if(DEBUG){ qDebug() << " - Deleting Desktop Plugin:" << ID; }
- PLUGINS[i]->removeSettings(); //Remove any settings associated with this plugin
+ //Special check for auto-generated desktop icons
+ if(ID.startsWith("applauncher::") && (ID.section("::",1,1).section("---",0,0).section("/",0,-1) == (QDir::homePath()+"/Desktop") ) ){
+ PLUGINS[i]->removeSettings(!internal); //Only remove the file if an external removal on an auto-generated shortcut
+ }else{
+ PLUGINS[i]->removeSettings(true); //Remove any settings associated with this plugin
+ }
delete PLUGINS.takeAt(i);
break;
}
bgstack15