Commit 6c893c42 authored by Thomas Perl's avatar Thomas Perl

[diskusage] Expand "~/" in paths

parent 6349bb52
......@@ -51,8 +51,13 @@ DiskUsageWorker::~DiskUsageWorker()
{
}
static quint64 calculateSize(const QString &directory)
static quint64 calculateSize(QString directory)
{
// In lieu of wordexp(3) support in Qt, fake it
if (directory.startsWith("~/")) {
directory = QDir::homePath() + '/' + directory.mid(2);
}
QDir d(directory);
if (!d.exists() || !d.isReadable()) {
return 0L;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment