Changeset View
Standalone View
src/core/directorysizejob.cpp
Show All 13 Lines | 1 | /* This file is part of the KDE libraries | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "directorysizejob.h" | 20 | #include "directorysizejob.h" | ||
21 | #include "listjob.h" | 21 | #include "listjob.h" | ||
22 | #include "statjob.h" | ||||
22 | #include <kio/jobuidelegatefactory.h> | 23 | #include <kio/jobuidelegatefactory.h> | ||
23 | #include <qdebug.h> | 24 | #include <qdebug.h> | ||
24 | #include <QTimer> | 25 | #include <QTimer> | ||
25 | 26 | | |||
26 | #include "job_p.h" | 27 | #include "job_p.h" | ||
27 | 28 | | |||
28 | namespace KIO | 29 | namespace KIO | ||
29 | { | 30 | { | ||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 110 | { | |||
128 | q->emitResult(); | 129 | q->emitResult(); | ||
129 | } | 130 | } | ||
130 | 131 | | |||
131 | void DirectorySizeJobPrivate::startNextJob(const QUrl &url) | 132 | void DirectorySizeJobPrivate::startNextJob(const QUrl &url) | ||
132 | { | 133 | { | ||
133 | Q_Q(DirectorySizeJob); | 134 | Q_Q(DirectorySizeJob); | ||
134 | //qDebug() << url; | 135 | //qDebug() << url; | ||
135 | KIO::ListJob *listJob = KIO::listRecursive(url, KIO::HideProgressInfo); | 136 | KIO::ListJob *listJob = KIO::listRecursive(url, KIO::HideProgressInfo); | ||
136 | listJob->addMetaData(QStringLiteral("details"), QStringLiteral("3")); | 137 | listJob->addMetaData(QStringLiteral("details"), QString::number(KIO::StatDefaultDetails)); | ||
kossebau: More correct would be KIOCORE_BUILD_DEPRECATED_SINCE(5, 65)., not ENABLE here and in the other… | |||||
Now that I look at this again, we do NOT want to follow symlinks here. This was a bug in the existing code. In Dolphin we want to display the size of the target file (more useful information than the size of the symlink itself), but when calculating directory size, we do NOT want to follow the symlink, the target size does not count. These new flags allow to fix this long-standing bug. dfaure: Now that I look at this again, we do NOT want to follow symlinks here.
This was a bug in the… | |||||
meven: The previous code did (details of 3) | |||||
I'm confused by what you mean here... and I think I found more problems: Indeed the old code used 3. And this means, in the new field statDetails, we want to specify KIO::Inode to get those fields. dfaure: I'm confused by what you mean here... and I think I found more problems:
Indeed the old code… | |||||
dfaure: This still uses ENABLED instead of BUILD, see initial comment by kossebau. | |||||
137 | q->connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | 138 | q->connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | ||
138 | SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | 139 | SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | ||
dfaure: You want |, not & ... | |||||
139 | q->addSubjob(listJob); | 140 | q->addSubjob(listJob); | ||
140 | } | 141 | } | ||
141 | 142 | | |||
142 | void DirectorySizeJobPrivate::slotEntries(KIO::Job *, const KIO::UDSEntryList &list) | 143 | void DirectorySizeJobPrivate::slotEntries(KIO::Job *, const KIO::UDSEntryList &list) | ||
143 | { | 144 | { | ||
144 | KIO::UDSEntryList::ConstIterator it = list.begin(); | 145 | KIO::UDSEntryList::ConstIterator it = list.begin(); | ||
145 | const KIO::UDSEntryList::ConstIterator end = list.end(); | 146 | const KIO::UDSEntryList::ConstIterator end = list.end(); | ||
146 | for (; it != end; ++it) { | 147 | for (; it != end; ++it) { | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
More correct would be KIOCORE_BUILD_DEPRECATED_SINCE(5, 65)., not ENABLE here and in the other cpp files.