[SOLVED] Free disk space
-
No API for that, sorry. Use platform-dependent code, or see if boost::filesystem::space is fine with you.
-
Yes, try QtMobility QtSystemStorageInfo class.
-
[quote author="peppe" date="1299839932"]
[quote author="lpotter" date="1299610547"]Yes, try QtMobility QtSystemStorageInfo class.[/quote]Thanks, I completely missed that class. But how are you supposed to use it? All it does (in 1.1) is reporting a list of drives...[/quote]
Based on the documentation "here":http://doc.qt.nokia.com/qtmobility-1.2/qsystemstorageinfo.html , I gather that:
You can only be notified of changes in the storage state
You can't get the actual free storage, only undefined classifications of that storage (Unknown, Normal, Low, Very Low, Critical)
Though there is an enum for it, I don't see a documented way to actually get the drive type
All in all, I get the feeling the documentation may be incomplete.
Edit: indeed, the documentation is incomplete. If you read the "example code":http://doc.qt.nokia.com/qtmobility-1.2/sysinfo-dialog-cpp.html, you find some additional member functions:
- QSystemStorageInfo::DriveType QSystemStorageInfo::typeForDrive(volName)
- ??? QSystemStorageInfo::totalDiskSpace(volName)
- ??? QSystemStorageInfo::availableDiskSpace(volName)
That clears up a lot of confusion. It will take a look at the header for QSystemStorageInfo to see what other functions are available...
-
here's the link:
http://doc.qt.nokia.com/qt-mobility-snapshot/qsystemstorageinfo.html