diff options
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 19 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/utils.h | 1 | ||||
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 5 | ||||
-rw-r--r-- | rbutil/rbutilqt/sysinfo.cpp | 5 |
4 files changed, 25 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 1a8607b8e2..1962df2a16 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp | |||
@@ -110,6 +110,23 @@ QString Utils::resolvePathCase(QString path) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | QString Utils::filesystemName(QString path) | ||
114 | { | ||
115 | QString name; | ||
116 | #if defined(Q_OS_WIN32) | ||
117 | wchar_t volname[MAX_PATH+1]; | ||
118 | bool res = GetVolumeInformationW((LPTSTR)path.utf16(), volname, MAX_PATH+1, | ||
119 | NULL, NULL, NULL, NULL, NULL); | ||
120 | if(res) { | ||
121 | name = QString::fromWCharArray(volname); | ||
122 | } | ||
123 | #endif | ||
124 | |||
125 | qDebug() << "[Utils] Volume name of" << path << "is" << name; | ||
126 | return name; | ||
127 | } | ||
128 | |||
129 | |||
113 | //! @brief figure the free disk space on a filesystem | 130 | //! @brief figure the free disk space on a filesystem |
114 | //! @param path path on the filesystem to check | 131 | //! @param path path on the filesystem to check |
115 | //! @return size in bytes | 132 | //! @return size in bytes |
@@ -160,7 +177,7 @@ qulonglong Utils::filesystemSize(QString path, enum Utils::Size type) | |||
160 | } | 177 | } |
161 | } | 178 | } |
162 | #endif | 179 | #endif |
163 | qDebug() << "[Utils] Filesystem free:" << path << size; | 180 | qDebug() << "[Utils] Filesystem:" << path << size; |
164 | return size; | 181 | return size; |
165 | } | 182 | } |
166 | 183 | ||
diff --git a/rbutil/rbutilqt/base/utils.h b/rbutil/rbutilqt/base/utils.h index bff05cce0a..20ac36eec1 100644 --- a/rbutil/rbutilqt/base/utils.h +++ b/rbutil/rbutilqt/base/utils.h | |||
@@ -44,6 +44,7 @@ public: | |||
44 | static QString findExecutable(QString name); | 44 | static QString findExecutable(QString name); |
45 | static QString checkEnvironment(bool permission); | 45 | static QString checkEnvironment(bool permission); |
46 | static int compareVersionStrings(QString s1, QString s2); | 46 | static int compareVersionStrings(QString s1, QString s2); |
47 | static QString filesystemName(QString path); | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | #endif | 50 | #endif |
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index e48a89f302..eeac492dff 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp | |||
@@ -586,10 +586,11 @@ void Config::refreshMountpoint() | |||
586 | // later (to include volume label or similar) | 586 | // later (to include volume label or similar) |
587 | // Skip unwritable mountpoints, they are not useable for us. | 587 | // Skip unwritable mountpoints, they are not useable for us. |
588 | if(QFileInfo(mps.at(i)).isWritable()) { | 588 | if(QFileInfo(mps.at(i)).isWritable()) { |
589 | QString title = QString("%1 (%2 GiB of %3 GiB free)") | 589 | QString title = QString("%1 %4 (%2 GiB of %3 GiB free)") |
590 | .arg(QDir::toNativeSeparators(mps.at(i))) | 590 | .arg(QDir::toNativeSeparators(mps.at(i))) |
591 | .arg((double)Utils::filesystemFree(mps.at(i))/(1<<30), 0, 'f', 2) | 591 | .arg((double)Utils::filesystemFree(mps.at(i))/(1<<30), 0, 'f', 2) |
592 | .arg((double)Utils::filesystemTotal(mps.at(i))/(1<<30), 0, 'f', 2); | 592 | .arg((double)Utils::filesystemTotal(mps.at(i))/(1<<30), 0, 'f', 2) |
593 | .arg(Utils::filesystemName(mps.at(i))); | ||
593 | ui.mountPoint->addItem(title, mps.at(i)); | 594 | ui.mountPoint->addItem(title, mps.at(i)); |
594 | } | 595 | } |
595 | } | 596 | } |
diff --git a/rbutil/rbutilqt/sysinfo.cpp b/rbutil/rbutilqt/sysinfo.cpp index a28a9bb812..0217c22a3e 100644 --- a/rbutil/rbutilqt/sysinfo.cpp +++ b/rbutil/rbutilqt/sysinfo.cpp | |||
@@ -63,10 +63,11 @@ QString Sysinfo::getInfo() | |||
63 | info += "<b>" + tr("Filesystem") + "</b><br/>"; | 63 | info += "<b>" + tr("Filesystem") + "</b><br/>"; |
64 | QStringList drives = Autodetection::mountpoints(); | 64 | QStringList drives = Autodetection::mountpoints(); |
65 | for(int i = 0; i < drives.size(); i++) { | 65 | for(int i = 0; i < drives.size(); i++) { |
66 | info += tr("%1, %2 GiB of %3 GiB available") | 66 | info += tr("%1, %4 %2 GiB of %3 GiB available") |
67 | .arg(QDir::toNativeSeparators(drives.at(i))) | 67 | .arg(QDir::toNativeSeparators(drives.at(i))) |
68 | .arg((double)Utils::filesystemFree(drives.at(i)) / (1<<30), 0, 'f', 2) | 68 | .arg((double)Utils::filesystemFree(drives.at(i)) / (1<<30), 0, 'f', 2) |
69 | .arg((double)Utils::filesystemTotal(drives.at(i)) / (1<<30), 0, 'f', 2); | 69 | .arg((double)Utils::filesystemTotal(drives.at(i)) / (1<<30), 0, 'f', 2) |
70 | .arg(Utils::filesystemName(drives.at(i))); | ||
70 | if(i + 1 < drives.size()) | 71 | if(i + 1 < drives.size()) |
71 | info += "<br/>"; | 72 | info += "<br/>"; |
72 | } | 73 | } |