X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fdfdb3fa3c22ab9ad088d96b8aec835bebb16698..148282e2d856b47ceb191eeef4c834118c8cdffd:/src/applyviewpropsjob.cpp diff --git a/src/applyviewpropsjob.cpp b/src/applyviewpropsjob.cpp index ad9a22645..9250226e9 100644 --- a/src/applyviewpropsjob.cpp +++ b/src/applyviewpropsjob.cpp @@ -23,9 +23,6 @@ #include "applyviewpropsjob.h" #include "viewproperties.h" -#include -#include - ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir, const ViewProperties& viewProps) : KIO::Job(), @@ -40,7 +37,10 @@ ApplyViewPropsJob::ApplyViewPropsJob(const KUrl& dir, m_viewProps->setSorting(viewProps.sorting()); m_viewProps->setSortOrder(viewProps.sortOrder()); - startNextJob(dir); + KIO::ListJob* listJob = KIO::listRecursive(dir, KIO::HideProgressInfo); + connect(listJob, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)), + SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&))); + addSubjob(listJob); } ApplyViewPropsJob::~ApplyViewPropsJob() @@ -49,25 +49,11 @@ ApplyViewPropsJob::~ApplyViewPropsJob() m_viewProps = 0; } -void ApplyViewPropsJob::processNextItem() -{ - emitResult(); -} - -void ApplyViewPropsJob::startNextJob(const KUrl& url) -{ - KIO::ListJob* listJob = KIO::listRecursive(url, KIO::HideProgressInfo); - connect(listJob, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)), - SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&))); - addSubjob(listJob); -} - void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list) { KIO::UDSEntryList::ConstIterator it = list.begin(); const KIO::UDSEntryList::ConstIterator end = list.end(); - for (; it != end; ++it) { - const KIO::UDSEntry& entry = *it; + foreach(const KIO::UDSEntry& entry, list) { const QString name = entry.stringValue(KIO::UDSEntry::UDS_NAME); if ((name != ".") && (name != "..") && entry.isDir()) { ++m_progress; @@ -75,7 +61,7 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list) KUrl url(m_dir); url.addPath(name); - assert(m_viewProps != 0); + Q_ASSERT(m_viewProps != 0); ViewProperties props(url); props.setDirProperties(*m_viewProps);