Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38845

QStandardPaths::ConfigLocation acts differently on Windows and Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.5.0
    • 5.2.0, 5.2.1
    • Core: I/O
    • None
    • Qt 5.2.1 Ubuntu 13.10, Qt 5.2.0 Windows 7
    • 4c980aedc17c1da8f7160989fbb845ea72b36f44

      QStandardPaths::ConfigLocation does take into account ApplicationName and OrganizationName on Windows but doesn't on Linux.

      main.cpp
      #include <QCoreApplication>
      #include <QStandardPaths>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          qDebug("%s", qPrintable(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)));
      
          a.setApplicationName("AppName");
          a.setOrganizationName("OrgName");
      
          qDebug("%s", qPrintable(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)));
      
          return 0;
      }
      

      Output from Windows 7

      ะก:/Users/nurupo/AppData/Local/executable-name
      C:/Users/nurupo/AppData/Local/OrgName/AppName
      

      Output from Ubuntu 13.10

      /home/nurupo/.config
      /home/nurupo/.config
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            dfaure David Faure (Private)
            nurupo nurupo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes