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. How to change qtsoftware.conf file location from etc/xdg location to user specific location
Forum Updated to NodeBB v4.3 + New Features

How to change qtsoftware.conf file location from etc/xdg location to user specific location

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 599 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.
  • K Offline
    K Offline
    Krishna B
    wrote on 24 May 2023, 07:10 last edited by
    #1

    Hi Team,

    I am using Qt5.12.2 version(OS is RHEL 8.4), in which qtsoftware.conf file is getting created by default in etc/xdg location. My client raised an objection and dont want to give permissions to etc/xdg folder, how can i change the default location of qtsoftware.conf to user specific config location.

    S J 2 Replies Last reply 24 May 2023, 07:22
    0
    • K Krishna B
      24 May 2023, 07:10

      Hi Team,

      I am using Qt5.12.2 version(OS is RHEL 8.4), in which qtsoftware.conf file is getting created by default in etc/xdg location. My client raised an objection and dont want to give permissions to etc/xdg folder, how can i change the default location of qtsoftware.conf to user specific config location.

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 24 May 2023, 07:22 last edited by
      #2

      @Krishna-B if you mean a file created by QSettings then just use one of the constructors which allows you to specify a path to settings file: https://doc.qt.io/qt-6/qsettings.html#QSettings-3

      (Z(:^

      1 Reply Last reply
      0
      • K Krishna B
        24 May 2023, 07:10

        Hi Team,

        I am using Qt5.12.2 version(OS is RHEL 8.4), in which qtsoftware.conf file is getting created by default in etc/xdg location. My client raised an objection and dont want to give permissions to etc/xdg folder, how can i change the default location of qtsoftware.conf to user specific config location.

        J Offline
        J Offline
        JonB
        wrote on 24 May 2023, 07:41 last edited by
        #3

        @Krishna-B
        Since it's not part of Qt distribution it would be helpful if you gave a link to the QtService code you are using.

        It seems that it uses the QSettings::SystemScope location for its /conf file. I think either you would have to change the source to affect that, or you would have to alter what that points to, e.g. as per example in https://docs.huihoo.com/qt/solutions/4/qtservice/qtservice-example-interactive.html.

        Check that /etc/xdg is indeed the value currently returned for your QSettings::SystemScope. Whether that is the "correct" location for a service which may not be interactive/use a desktop I don't know.

        If you change this system scope you need to think about other code in the application which e.g. may be reading from there, since it now points to a different location.

        K 2 Replies Last reply 24 May 2023, 09:58
        0
        • J JonB
          24 May 2023, 07:41

          @Krishna-B
          Since it's not part of Qt distribution it would be helpful if you gave a link to the QtService code you are using.

          It seems that it uses the QSettings::SystemScope location for its /conf file. I think either you would have to change the source to affect that, or you would have to alter what that points to, e.g. as per example in https://docs.huihoo.com/qt/solutions/4/qtservice/qtservice-example-interactive.html.

          Check that /etc/xdg is indeed the value currently returned for your QSettings::SystemScope. Whether that is the "correct" location for a service which may not be interactive/use a desktop I don't know.

          If you change this system scope you need to think about other code in the application which e.g. may be reading from there, since it now points to a different location.

          K Offline
          K Offline
          Krishna B
          wrote on 24 May 2023, 09:58 last edited by
          #4

          @JonB Thanks for the reply, by using sepath in QSettings we able to generate qtsoftware.conf in given location, now need to look for the reading related changes, Will update you!!

          1 Reply Last reply
          0
          • J JonB
            24 May 2023, 07:41

            @Krishna-B
            Since it's not part of Qt distribution it would be helpful if you gave a link to the QtService code you are using.

            It seems that it uses the QSettings::SystemScope location for its /conf file. I think either you would have to change the source to affect that, or you would have to alter what that points to, e.g. as per example in https://docs.huihoo.com/qt/solutions/4/qtservice/qtservice-example-interactive.html.

            Check that /etc/xdg is indeed the value currently returned for your QSettings::SystemScope. Whether that is the "correct" location for a service which may not be interactive/use a desktop I don't know.

            If you change this system scope you need to think about other code in the application which e.g. may be reading from there, since it now points to a different location.

            K Offline
            K Offline
            Krishna B
            wrote on 25 May 2023, 06:27 last edited by
            #5

            @JonB Hi, in my qtservices code default QSetting::systemscope is set. In my service by using setPath of QSettings i am able to generate qtsoftware.conf in specified location. But my service is not listing or showing as registered service. What else do i need to do to achieve this. Thanks in advance!!

            J 1 Reply Last reply 25 May 2023, 06:34
            0
            • K Krishna B
              25 May 2023, 06:27

              @JonB Hi, in my qtservices code default QSetting::systemscope is set. In my service by using setPath of QSettings i am able to generate qtsoftware.conf in specified location. But my service is not listing or showing as registered service. What else do i need to do to achieve this. Thanks in advance!!

              J Offline
              J Offline
              JonB
              wrote on 25 May 2023, 06:34 last edited by
              #6

              @Krishna-B
              You are asking about a third-party QtService, about which I know nothing. I know where "services are registered" under Windows, I don't even know where/how you have "services" under Linux, I only know what "daemons" are there. Is there code in this QtService which (tries to) do whatever under Linux/RHEL to "register as a service"?

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Krishna B
                wrote on 30 May 2023, 13:35 last edited by
                #7

                Thank you all for the immediate response, with the change in QtService (QSettings::systemscope to QSettingS("OrgID", QtSoftware) able to generate QtSoftware.conf in user scope .config folder.

                1 Reply Last reply
                0

                1/7

                24 May 2023, 07:10

                • Login

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