diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-07-15 20:03:05 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-07-15 20:03:05 +0000 |
commit | c9f70fe3043fa7b850af524f23700e66eb4e6fd1 (patch) | |
tree | fefb328a4af8bc61af1cd5826a8108ad5a475ec3 /rbutil/rbutilqt/base/utils.cpp | |
parent | 241f28eefce35e1cf9087ab06f1ee474017f6be8 (diff) | |
download | rockbox-c9f70fe3043fa7b850af524f23700e66eb4e6fd1.tar.gz rockbox-c9f70fe3043fa7b850af524f23700e66eb4e6fd1.tar.bz2 rockbox-c9f70fe3043fa7b850af524f23700e66eb4e6fd1.zip |
Show volume labels on Windows.
In mountpoint selection and system info dialog show the volume name to make it
easier to identify a specific device.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30141 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/utils.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 19 |
1 files changed, 18 insertions, 1 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) } +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; } |