summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-03-26 18:22:24 +0200
committerPali Roh├ír <[email protected]>2017-12-22 09:10:25 +0100
commite932e4c62b6fb159310e12d934562708494beeb0 (patch)
treef0f6278b67dc47d615a585dc0d7e82d962002f2f
parent7b243dad7c1acb606d814e3cbcdb50f01a57f726 (diff)
Fix load style
-rw-r--r--kopete/chatwindow/kopetechatwindowstyle.cpp1
-rw-r--r--kopete/chatwindow/kopetechatwindowstylemanager.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/kopete/chatwindow/kopetechatwindowstyle.cpp b/kopete/chatwindow/kopetechatwindowstyle.cpp
index 5aa2377..848ec7c 100644
--- a/kopete/chatwindow/kopetechatwindowstyle.cpp
+++ b/kopete/chatwindow/kopetechatwindowstyle.cpp
@@ -76,7 +76,6 @@ ChatWindowStyle::ChatWindowStyle(const QString &styleName, const QString &varian
void ChatWindowStyle::init(const QString &styleName, StyleBuildMode styleBuildMode)
{
- qDebug() <<" QStandardPaths::locateAll(QStandardPaths::DataLocation" << QStandardPaths::standardLocations(QStandardPaths::DataLocation);
QStringList styleDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/%1/Contents/Resources/").arg(styleName),
QStandardPaths::LocateDirectory);
if (styleDirs.isEmpty()) {
diff --git a/kopete/chatwindow/kopetechatwindowstylemanager.cpp b/kopete/chatwindow/kopetechatwindowstylemanager.cpp
index 9c0baea..6b74a4f 100644
--- a/kopete/chatwindow/kopetechatwindowstylemanager.cpp
+++ b/kopete/chatwindow/kopetechatwindowstylemanager.cpp
@@ -90,7 +90,7 @@ void ChatWindowStyleManager::loadStyles()
// Make sure there exists a directory where chat styles can be installed to and it will be watched for changes
QDir().mkpath(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("styles/"));
- QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/"));
+ QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/"), QStandardPaths::LocateDirectory);
foreach (const QString &styleDir, chatStyles) {
qDebug() << "ChatWindowStyleManager::loadStyles " << styleDir;
d->styleDirs.push(QUrl::fromLocalFile(styleDir));
@@ -115,7 +115,7 @@ QStringList ChatWindowStyleManager::getAvailableStyles() const
int ChatWindowStyleManager::installStyle(const QString &styleBundlePath)
{
QString localStyleDir;
- QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles"));
+ QStringList chatStyles = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles"), QStandardPaths::LocateDirectory);
// findDirs returns preferred paths first, let's check if one of them is writable
foreach (const QString &styleDir, chatStyles) {
if (QFileInfo(styleDir).isWritable()) {
@@ -268,7 +268,7 @@ bool ChatWindowStyleManager::removeStyle(const QString &styleName)
delete deletedStyle;
}
- QStringList styleDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/%1").arg(styleName));
+ QStringList styleDirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("/styles/%1").arg(styleName), QStandardPaths::LocateDirectory);
if (styleDirs.isEmpty()) {
kDebug(14000) << "Failed to find style" << styleName;
return false;