Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/trash/trashimpl.cpp
Show First 20 Lines • Show All 1395 Lines • ▼ Show 20 Line(s) | 1389 | } else { | |||
---|---|---|---|---|---|
1396 | } else if (actionType == 2) { // delete biggest files first | 1396 | } else if (actionType == 2) { // delete biggest files first | ||
1397 | infoList = dir.entryInfoList(QDir::Files | QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Size); | 1397 | infoList = dir.entryInfoList(QDir::Files | QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Size); | ||
1398 | } else { | 1398 | } else { | ||
1399 | qWarning("Should never happen!"); | 1399 | qWarning("Should never happen!"); | ||
1400 | } | 1400 | } | ||
1401 | 1401 | | |||
1402 | bool deleteFurther = true; | 1402 | bool deleteFurther = true; | ||
1403 | for (int i = 0; (i < infoList.count()) && deleteFurther; ++i) { | 1403 | for (int i = 0; (i < infoList.count()) && deleteFurther; ++i) { | ||
1404 | const QFileInfo info = infoList.at(i); | 1404 | const QFileInfo &info = infoList.at(i); | ||
1405 | 1405 | | |||
1406 | del(trashId, info.fileName()); // delete trashed file | 1406 | del(trashId, info.fileName()); // delete trashed file | ||
1407 | 1407 | | |||
1408 | TrashSizeCache trashSize(trashPath); | 1408 | TrashSizeCache trashSize(trashPath); | ||
1409 | if (util.usage(trashSize.calculateSize() + additionalSize) < percent) { // check whether we have enough space now | 1409 | if (util.usage(trashSize.calculateSize() + additionalSize) < percent) { // check whether we have enough space now | ||
1410 | deleteFurther = false; | 1410 | deleteFurther = false; | ||
1411 | } | 1411 | } | ||
1412 | } | 1412 | } | ||
1413 | } | 1413 | } | ||
1414 | } | 1414 | } | ||
1415 | } | 1415 | } | ||
1416 | 1416 | | |||
1417 | return true; | 1417 | return true; | ||
1418 | } | 1418 | } | ||
1419 | 1419 | | |||
1420 | #include "moc_trashimpl.cpp" | 1420 | #include "moc_trashimpl.cpp" |