summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstandardpaths_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qstandardpaths_unix.cpp')
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index bcbc9664ef..7974dc8cca 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -223,7 +223,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
if (!value.isEmpty()) {
// value can start with $HOME
if (value.startsWith(QLatin1String("$HOME")))
- value = QDir::homePath() + value.mid(5);
+ value = QDir::homePath() + value.midRef(5);
if (value.length() > 1 && value.endsWith(QLatin1Char('/')))
value.chop(1);
return value;
@@ -245,7 +245,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
break;
case FontsLocation:
- path = QDir::homePath() + QLatin1String("/.fonts");
+ path = writableLocation(GenericDataLocation) + QLatin1String("/fonts");
break;
case MusicLocation:
@@ -340,6 +340,9 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
for (int i = 0; i < dirs.count(); ++i)
appendOrganizationAndApp(dirs[i]);
break;
+ case FontsLocation:
+ dirs += QDir::homePath() + QLatin1String("/.fonts");
+ break;
default:
break;
}