-rw-r--r-- | noncore/settings/tabmanager/tabmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp index af76251..f54c837 100644 --- a/noncore/settings/tabmanager/tabmanager.cpp +++ b/noncore/settings/tabmanager/tabmanager.cpp @@ -208,48 +208,51 @@ void TabManager::removeItem(){ QMessageBox::critical(this, tr("Message"), tr("Can't remove with applications\nstill in the group."), tr("Ok") ); return; } // Prompt. int answer = QMessageBox::warning(this, tr("Message"), tr("Are you sure you want to delete?"), tr("Yes"), tr("Cancel"), 0, 1 ); if (answer) return; bool removeSuccessfull = true; QString location = itemList[item]; // Remove file (.directory in a Directory case) if(!QFile::remove(location)) removeSuccessfull = false; // Remove directory if(item->parent() == NULL){ // Remove .directory file string location = location.mid(0,location.length()-10); QDir dir; if(!dir.rmdir(location)) removeSuccessfull = false; + else + removeSuccessfull = true; + } // If removing failed. if(!removeSuccessfull){ qDebug((QString("removeItem: ") + location).latin1()); QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") ); return; } // Remove from the installer so it wont fail. // Don't need to do this sense the current install uses rm -f so no error // Remove from the gui list. itemList.remove(item); if(item->parent()) item->parent()->takeItem(item); delete item; // We have changed something. changed = true; } /** |