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) } +QString Utils::filesystemName(QString path) +{ + QString name; +#if defined(Q_OS_WIN32) + wchar_t volname[MAX_PATH+1]; + bool res = GetVolumeInformationW((LPTSTR)path.utf16(), volname, MAX_PATH+1, + NULL, NULL, NULL, NULL, NULL); + if(res) { + name = QString::fromWCharArray(volname); + } +#endif + + qDebug() << "[Utils] Volume name of" << path << "is" << name; + return name; +} + + //! @brief figure the free disk space on a filesystem //! @param path path on the filesystem to check //! @return size in bytes @@ -160,7 +177,7 @@ qulonglong Utils::filesystemSize(QString path, enum Utils::Size type) } } #endif - qDebug() << "[Utils] Filesystem free:" << path << size; + qDebug() << "[Utils] Filesystem:" << path << size; return size; } 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: static QString findExecutable(QString name); static QString checkEnvironment(bool permission); static int compareVersionStrings(QString s1, QString s2); + static QString filesystemName(QString path); }; #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() // later (to include volume label or similar) // Skip unwritable mountpoints, they are not useable for us. if(QFileInfo(mps.at(i)).isWritable()) { - QString title = QString("%1 (%2 GiB of %3 GiB free)") + QString title = QString("%1 %4 (%2 GiB of %3 GiB free)") .arg(QDir::toNativeSeparators(mps.at(i))) .arg((double)Utils::filesystemFree(mps.at(i))/(1<<30), 0, 'f', 2) - .arg((double)Utils::filesystemTotal(mps.at(i))/(1<<30), 0, 'f', 2); + .arg((double)Utils::filesystemTotal(mps.at(i))/(1<<30), 0, 'f', 2) + .arg(Utils::filesystemName(mps.at(i))); ui.mountPoint->addItem(title, mps.at(i)); } } 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() info += "" + tr("Filesystem") + "
"; QStringList drives = Autodetection::mountpoints(); for(int i = 0; i < drives.size(); i++) { - info += tr("%1, %2 GiB of %3 GiB available") + info += tr("%1, %4 %2 GiB of %3 GiB available") .arg(QDir::toNativeSeparators(drives.at(i))) .arg((double)Utils::filesystemFree(drives.at(i)) / (1<<30), 0, 'f', 2) - .arg((double)Utils::filesystemTotal(drives.at(i)) / (1<<30), 0, 'f', 2); + .arg((double)Utils::filesystemTotal(drives.at(i)) / (1<<30), 0, 'f', 2) + .arg(Utils::filesystemName(drives.at(i))); if(i + 1 < drives.size()) info += "
"; }