diff options
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 10 | ||||
-rw-r--r-- | lumina-desktop/LDesktop.h | 2 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/LDPluginContainer.h | 6 |
3 files changed, 11 insertions, 7 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 07333c74..86db3fc6 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -321,7 +321,7 @@ void LDesktop::UpdateDesktop(){ if(!plugins.contains(PLUGINS[i]->ID())){ //Remove this plugin (with settings) - is not currently listed - DesktopPluginRemoved(PLUGINS[i]->ID()); + DesktopPluginRemoved(PLUGINS[i]->ID(),true); //flag this as an internal removal i--; } } @@ -423,7 +423,7 @@ void LDesktop::AlignDesktopPlugins(){ } } -void LDesktop::DesktopPluginRemoved(QString ID){ +void LDesktop::DesktopPluginRemoved(QString ID, bool 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) @@ -434,7 +434,7 @@ void LDesktop::DesktopPluginRemoved(QString ID){ //wins[i]->setWhatsThis(""); //clear this so it knows it is being temporarily removed bgDesktop->removeSubWindow(wins[i]->widget()); //unhook plugin from container bgDesktop->removeSubWindow(wins[i]); //remove container from screen - delete wins[i]; //delete old container + if(internal){ delete wins[i]; }//delete old container break; } } @@ -456,6 +456,10 @@ void LDesktop::DesktopPluginRemoved(QString ID){ issyncing = true; if(DEBUG){ qDebug() << " - Save modified plugins list"; } settings->setValue(DPREFIX+"pluginlist", plugins); + if(QFile::exists(QDir::homePath()+"/.lumina/desktop-plugins/"+ID+".conf")){ + if(DEBUG){ qDebug() << " - Removing settings file"; } + QFile::remove(QDir::homePath()+"/.lumina/desktop-plugins/"+ID+".conf"); + } if(DEBUG){ qDebug() << " - Unlock settings file in 200 ms"; } //settings->sync(); QTimer::singleShot(200, this, SLOT(UnlockSettings()) ); diff --git a/lumina-desktop/LDesktop.h b/lumina-desktop/LDesktop.h index ae8e5e83..4860313e 100644 --- a/lumina-desktop/LDesktop.h +++ b/lumina-desktop/LDesktop.h @@ -92,7 +92,7 @@ private slots: void UpdateDesktop(); void ToggleDesktopLock(); void AlignDesktopPlugins(); - void DesktopPluginRemoved(QString); + void DesktopPluginRemoved(QString ID, bool internal = false); void UpdatePanels(); diff --git a/lumina-desktop/desktop-plugins/LDPluginContainer.h b/lumina-desktop/desktop-plugins/LDPluginContainer.h index 14b87585..04ae8262 100644 --- a/lumina-desktop/desktop-plugins/LDPluginContainer.h +++ b/lumina-desktop/desktop-plugins/LDPluginContainer.h @@ -122,12 +122,12 @@ protected: if( !this->whatsThis().isEmpty() && !locked){ //Plugin removed by the user - delete the settings file locked = true; //ensure that the save settings routines don't do anything during the close - if(syncTimer->isActive()){ syncTimer->stop(); } //prevent save routine from running in a moment - QFile::remove( settings->fileName() ); + //QFile::remove( settings->fileName() ); emit PluginRemoved( this->whatsThis() ); } + if(syncTimer->isActive()){ syncTimer->stop(); } //prevent save routine from running in a moment settings = 0; //ensure we don't touch the settings file after a close event - event->accept(); + QMdiSubWindow::closeEvent(event); //continue closing this window } }; |