Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/filelightParts/fileTree.cpp
Show All 27 Lines | |||||
28 | const FileSize File::DENOMINATOR[4] = { 1ull, 1ull << 10, 1ull << 20, 1ull << 30 }; | 28 | const FileSize File::DENOMINATOR[4] = { 1ull, 1ull << 10, 1ull << 20, 1ull << 30 }; | ||
29 | const char File::PREFIX[5][2] = { "", "K", "M", "G", "T" }; | 29 | const char File::PREFIX[5][2] = { "", "K", "M", "G", "T" }; | ||
30 | 30 | | |||
31 | QString | 31 | QString | ||
32 | File::fullPath(const Directory *root /*= 0*/) const | 32 | File::fullPath(const Directory *root /*= 0*/) const | ||
33 | { | 33 | { | ||
34 | QString path; | 34 | QString path; | ||
35 | 35 | | |||
36 | if (root == this) root = 0; //prevent returning empty string when there is something we could return | 36 | if (root == this) root = nullptr; //prevent returning empty string when there is something we could return | ||
37 | 37 | | |||
38 | const File *d; | 38 | const File *d; | ||
39 | 39 | | |||
40 | for (d = this; d != root && d && d->parent() != 0; d = d->parent()) { | 40 | for (d = this; d != root && d && d->parent() != nullptr; d = d->parent()) { | ||
41 | if (!path.isEmpty()) | 41 | if (!path.isEmpty()) | ||
42 | path = '/' + path; | 42 | path = '/' + path; | ||
43 | 43 | | |||
44 | path = d->name() + path; | 44 | path = d->name() + path; | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | if (d) { | 47 | if (d) { | ||
48 | while (d->parent()) | 48 | while (d->parent()) | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |