summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Feck <[email protected]>2014-10-04 19:01:49 +0200
committerChristoph Feck <[email protected]>2014-10-04 19:01:49 +0200
commitd6f8e5c202057c8fb502462e3f6c3bcf5f1ae770 (patch)
treeb3ec3d3f3da88353a4b67b7469daa3b129530aef
parent57cf04e91ea24c18591e5fadbd0d912b0c18b798 (diff)
KStandardDirs -> QStandardPaths
-rw-r--r--lgpl/generic/kpColorCollection.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/lgpl/generic/kpColorCollection.cpp b/lgpl/generic/kpColorCollection.cpp
index c4eb2ed..7e72065 100644
--- a/lgpl/generic/kpColorCollection.cpp
+++ b/lgpl/generic/kpColorCollection.cpp
@@ -28,8 +28,10 @@
#include "kpColorCollection.h"
+#include <QDir>
#include <QFile>
#include <QSaveFile>
+#include <QStandardPaths>
#include <QTemporaryFile>
#include <QTextStream>
@@ -38,7 +40,6 @@
#include <KLocale>
#include <KMessageBox>
#include <kdebug.h>
-#include <kstandarddirs.h>
#include <kstringhandler.h>
#include <QUrl>
#include <kdebug.h>
@@ -86,14 +87,11 @@ QStringList
kpColorCollection::installedCollections()
{
QStringList paletteList;
- KGlobal::dirs()->findAllResources("config", "colors/*", KStandardDirs::NoDuplicates, paletteList);
- int strip = strlen("colors/");
- for(QStringList::Iterator it = paletteList.begin();
- it != paletteList.end();
- ++it)
- {
- (*it) = (*it).mid(strip);
+ QStringList paths = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, "colors",
+ QStandardPaths::LocateDirectory);
+ foreach (const QString &path, paths) {
+ paletteList.append(QDir(path).entryList(QStringList(), QDir::Files));
}
return paletteList;
@@ -227,7 +225,8 @@ kpColorCollection::openKDE(const QString &name, QWidget *parent)
return false;
}
- QString filename = KStandardDirs::locate("config", "colors/"+name);
+ QString filename = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,
+ "colors/" + name);
if (filename.isEmpty())
{
#if DEBUG_KP_COLOR_COLLECTION
@@ -401,7 +400,8 @@ bool
kpColorCollection::saveKDE(QWidget *parent) const
{
const QString name = d->name;
- QString filename = KStandardDirs::locateLocal("config", "colors/" + name);
+ QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
+ + "colors/" + name;
const bool ret = saveAs (QUrl::fromLocalFile (filename), false/*no overwite prompt*/, parent);
// (d->name is wiped by saveAs()).
d->name = name;