From 885058701071f07690f3e7b396374e8c29a8f05c Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 3 Oct 2016 09:12:44 -0400 Subject: Fix a crash with the "autostart" page of lumina-config. --- src-qt5/core-utils/lumina-config/pages/page_autostart.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src-qt5/core-utils/lumina-config') diff --git a/src-qt5/core-utils/lumina-config/pages/page_autostart.cpp b/src-qt5/core-utils/lumina-config/pages/page_autostart.cpp index 371791e9..0159d8f5 100644 --- a/src-qt5/core-utils/lumina-config/pages/page_autostart.cpp +++ b/src-qt5/core-utils/lumina-config/pages/page_autostart.cpp @@ -32,7 +32,9 @@ page_autostart::~page_autostart(){ // PUBLIC SLOTS //================ void page_autostart::SaveSettings(){ + //qDebug() << "Load AutoStart Files for saving"; QList STARTAPPS = LXDG::findAutoStartFiles(true); //also want invalid/disabled items + //qDebug() << " - done"; //bool newstartapps = false; for(int i=0; ilist_session_start->count(); i++){ QString file = ui->list_session_start->item(i)->whatsThis(); @@ -57,17 +59,19 @@ void page_autostart::SaveSettings(){ } } //end loop over GUI items //Now cleanup all the STARTAPPS data - for(int i=0; STARTAPPS.length(); i++){ STARTAPPS[i]->deleteLater(); } + for(int i=STARTAPPS.length()-1; i>=0; i--){ STARTAPPS[i]->deleteLater(); } } void page_autostart::LoadSettings(int){ emit HasPendingChanges(false); emit ChangePageTitle( tr("Startup Services") ); + //qDebug() << "Load AutoStart Files"; QList STARTAPPS = LXDG::findAutoStartFiles(true); //also want invalid/disabled items + //qDebug() << " - done:" << STARTAPPS.length(); //qDebug() << "StartApps:"; ui->list_session_start->clear(); for(int i=0; i " +STARTAPPS[i].name << STARTAPPS[i].isHidden; + //qDebug() << STARTAPPS[i]->filePath +" -> " +STARTAPPS[i]->name << STARTAPPS[i]->isHidden; if( !STARTAPPS[i]->isValid() || !QFile::exists(STARTAPPS[i]->filePath) ){ continue; } QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(STARTAPPS[i]->icon,"application-x-executable"), STARTAPPS[i]->name ); it->setWhatsThis(STARTAPPS[i]->filePath); //keep the file location @@ -77,7 +81,7 @@ void page_autostart::LoadSettings(int){ ui->list_session_start->addItem(it); } //Now cleanup all the STARTAPPS data - for(int i=0; STARTAPPS.length(); i++){ STARTAPPS[i]->deleteLater(); } + for(int i=STARTAPPS.length()-1; i>=0; i--){ STARTAPPS[i]->deleteLater(); } } void page_autostart::updateIcons(){ -- cgit