From dc3b0bcf558fef9f8e3f67d1a71df9a72d8a6c99 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 20 Aug 2015 17:06:02 -0400 Subject: 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) --- lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp') 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 -- cgit