Changeset View
Standalone View
src/core/directorysizejob.cpp
Show All 11 Lines | 1 | /* This file is part of the KDE libraries | |||
---|---|---|---|---|---|
12 | Library General Public License for more details. | 12 | Library General Public License for more details. | ||
13 | 13 | | |||
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 "global.h" | ||||
20 | #include "directorysizejob.h" | 21 | #include "directorysizejob.h" | ||
21 | #include "listjob.h" | 22 | #include "listjob.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 | | |||
▲ Show 20 Lines • Show All 100 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); | ||
137 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 66) | ||||
138 | // TODO KF6: remove legacy details code path | ||||
136 | listJob->addMetaData(QStringLiteral("details"), QStringLiteral("3")); | 139 | listJob->addMetaData(QStringLiteral("details"), QStringLiteral("3")); | ||
140 | #endif | ||||
141 | listJob->addMetaData(QStringLiteral("statDetails"), QString::number(KIO::StatDetail::Basic | KIO::StatDetail::Inode)); | ||||
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. | |||||
dfaure: You want |, not & ... | |||||
137 | q->connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | 142 | q->connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), | ||
138 | SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | 143 | SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); | ||
139 | q->addSubjob(listJob); | 144 | q->addSubjob(listJob); | ||
140 | } | 145 | } | ||
141 | 146 | | |||
142 | void DirectorySizeJobPrivate::slotEntries(KIO::Job *, const KIO::UDSEntryList &list) | 147 | void DirectorySizeJobPrivate::slotEntries(KIO::Job *, const KIO::UDSEntryList &list) | ||
143 | { | 148 | { | ||
144 | KIO::UDSEntryList::ConstIterator it = list.begin(); | 149 | KIO::UDSEntryList::ConstIterator it = list.begin(); | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |
More correct would be KIOCORE_BUILD_DEPRECATED_SINCE(5, 65)., not ENABLE here and in the other cpp files.