aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.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/desktop-plugins/applauncher/AppLauncherPlugin.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/desktop-plugins/applauncher/AppLauncherPlugin.cpp')
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index ea42f151..ae454511 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -33,6 +33,13 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
QTimer::singleShot(100,this, SLOT(loadButton()) );
}
+void AppLauncherPlugin::Cleanup(){
+ //This is run only when the plugin was forcibly closed/removed
+ if(QFile::exists(button->whatsThis()) && button->whatsThis().startsWith(QDir::homePath()+"/Desktop") ){
+ deleteFile();
+ }
+}
+
void AppLauncherPlugin::loadButton(bool onchange){
QString def = this->ID().section("::",1,50).section("---",0,0).simplified();
QString path = this->readSetting("applicationpath",def).toString(); //use the default if necessary
bgstack15