Changeset View
Changeset View
Standalone View
Standalone View
libs/widgetutils/KoResourcePaths.cpp
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 118 | #ifdef Q_OS_QWIN | |||
---|---|---|---|---|---|
123 | QString absolute = appdir.absolutePath(); | 123 | QString absolute = appdir.absolutePath(); | ||
124 | DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); | 124 | DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); | ||
125 | rv = ::GetLongPathName(buffer, buffer, 1024); | 125 | rv = ::GetLongPathName(buffer, buffer, 1024); | ||
126 | QString correctedPath((QChar *)buffer); | 126 | QString correctedPath((QChar *)buffer); | ||
127 | appdir.setPath(correctedPath); | 127 | appdir.setPath(correctedPath); | ||
128 | appdir.cdUp(); | 128 | appdir.cdUp(); | ||
129 | return appdir.canonicalPath(); | 129 | return appdir.canonicalPath(); | ||
130 | #else | 130 | #else | ||
131 | #ifdef Q_OS_ANDROID | ||||
132 | // qApp->applicationDirPath() isn't writable and android system won't allow | ||||
133 | // any files other than libraries | ||||
134 | return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/"; | ||||
135 | #else | ||||
131 | return qApp->applicationDirPath() + "/../"; | 136 | return qApp->applicationDirPath() + "/../"; | ||
132 | #endif | 137 | #endif | ||
133 | #endif | 138 | #endif | ||
139 | #endif | ||||
134 | } | 140 | } | ||
135 | 141 | | |||
136 | class Q_DECL_HIDDEN KoResourcePaths::Private { | 142 | class Q_DECL_HIDDEN KoResourcePaths::Private { | ||
137 | public: | 143 | public: | ||
138 | QMap<QString, QStringList> absolutes; // For each resource type, the list of absolute paths, from most local (most priority) to most global | 144 | QMap<QString, QStringList> absolutes; // For each resource type, the list of absolute paths, from most local (most priority) to most global | ||
139 | QMap<QString, QStringList> relatives; // Same with relative paths | 145 | QMap<QString, QStringList> relatives; // Same with relative paths | ||
140 | 146 | | |||
141 | QMutex relativesMutex; | 147 | QMutex relativesMutex; | ||
▲ Show 20 Lines • Show All 455 Lines • Show Last 20 Lines |