QStandardPaths::writableLocation() on OSX in test mode

David Faure faure at kde.org
Wed Nov 11 14:52:33 UTC 2015


On Wednesday 11 November 2015 15:45:49 René J.V. Bertin wrote:
> On Wednesday November 11 2015 14:49:57 David Faure wrote:
> 
> > qstandardpaths_mac.mm says
> > QString QStandardPaths::writableLocation(StandardLocation type)
> > {
> >     if (isTestModeEnabled()) {
> >         const QString qttestDir = QDir::homePath() + QLatin1String("/.qttest");
> >         QString path;
> >         switch (type) {
> >         case GenericDataLocation:
> >         case AppDataLocation:
> >         case AppLocalDataLocation:
> >             path = qttestDir + QLatin1String("/Application Support");
> >             if (type != GenericDataLocation)
> >                 appendOrganizationAndApp(path);
> >             return path;
> 
> That's not ApplicationsLocation. That one only appears in translateLocation and doesn't get any specific treatment otherwise.

Ah my bad, read too fast. Whoops.

Please test this patch before I submit it to gerrit:


diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index d6126ce..8e030ae 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -162,6 +162,9 @@ QString QStandardPaths::writableLocation(StandardLocation type)
             if (type == AppConfigLocation)
                 appendOrganizationAndApp(path);
             return path;
+        case ApplicationsLocation:
+            path = qttestDir + QLatin1String("/Applications");
+            return path;
         default:
             break;
         }

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list