Changeset View
Changeset View
Standalone View
Standalone View
src/core/deletejob.cpp
Show All 15 Lines | 1 | /* This file is part of the KDE libraries | |||
---|---|---|---|---|---|
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License | ||
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | Boston, MA 02110-1301, USA. | 19 | Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "deletejob.h" | 22 | #include "deletejob.h" | ||
23 | 23 | | |||
24 | #include "global.h" | ||||
24 | #include "job.h" // buildErrorString | 25 | #include "job.h" // buildErrorString | ||
25 | #include "statjob.h" | 26 | #include "statjob.h" | ||
26 | #include "listjob.h" | 27 | #include "listjob.h" | ||
27 | #include "kcoredirlister.h" | 28 | #include "kcoredirlister.h" | ||
28 | #include "scheduler.h" | 29 | #include "scheduler.h" | ||
29 | #include "kdirwatch.h" | 30 | #include "kdirwatch.h" | ||
30 | #include "kprotocolmanager.h" | 31 | #include "kprotocolmanager.h" | ||
31 | #include <kdirnotify.h> | 32 | #include <kdirnotify.h> | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 244 | while (m_currentStat != m_srcList.end() && (*m_currentStat).isLocalFile()) { | |||
246 | currentSourceStated(fileInfo.isDir(), fileInfo.isSymLink()); | 247 | currentSourceStated(fileInfo.isDir(), fileInfo.isSymLink()); | ||
247 | ++m_currentStat; | 248 | ++m_currentStat; | ||
248 | } | 249 | } | ||
249 | } | 250 | } | ||
250 | if (m_currentStat == m_srcList.end()) { | 251 | if (m_currentStat == m_srcList.end()) { | ||
251 | // Done, jump to the last else of this method | 252 | // Done, jump to the last else of this method | ||
252 | statNextSrc(); | 253 | statNextSrc(); | ||
253 | } else { | 254 | } else { | ||
254 | KIO::SimpleJob *job = KIO::stat(m_currentURL, StatJob::SourceSide, 0, KIO::HideProgressInfo); | 255 | KIO::SimpleJob *job = KIO::stat(m_currentURL, StatJob::SourceSide, KIO::StatDetail::Basic, KIO::HideProgressInfo); | ||
255 | Scheduler::setJobPriority(job, 1); | 256 | Scheduler::setJobPriority(job, 1); | ||
256 | //qDebug() << "stat'ing" << m_currentURL; | 257 | //qDebug() << "stat'ing" << m_currentURL; | ||
257 | q->addSubjob(job); | 258 | q->addSubjob(job); | ||
258 | } | 259 | } | ||
259 | } else { | 260 | } else { | ||
260 | if (!q->hasSubjobs()) { // don't go there yet if we're still listing some subdirs | 261 | if (!q->hasSubjobs()) { // don't go there yet if we're still listing some subdirs | ||
261 | finishedStatPhase(); | 262 | finishedStatPhase(); | ||
262 | } | 263 | } | ||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 393 | if (url.isLocalFile()) { | |||
393 | // We are about to delete this dir, no need to watch it | 394 | // We are about to delete this dir, no need to watch it | ||
394 | // Maybe we should ask kdirwatch to remove all watches recursively? | 395 | // Maybe we should ask kdirwatch to remove all watches recursively? | ||
395 | // But then there would be no feedback (things disappearing progressively) during huge deletions | 396 | // But then there would be no feedback (things disappearing progressively) during huge deletions | ||
396 | KDirWatch::self()->stopDirScan(url.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | 397 | KDirWatch::self()->stopDirScan(url.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | ||
397 | } | 398 | } | ||
398 | if (!KProtocolManager::canDeleteRecursive(url)) { | 399 | if (!KProtocolManager::canDeleteRecursive(url)) { | ||
399 | //qDebug() << url << "is a directory, let's list it"; | 400 | //qDebug() << url << "is a directory, let's list it"; | ||
400 | ListJob *newjob = KIO::listRecursive(url, KIO::HideProgressInfo); | 401 | ListJob *newjob = KIO::listRecursive(url, KIO::HideProgressInfo); | ||
402 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 65) | ||||
403 | // TODO KF6: remove legacy details code path | ||||
401 | newjob->addMetaData(QStringLiteral("details"), QStringLiteral("0")); | 404 | newjob->addMetaData(QStringLiteral("details"), QStringLiteral("0")); | ||
405 | #endif | ||||
406 | newjob->addMetaData(QStringLiteral("statDetails"), QString::number(KIO::Basic)); | ||||
402 | newjob->setUnrestricted(true); // No KIOSK restrictions | 407 | newjob->setUnrestricted(true); // No KIOSK restrictions | ||
403 | Scheduler::setJobPriority(newjob, 1); | 408 | Scheduler::setJobPriority(newjob, 1); | ||
404 | QObject::connect(newjob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | 409 | QObject::connect(newjob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | ||
405 | q, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | 410 | q, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | ||
406 | q->addSubjob(newjob); | 411 | q->addSubjob(newjob); | ||
407 | // Note that this listing job will happen in parallel with other stat jobs. | 412 | // Note that this listing job will happen in parallel with other stat jobs. | ||
408 | } | 413 | } | ||
409 | } else { | 414 | } else { | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |