Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Free disk space
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Free disk space

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 4 Posters 8.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    borut123
    wrote on 4 Mar 2011, 09:11 last edited by
    #1

    Is there any Qt class which provides info about free disk space?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 4 Mar 2011, 12:21 last edited by
      #2

      -Not that I know of.-

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on 4 Mar 2011, 13:54 last edited by
        #3

        No API for that, sorry. Use platform-dependent code, or see if boost::filesystem::space is fine with you.

        See also http://bugreports.qt.nokia.com/browse/QTBUG-3780

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lorn.potter
          wrote on 8 Mar 2011, 18:55 last edited by
          #4

          Yes, try QtMobility QtSystemStorageInfo class.

          Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
          Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on 9 Mar 2011, 09:19 last edited by
            #5

            Thanks for the correction, Lorn.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dangelog
              wrote on 11 Mar 2011, 10:38 last edited by
              #6

              [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...

              Software Engineer
              KDAB (UK) Ltd., a KDAB Group company

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on 11 Mar 2011, 10:46 last edited by
                #7

                [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...

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dangelog
                  wrote on 11 Mar 2011, 10:57 last edited by
                  #8

                  Oh, nice one. I just quick glanced through 1.1 and 1.2 docs and saw nothing like that :-)

                  Software Engineer
                  KDAB (UK) Ltd., a KDAB Group company

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    borut123
                    wrote on 11 Mar 2011, 12:42 last edited by
                    #9

                    I saw it somewhere on the net in 1.2 docs.

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      borut123
                      wrote on 11 Mar 2011, 17:06 last edited by
                      #10

                      here's the link:
                      http://doc.qt.nokia.com/qt-mobility-snapshot/qsystemstorageinfo.html

                      1 Reply Last reply
                      0

                      1/10

                      4 Mar 2011, 09:11

                      • Login

                      • Login or register to search.
                      1 out of 10
                      • First post
                        1/10
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved