Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'fix_du' into 'master'
Fix du usage with busybox, JB#49159

See merge request mer-core/nemo-qml-plugin-filemanager!27
  • Loading branch information
pvuorela committed Mar 2, 2020
2 parents 67e8e08 + 18432e1 commit 1084494
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rpm/nemo-qml-plugin-filemanager.spec
@@ -1,6 +1,6 @@
Name: nemo-qml-plugin-filemanager
Summary: File manager plugin for Nemo Mobile
Version: 0.1.14
Version: 0.1.21
Release: 1
Group: System/Libraries
License: BSD
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/archivemodel.cpp
Expand Up @@ -340,7 +340,7 @@ FileExtractionResult ArchiveModelPrivate::doExtractFile(const QString &entryName
return result;
}

qCDebug(lcArchiveLog) << "Extraing a file:" << targetPath;
qCDebug(lcArchiveLog) << "Extracting a file:" << targetPath;

bool extracted = false;
QString out;
Expand Down
5 changes: 2 additions & 3 deletions src/plugin/diskusage_impl.cpp
Expand Up @@ -43,7 +43,6 @@

quint64 DiskUsageWorker::calculateSize(QString directory, QString *expandedPath, bool androidHomeExists)
{

// In lieu of wordexp(3) support in Qt, fake it
if (directory.startsWith("~/")) {
directory = QDir::homePath() + '/' + directory.mid(2);
Expand All @@ -68,7 +67,7 @@ quint64 DiskUsageWorker::calculateSize(QString directory, QString *expandedPath,
}

QProcess du;
du.start("du", QStringList() << "-sbx" << directory, QIODevice::ReadOnly);
du.start("du", QStringList() << "-skx" << directory, QIODevice::ReadOnly);
du.waitForFinished();
if (du.exitStatus() != QProcess::NormalExit) {
qWarning() << "Could not determine size of:" << directory;
Expand All @@ -77,7 +76,7 @@ quint64 DiskUsageWorker::calculateSize(QString directory, QString *expandedPath,
QStringList size_directory = QString::fromUtf8(du.readAll()).split('\t');

if (size_directory.size() > 1) {
return size_directory[0].toULongLong();
return size_directory[0].toULongLong() * 1024;
}

return 0L;
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/filemodel.h
Expand Up @@ -208,7 +208,7 @@ private slots:
SelectedCountChanged = (1 << 13),
ContentChanged = (1 << 14),
};
Q_DECLARE_FLAGS(ChangedFlags, Changed);
Q_DECLARE_FLAGS(ChangedFlags, Changed)

private:
void recountSelectedFiles();
Expand Down

0 comments on commit 1084494

Please sign in to comment.