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 277 Lines • ▼ Show 20 Line(s) | 307 | while (m_currentStat != m_srcList.end() && (*m_currentStat).isLocalFile()) { | |||
309 | currentSourceStated(fileInfo.isDir(), fileInfo.isSymLink()); | 310 | currentSourceStated(fileInfo.isDir(), fileInfo.isSymLink()); | ||
310 | ++m_currentStat; | 311 | ++m_currentStat; | ||
311 | } | 312 | } | ||
312 | } | 313 | } | ||
313 | if (m_currentStat == m_srcList.end()) { | 314 | if (m_currentStat == m_srcList.end()) { | ||
314 | // Done, jump to the last else of this method | 315 | // Done, jump to the last else of this method | ||
315 | statNextSrc(); | 316 | statNextSrc(); | ||
316 | } else { | 317 | } else { | ||
317 | KIO::SimpleJob *job = KIO::stat(m_currentURL, StatJob::SourceSide, 0, KIO::HideProgressInfo); | 318 | KIO::SimpleJob *job = KIO::stat(m_currentURL, StatJob::SourceSide, KIO::StatDetail::Basic, KIO::HideProgressInfo); | ||
318 | Scheduler::setJobPriority(job, 1); | 319 | Scheduler::setJobPriority(job, 1); | ||
319 | //qDebug() << "stat'ing" << m_currentURL; | 320 | //qDebug() << "stat'ing" << m_currentURL; | ||
320 | q->addSubjob(job); | 321 | q->addSubjob(job); | ||
321 | } | 322 | } | ||
322 | } else { | 323 | } else { | ||
323 | if (!q->hasSubjobs()) { // don't go there yet if we're still listing some subdirs | 324 | if (!q->hasSubjobs()) { // don't go there yet if we're still listing some subdirs | ||
324 | finishedStatPhase(); | 325 | finishedStatPhase(); | ||
325 | } | 326 | } | ||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | 496 | if (url.isLocalFile()) { | |||
496 | // We are about to delete this dir, no need to watch it | 497 | // We are about to delete this dir, no need to watch it | ||
497 | // Maybe we should ask kdirwatch to remove all watches recursively? | 498 | // Maybe we should ask kdirwatch to remove all watches recursively? | ||
498 | // But then there would be no feedback (things disappearing progressively) during huge deletions | 499 | // But then there would be no feedback (things disappearing progressively) during huge deletions | ||
499 | KDirWatch::self()->stopDirScan(url.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | 500 | KDirWatch::self()->stopDirScan(url.adjusted(QUrl::StripTrailingSlash).toLocalFile()); | ||
500 | } | 501 | } | ||
501 | if (!KProtocolManager::canDeleteRecursive(url)) { | 502 | if (!KProtocolManager::canDeleteRecursive(url)) { | ||
502 | //qDebug() << url << "is a directory, let's list it"; | 503 | //qDebug() << url << "is a directory, let's list it"; | ||
503 | ListJob *newjob = KIO::listRecursive(url, KIO::HideProgressInfo); | 504 | ListJob *newjob = KIO::listRecursive(url, KIO::HideProgressInfo); | ||
505 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 65) | ||||
506 | // TODO KF6: remove legacy details code path | ||||
504 | newjob->addMetaData(QStringLiteral("details"), QStringLiteral("0")); | 507 | newjob->addMetaData(QStringLiteral("details"), QStringLiteral("0")); | ||
508 | #endif | ||||
509 | newjob->addMetaData(QStringLiteral("statDetails"), QString::number(KIO::Basic)); | ||||
505 | newjob->setUnrestricted(true); // No KIOSK restrictions | 510 | newjob->setUnrestricted(true); // No KIOSK restrictions | ||
506 | Scheduler::setJobPriority(newjob, 1); | 511 | Scheduler::setJobPriority(newjob, 1); | ||
507 | QObject::connect(newjob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | 512 | QObject::connect(newjob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | ||
508 | q, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | 513 | q, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | ||
509 | q->addSubjob(newjob); | 514 | q->addSubjob(newjob); | ||
510 | // Note that this listing job will happen in parallel with other stat jobs. | 515 | // Note that this listing job will happen in parallel with other stat jobs. | ||
511 | } | 516 | } | ||
512 | } else { | 517 | } else { | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |