Commit a2ea1817 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Port away from KStandardDirs to QStandardPaths

parent 2a18576a
......@@ -25,7 +25,6 @@
#include <KArchive>
#include <KZip>
#include <KComponentData>
#include <KStandardDirs>
#include <KTar>
#include <KDebug>
......
......@@ -25,7 +25,6 @@
#include <KDebug>
#include <KComponentData>
#include <KStandardDirs>
#include <KArchive>
#include <KZip>
#include <KTar>
......
......@@ -37,7 +37,6 @@
#include <project/projectmodel.h>
#include <KComponentData>
#include <KStandardDirs>
#include <QFileInfo>
......
......@@ -23,7 +23,6 @@
#include <KTar>
#include <KZip>
#include <KStandardDirs>
#include <KComponentData>
#include <KDebug>
#include <KConfigGroup>
......
......@@ -37,7 +37,7 @@ class TemplatesModelPrivate;
* displays them as a three-level tree structure.
*
* The locations for loading and storing files are determined by the typePrefix.
* We use KStandardDirs with the "data" type and create a filter string as such:
* We use QStandardPaths with the GenericData type and create a filter string as such:
* \li templates: typePrefix "/templates/"
* \li descriptions: typePrefix "/template_descriptions/"
* \li previews: typePrefix "/template_previews/"
......
......@@ -20,7 +20,7 @@
#include "topducontextdynamicdata.h"
#include <kstandarddirs.h>
#include <QStandardPaths>
#include <typeinfo>
#include <QtCore/QFile>
#include <QtCore/QByteArray>
......@@ -709,7 +709,7 @@ void TopDUContextDynamicData::store() {
unmap();
KStandardDirs::makeDir(basePath());
QDir().mkpath(basePath());
QFile file(filePath());
if(file.open(QIODevice::WriteOnly)) {
......
......@@ -30,7 +30,6 @@
#include <ksharedconfig.h>
#include <kconfiggroup.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kmacroexpander.h>
#include <kpluginfactory.h>
#include <kaboutdata.h>
......
......@@ -14,7 +14,6 @@
#include <klineedit.h>
#include <kcomponentdata.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <kdebug.h>
......
......@@ -16,7 +16,6 @@
#include <kdebug.h>
#include <kconfiggroup.h>
#include <KLocalizedString>
#include <kstandarddirs.h>
#include <kcomponentdata.h>
#include "appwizardplugin.h"
......
......@@ -23,11 +23,11 @@
#include <QtCore/QDir>
#include <QtCore/QDateTime>
#include <QMenu>
#include <QStandardPaths>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KAboutData>
#include <KStandardDirs>
#include <vcs/widgets/standardvcslocationwidget.h>
#include <vcs/dvcs/dvcsjob.h>
......@@ -50,7 +50,7 @@ BazaarPlugin::BazaarPlugin(QObject* parent, const QVariantList& args) :
m_vcsPluginHelper(new KDevelop::VcsPluginHelper(this, this)), m_hasError(false)
{
Q_UNUSED(args); // What is this?
if (KStandardDirs::findExe("bzr").isEmpty()) {
if (QStandardPaths::findExecutable("bzr").isEmpty()) {
m_hasError = true;
m_errorDescription = i18n("Bazaar is not installed (bzr executable not"
" found)");
......
......@@ -32,7 +32,6 @@
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <KTextEditor/TemplateInterface>
#include <KStandardDirs>
#include <QApplication>
#include <QStandardPaths>
......
......@@ -11,8 +11,6 @@
#include <language/codegen/documentchangeset.h>
#include <language/codegen/templaterenderer.h>
#include <KStandardDirs>
using namespace KDevelop;
......
......@@ -24,7 +24,6 @@
#include <kdevcmodule.h>
#include <kurl.h>
#include <kstandarddirs.h>
namespace Ui
{
......
......@@ -27,7 +27,6 @@
#include <interfaces/isession.h>
#include <kdiroperator.h>
#include <kstandarddirs.h>
#include <KDebug>
#include <KActionCollection>
......
......@@ -22,7 +22,6 @@
#include <KLocalizedString>
#include <KDebug>
#include <KStandardDirs>
#include <KEMailSettings>
#include <KComponentData>
#include <KMessageBox>
......
......@@ -52,7 +52,6 @@
#include <interfaces/iruncontroller.h>
#include "stashmanagerdialog.h"
#include <KMessageBox>
#include <KStandardDirs>
#include <KTextEdit>
#include <KDirWatch>
#include <KTextEditor/Document>
......@@ -177,7 +176,7 @@ QDir urlDir(const KUrl::List& urls) { return urlDir(urls.first()); } //TODO: cou
GitPlugin::GitPlugin( QObject *parent, const QVariantList & )
: DistributedVersionControlPlugin(parent, "kdevgit"), m_oldVersion(false)
{
if (KStandardDirs::findExe("git").isEmpty()) {
if (QStandardPaths::findExecutable("git").isEmpty()) {
m_hasError = true;
m_errorDescription = i18n("git is not installed");
return;
......
......@@ -32,7 +32,6 @@
#include <kcombobox.h>
#include <kurlcompletion.h>
#include <kurlcompletion.h>
#include <kstandarddirs.h>
#include <klineedit.h>
#include <KCompletion/kcompletion.h>
......
......@@ -29,7 +29,7 @@
#include <interfaces/iruncontroller.h>
#include <QMenu>
#include "patchreview.h"
#include <KStandardDirs>
#include <QStandardPaths>
#include <KProcess>
#include <QIcon>
......@@ -71,7 +71,7 @@ public:
KProcess::startDetached( QStringList() << "ktp-send-file" << source->file().prettyUrl() );
}
static bool isAvailable() { return !KStandardDirs::findExe( "ktp-send-file" ).isEmpty(); }
static bool isAvailable() { return !QStandardPaths::findExecutable( "ktp-send-file" ).isEmpty(); }
virtual QIcon icon() const { return QIcon::fromTheme( "telepathy-kde" ); }
virtual QString name() const { return i18n( "Send to contact..." ); }
};
......@@ -85,7 +85,7 @@ public:
KProcess::startDetached( QStringList("kompare") << source->baseDir().prettyUrl() << source->file().prettyUrl() );
}
static bool isAvailable() { return !KStandardDirs::findExe( "kompare" ).isEmpty(); }
static bool isAvailable() { return !QStandardPaths::findExecutable( "kompare" ).isEmpty(); }
virtual QIcon icon() const { return QIcon::fromTheme( "kompare" ); }
virtual QString name() const { return i18n( "Side view (Kompare)..." ); }
......
......@@ -22,7 +22,6 @@
#include <QDomDocument>
#include <QDomElement>
#include <KStandardDirs>
#include <KMessageBox>
#include <QtCore/QStandardPaths>
......
......@@ -17,7 +17,6 @@
#include <interfaces/icore.h>
#include <interfaces/isession.h>
#include <KStandardDirs>
#include <KDebug>
#include <ktexteditor/editor.h>
......
......@@ -34,8 +34,7 @@ extern "C" {
}
#include "kdevsvncpp/targets.hpp"
#include "kdevsvncpp/pool.hpp"
#include <kstandarddirs.h>
#include <QStandardPaths>
#include <vcs/vcsrevision.h>
#include <vcs/vcsannotation.h>
......@@ -101,7 +100,7 @@ QString SvnClient::diff( const svn::Path& src, const svn::Revision& srcRev,
const char* errfileName = 0;
apr_file_t* errfile = 0;
QByteArray ba = QString(KStandardDirs::locateLocal("tmp","")+"kdevelop_svn_diff" ).toUtf8();
QByteArray ba = QString(QStandardPaths::writableLocation(QStandardItem::TempLocation)+"/kdevelop_svn_diff" ).toUtf8();
error = svn_io_open_unique_file( &outfile, &outfileName, ba.data(), ".tmp", false, pool );
......@@ -179,7 +178,7 @@ QString SvnClient::diff( const svn::Path& src, const svn::Revision& pegRev,
const char* errfileName = 0;
apr_file_t* errfile = 0;
QByteArray ba = KStandardDirs::locateLocal("tmp","").toUtf8();
QByteArray ba = QStandardPaths::writableLocation("tmp").toUtf8();
error = svn_io_open_unique_file( &outfile, &outfileName, ba.data(), ".tmp", false, pool );
......
......@@ -23,7 +23,6 @@
#include <QtCore/QCoreApplication>
#include <QtDBus/QDBusConnection>
#include <KStandardDirs>
#include <KDebug>
#include <KLocalizedString>
......@@ -272,7 +271,7 @@ void ItemRepositoryRegistryPrivate::deleteDataDirectory(const QString& path, boo
Q_UNUSED(result);
// Just recreate the directory then; leave old path (as it is dependent on appname and session only).
if(recreate) {
KStandardDirs::makeDir(path);
QDir().mkpath(path);
}
}
......@@ -289,7 +288,7 @@ bool ItemRepositoryRegistryPrivate::open(const QString& path)
deleteDataDirectory(path);
}
KStandardDirs::makeDir(path);
QDir().mkpath(path);
foreach(AbstractItemRepository* repository, m_repositories.keys()) {
if(!repository->open(path)) {
......
......@@ -33,7 +33,6 @@
#include <KDebug>
#include <KLocalizedString>
#include <KParts/MainWindow>
#include <KStandardDirs>
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <KTextEditor/ConfigInterface>
......@@ -190,7 +189,7 @@ AssistantPopup::AssistantPopup()
rootContext()->setContextProperty("config", m_config);
setSource(QUrl::fromLocalFile(KStandardDirs::locate("data", "kdevelop/assistantpopup.qml")));
setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kdevelop/assistantpopup.qml")));
if (!rootObject()) {
kWarning() << "Failed to load assistant markup! The assistant will not work.";
}
......
......@@ -39,7 +39,6 @@ Boston, MA 02110-1301, USA.
#include <assert.h>
#include <kdebug.h>
#include <kdialog.h>
#include <kstandarddirs.h>
#include <kaction.h>
#include <kxmlguifactory.h>
......
......@@ -50,7 +50,6 @@ Boston, MA 02110-1301, USA.
#include <kconfiggroup.h>
#include <ksettings/dialog.h>
#include <kio/netaccess.h>
#include <kstandarddirs.h>
#include <ksettings/dispatcher.h>
......
......@@ -23,7 +23,6 @@ Boston, MA 02110-1301, USA.
#include <QtCore/QDir>
#include <kurl.h>
#include <kstandarddirs.h>
#include <kparts/mainwindow.h>
#include <kdebug.h>
#include <kstringhandler.h>
......
......@@ -27,7 +27,6 @@ Boston, MA 02110-1301, USA.
#include <kcmdlineargs.h>
#include <kconfiggroup.h>
#include <kstandarddirs.h>
#include <KLocalizedString>
#include <kio/netaccess.h>
#include <kparts/mainwindow.h>
......
......@@ -25,7 +25,6 @@
#include <kcmodule.h>
#include <kurl.h>
#include <kstandarddirs.h>
namespace Ui
{
......
......@@ -25,7 +25,6 @@
#include <kcmodule.h>
#include <kurl.h>
#include <kstandarddirs.h>
namespace Ui
{
......
......@@ -21,7 +21,6 @@ Boston, MA 02110-1301, USA.
#define KDEVPLATFORM_ENVIRONMENTPREFERENCES_H
#include <kurl.h>
#include <kstandarddirs.h>
#include <kcmodule.h>
#include <QtCore/QVariant>
......
......@@ -24,7 +24,6 @@
#include <kcmodule.h>
#include <kurl.h>
#include <kstandarddirs.h>
class KPluginSelector;
......
......@@ -24,7 +24,6 @@
#include <kcmodule.h>
#include <kurl.h>
#include <kstandarddirs.h>
namespace Ui
{
......
......@@ -27,7 +27,6 @@
#include <tests/autotestshell.h>
#include <shell/core.h>
#include <interfaces/idocumentcontroller.h>
#include <KStandardDirs>
#include <ilanguagecontroller.h>
#include <language/backgroundparser/backgroundparser.h>
#include <languagecontroller.h>
......
......@@ -27,9 +27,9 @@
#include <kcomponentdata.h>
#include <kprocess.h>
#include <kstandarddirs.h>
#include <kdebug.h>
#include <kglobal.h>
#include <kstandarddirs.h>
#include <tests/autotestshell.h>
#include <tests/testcore.h>
......
......@@ -32,7 +32,6 @@
#include <KLocalizedString>
#include <kmessagebox.h>
#include <kconfiggroup.h>
#include <kstandarddirs.h>
#include <kxmlguifactory.h>
#include <kdeversion.h>
#include <kdebug.h>
......@@ -442,7 +441,7 @@ QWidget *TextDocument::createViewWidget(QWidget *parent)
QStringList katePartUIs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, uiFile);
if (!katePartUIs.isEmpty()) {
const QString katePartUI = katePartUIs.last();
const QString katePartLocalUI = KStandardDirs::locateLocal("data", uiFile);
const QString katePartLocalUI = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+ '/' + uiFile;
if (!QFile::exists(katePartLocalUI)) {
// prevent warning:
// kdevelop/kdeui (kdelibs): No such XML file ".../.kde/share/apps/kdevelop/katepartui.rc"
......
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