Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Enumerate application profiles using QSettings
QtWS25 Last Chance

Enumerate application profiles using QSettings

Scheduled Pinned Locked Moved Solved General and Desktop
qsettingsconfigurationdesktop
5 Posts 2 Posters 1.2k Views
  • 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.
  • A Offline
    A Offline
    Anton Pleskanovskyy
    wrote on 14 Nov 2018, 10:13 last edited by aha_1980
    #1

    Hello!

    I wonder, how can I count up profiles for my application? Each profile include couple of its files: config file, log etc. All of application profiles placed in own dir with unique name (profile ID).
    Is it possible to count them up using Qt classes and how to do so.
    Thanks in advance for your help and time :-)

    J 1 Reply Last reply 14 Nov 2018, 12:16
    0
    • A Anton Pleskanovskyy
      14 Nov 2018, 10:13

      Hello!

      I wonder, how can I count up profiles for my application? Each profile include couple of its files: config file, log etc. All of application profiles placed in own dir with unique name (profile ID).
      Is it possible to count them up using Qt classes and how to do so.
      Thanks in advance for your help and time :-)

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 14 Nov 2018, 12:16 last edited by
      #2

      @Anton-Pleskanovskyy What are those "profiles"? How are they created? Who creates them?
      If all these profiles are stored in same base directory then you just need to count the subdirectories.
      Like

      c:\profiles\
                   profile1
                   profile2
                   profile3
      

      In this example you would have 3 profiles. To make sure you only count valid profiles you can check the content of each profile subdirectory.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anton Pleskanovskyy
        wrote on 14 Nov 2018, 12:45 last edited by Anton Pleskanovskyy
        #3

        @jsulm , actually I want to try extend Trojita IMAP Client functionality.
        I'm going to try make a simple launcher (also powered by Qt as well as original software) to start the Trojita with certain profile passed to executable. So, for the sake of simplicity, yes each profile stored in separate subdirectory of config folder then how to count subfolders (to be crossplatform)? ("rough" simplification of my case)

        J 1 Reply Last reply 14 Nov 2018, 12:50
        0
        • A Anton Pleskanovskyy
          14 Nov 2018, 12:45

          @jsulm , actually I want to try extend Trojita IMAP Client functionality.
          I'm going to try make a simple launcher (also powered by Qt as well as original software) to start the Trojita with certain profile passed to executable. So, for the sake of simplicity, yes each profile stored in separate subdirectory of config folder then how to count subfolders (to be crossplatform)? ("rough" simplification of my case)

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 14 Nov 2018, 12:50 last edited by
          #4

          @Anton-Pleskanovskyy See this: http://doc.qt.io/qt-5/qdir.html#entryList-1
          Use QDir::Dirs as filter.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • A Offline
            A Offline
            Anton Pleskanovskyy
            wrote on 14 Nov 2018, 13:12 last edited by
            #5

            @jsulm you are right!
            I guess that is my case List files in sub-directories with QDir's filter

            1 Reply Last reply
            0

            2/5

            14 Nov 2018, 12:16

            • Login

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