Commit d6f8e5c2 authored by Christoph Feck's avatar Christoph Feck

KStandardDirs -> QStandardPaths

parent 57cf04e9
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
#include "kpColorCollection.h" #include "kpColorCollection.h"
#include <QDir>
#include <QFile> #include <QFile>
#include <QSaveFile> #include <QSaveFile>
#include <QStandardPaths>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QTextStream> #include <QTextStream>
...@@ -38,7 +40,6 @@ ...@@ -38,7 +40,6 @@
#include <KLocale> #include <KLocale>
#include <KMessageBox> #include <KMessageBox>
#include <kdebug.h> #include <kdebug.h>
#include <kstandarddirs.h>
#include <kstringhandler.h> #include <kstringhandler.h>
#include <QUrl> #include <QUrl>
#include <kdebug.h> #include <kdebug.h>
...@@ -86,14 +87,11 @@ QStringList ...@@ -86,14 +87,11 @@ QStringList
kpColorCollection::installedCollections() kpColorCollection::installedCollections()
{ {
QStringList paletteList; QStringList paletteList;
KGlobal::dirs()->findAllResources("config", "colors/*", KStandardDirs::NoDuplicates, paletteList);
int strip = strlen("colors/"); QStringList paths = QStandardPaths::locateAll(QStandardPaths::GenericConfigLocation, "colors",
for(QStringList::Iterator it = paletteList.begin(); QStandardPaths::LocateDirectory);
it != paletteList.end(); foreach (const QString &path, paths) {
++it) paletteList.append(QDir(path).entryList(QStringList(), QDir::Files));
{
(*it) = (*it).mid(strip);
} }
return paletteList; return paletteList;
...@@ -227,7 +225,8 @@ kpColorCollection::openKDE(const QString &name, QWidget *parent) ...@@ -227,7 +225,8 @@ kpColorCollection::openKDE(const QString &name, QWidget *parent)
return false; return false;
} }
QString filename = KStandardDirs::locate("config", "colors/"+name); QString filename = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,
"colors/" + name);
if (filename.isEmpty()) if (filename.isEmpty())
{ {
#if DEBUG_KP_COLOR_COLLECTION #if DEBUG_KP_COLOR_COLLECTION
...@@ -401,7 +400,8 @@ bool ...@@ -401,7 +400,8 @@ bool
kpColorCollection::saveKDE(QWidget *parent) const kpColorCollection::saveKDE(QWidget *parent) const
{ {
const QString name = d->name; 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); const bool ret = saveAs (QUrl::fromLocalFile (filename), false/*no overwite prompt*/, parent);
// (d->name is wiped by saveAs()). // (d->name is wiped by saveAs()).
d->name = name; d->name = name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment