diff options
author | Ken Moore <moorekou@gmail.com> | 2016-02-12 09:57:20 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-02-12 09:57:20 -0500 |
commit | b9880c772e2ffe097c54f19689f56c4606f87f85 (patch) | |
tree | 2403ffea449618e4bff95b8b48cdc6ac2f08ed5e /lumina-desktop/LDesktop.cpp | |
parent | Merge pull request #182 from vovd/master (diff) | |
download | lumina-b9880c772e2ffe097c54f19689f56c4606f87f85.tar.gz lumina-b9880c772e2ffe097c54f19689f56c4606f87f85.tar.bz2 lumina-b9880c772e2ffe097c54f19689f56c4606f87f85.zip |
Change a lot of "delete" calls on QWidgets to the safer "->deleteLater()" Qt function. This might fix the random issues with desktop crashes on non-FreeBSD systems.
Diffstat (limited to 'lumina-desktop/LDesktop.cpp')
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index b7259e86..be34c123 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -35,7 +35,6 @@ LDesktop::LDesktop(int deskNum, bool setdefault) : QObject(){ LDesktop::~LDesktop(){ delete deskMenu; - //delete appmenu; delete winMenu; delete bgWindow; delete workspacelabel; @@ -61,7 +60,7 @@ void LDesktop::hide(){ void LDesktop::prepareToClose(){ //Get any panels ready to close issyncing = true; //Stop handling any watcher events - for(int i=0; i<PANELS.length(); i++){ PANELS[i]->prepareToClose(); delete PANELS.takeAt(i); i--; } + for(int i=0; i<PANELS.length(); i++){ PANELS[i]->prepareToClose(); PANELS.takeAt(i)->deleteLater(); i--; } //Now close down any desktop plugins desktoplocked = true; //make sure that plugin settings are preserved during removal //Remove all the current containers @@ -362,18 +361,7 @@ void LDesktop::RemoveDeskPlugin(QString ID){ settings->setValue(DPREFIX+"pluginlist", plugs); settings->sync(); QTimer::singleShot(200, this, SLOT(UnlockSettings()) ); - }/*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); - qDebug() << "Removing applauncher:" << path << ID; - if(info.exists() && info.absolutePath()==QDir::homePath()+"/Desktop"){ - //Need to remove this file/dir as well - qDebug() << "Removing File:" << path; - if(!info.isSymLink() && info.isDir()){ QProcess::startDetached("rm -r \""+path+"\""); } - else{ QFile::remove(path); } //just remove the file/symlink directly - } - }*/ + } } void LDesktop::IncreaseDesktopPluginIcons(){ @@ -410,7 +398,7 @@ void LDesktop::UpdatePanels(){ if(panels <= PANELS[i]->number()){ if(DEBUG){ qDebug() << " -- Remove Panel:" << PANELS[i]->number(); } PANELS[i]->prepareToClose(); - delete PANELS.takeAt(i); + PANELS.takeAt(i)->deleteLater(); i--; } } |