author | llornkcor <llornkcor> | 2002-05-06 20:48:13 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-06 20:48:13 (UTC) |
commit | 24259e7b1446f671861b86ee1abb5d8021b98387 (patch) (unidiff) | |
tree | 2bbc06dbc590ba5cc5f5dd0e56025b07c9fa729b /noncore | |
parent | d1dd3ae2eb11a9c6e83eaad817a6f84a53d68691 (diff) | |
download | opie-24259e7b1446f671861b86ee1abb5d8021b98387.zip opie-24259e7b1446f671861b86ee1abb5d8021b98387.tar.gz opie-24259e7b1446f671861b86ee1abb5d8021b98387.tar.bz2 |
fix for rmdir crash
-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 | |||
@@ -220,24 +220,27 @@ void TabManager::removeItem(){ | |||
220 | QString location = itemList[item]; | 220 | QString location = itemList[item]; |
221 | // Remove file (.directory in a Directory case) | 221 | // Remove file (.directory in a Directory case) |
222 | if(!QFile::remove(location)) | 222 | if(!QFile::remove(location)) |
223 | removeSuccessfull = false; | 223 | removeSuccessfull = false; |
224 | 224 | ||
225 | // Remove directory | 225 | // Remove directory |
226 | if(item->parent() == NULL){ | 226 | if(item->parent() == NULL){ |
227 | // Remove .directory file string | 227 | // Remove .directory file string |
228 | location = location.mid(0,location.length()-10); | 228 | location = location.mid(0,location.length()-10); |
229 | QDir dir; | 229 | QDir dir; |
230 | if(!dir.rmdir(location)) | 230 | if(!dir.rmdir(location)) |
231 | removeSuccessfull = false; | 231 | removeSuccessfull = false; |
232 | else | ||
233 | removeSuccessfull = true; | ||
234 | |||
232 | } | 235 | } |
233 | 236 | ||
234 | // If removing failed. | 237 | // If removing failed. |
235 | if(!removeSuccessfull){ | 238 | if(!removeSuccessfull){ |
236 | qDebug((QString("removeItem: ") + location).latin1()); | 239 | qDebug((QString("removeItem: ") + location).latin1()); |
237 | QMessageBox::critical(this, tr("Message"), tr("Can't remove."), | 240 | QMessageBox::critical(this, tr("Message"), tr("Can't remove."), |
238 | tr("Ok") ); | 241 | tr("Ok") ); |
239 | return; | 242 | return; |
240 | } | 243 | } |
241 | 244 | ||
242 | // Remove from the installer so it wont fail. | 245 | // Remove from the installer so it wont fail. |
243 | // Don't need to do this sense the current install uses rm -f so no error | 246 | // Don't need to do this sense the current install uses rm -f so no error |