]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Ported Dolphin away from KStandardDirs
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Wed, 1 Oct 2014 10:34:49 +0000 (12:34 +0200)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Wed, 1 Oct 2014 10:34:49 +0000 (12:34 +0200)
removed unused mirroredDirectory method

REVIEW: 120194

src/dolphincontextmenu.cpp
src/dolphinmainwindow.cpp
src/panels/places/placesitemmodel.cpp
src/settings/services/servicessettingspage.cpp
src/settings/viewpropertiesdialog.cpp
src/views/viewproperties.cpp
src/views/viewproperties.h

index e74adca5584ef34ec4c0dc9fab2bc624fd48b6b8..d8f101454b82bd5a93cbfe4da6213d95f6c23d41 100644 (file)
@@ -50,7 +50,6 @@
 #include <KLocale>
 #include <KPropertiesDialog>
 #include <KStandardAction>
-#include <KStandardDirs>
 #include <KToolBar>
 
 #include <panels/places/placesitem.h>
index 629faa154a544906675098f7b8ae509986fb1c83..8668601b6714af49c1b4a8d194508d98840ec6f0 100644 (file)
@@ -72,7 +72,6 @@
 #include <KProtocolInfo>
 #include <KRun>
 #include <KShell>
-#include <KStandardDirs>
 #include <kstatusbar.h>
 #include <KStandardAction>
 #include <KToggleAction>
@@ -87,6 +86,7 @@
 #include <QToolButton>
 #include <QSplitter>
 #include <QTimer>
+#include <QStandardPaths>
 #include <QPushButton>
 
 namespace {
@@ -1481,7 +1481,7 @@ bool DolphinMainWindow::isKompareInstalled() const
     if (!initialized) {
         // TODO: maybe replace this approach later by using a menu
         // plugin like kdiff3plugin.cpp
-        installed = !KGlobal::dirs()->findExe("kompare").isEmpty();
+        installed = !QStandardPaths::findExecutable(QStringLiteral("kompare")).isEmpty();
         initialized = true;
     }
     return installed;
index abfe1d62f5d468dc462edf1651d2d08ca571eaf1..aa7f720b4c326ad07b17c214d4dfa032ee46705f 100644 (file)
@@ -33,7 +33,7 @@
 #include <QIcon>
 #include <kprotocolinfo.h>
 #include <KLocale>
-#include <KStandardDirs>
+#include <QStandardPaths>
 #include <KUser>
 #include <KGlobal>
 #include "placesitem.h"
@@ -87,7 +87,7 @@ PlacesItemModel::PlacesItemModel(QObject* parent) :
     Baloo::IndexerConfig config;
     m_fileIndexingEnabled = config.fileIndexingEnabled();
 #endif
-    const QString file = KStandardDirs::locateLocal("data", "kfileplaces/bookmarks.xml");
+    const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kfileplaces/bookmarks.xml");
     m_bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
 
     createSystemBookmarks();
index be43ae65656b0304652eb2cc5d14785a68e40c2d..e4f5b3fab7b1f03fb146bd9550d9ab3382c7de8f 100644 (file)
@@ -32,7 +32,7 @@
 #include <KNS3/Button>
 #include <KService>
 #include <KServiceTypeTrader>
-#include <KStandardDirs>
+#include <QStandardPaths>
 
 #include <settings/serviceitemdelegate.h>
 #include <settings/servicemodel.h>
@@ -195,7 +195,7 @@ void ServicesSettingsPage::loadServices()
     // Load generic services
     const KService::List entries = KServiceTypeTrader::self()->query("KonqPopupMenu/Plugin");
     foreach (const KService::Ptr& service, entries) {
-        const QString file = KStandardDirs::locate("services", service->entryPath());
+        const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kservices5/" % service->entryPath());
         const QList<KServiceAction> serviceActions =
                                     KDesktopFileActions::userDefinedServices(file, true);
 
index 41a39f2a74e14d30ef1bfb5dfb7df5bf171713d0..576154f2bd2d340bc8a075f8f1460249a6e05c7e 100644 (file)
@@ -34,7 +34,6 @@
 #include <KIconLoader>
 #include <KIO/NetAccess>
 #include <KMessageBox>
-#include <KStandardDirs>
 #include <KUrl>
 #include <KComboBox>
 
index 46c8362747d174e2c40390cfa1f05a541226ba0a..95c44bc84770c3746fdc12ece834f145c37eaee7 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <KComponentData>
 #include <KLocale>
-#include <KStandardDirs>
 #include <KUrl>
 #include <KDebug>
 #include <KGlobal>
@@ -34,6 +33,7 @@
 #include <QDate>
 #include <QFile>
 #include <QFileInfo>
+#include <QStandardPaths>
 
 namespace {
     const int AdditionalInfoViewPropertiesVersion = 1;
@@ -364,7 +364,8 @@ void ViewProperties::update()
 void ViewProperties::save()
 {
     kDebug() << "Saving view-properties to" << m_filePath;
-    KStandardDirs::makeDir(m_filePath);
+    QDir dir;
+    dir.mkpath(m_filePath);
     m_node->setVersion(CurrentViewPropertiesVersion);
     m_node->writeConfig();
     m_changedProps = false;
@@ -378,9 +379,10 @@ bool ViewProperties::exist() const
 
 QString ViewProperties::destinationDir(const QString& subDir) const
 {
-    QString basePath = KGlobal::mainComponent().componentName();
-    basePath.append("/view_properties/").append(subDir);
-    return KStandardDirs::locateLocal("data", basePath);
+    QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
+    path.append(KGlobal::mainComponent().componentName());
+    path.append("/view_properties/").append(subDir);
+    return path;
 }
 
 QString ViewProperties::viewModePrefix() const
@@ -471,10 +473,3 @@ QString ViewProperties::directoryHashForUrl(const KUrl& url)
     hashString.replace('/', '-');
     return hashString;
 }
-
-KUrl ViewProperties::mirroredDirectory()
-{
-    QString basePath = KGlobal::mainComponent().componentName();
-    basePath.append("/view_properties/");
-    return KUrl(KStandardDirs::locateLocal("data", basePath));
-}
index 69b507f1b205e0edfe661350a1c29d96f64a063b..d794edf655164a70926216af0dd3764880134f97 100644 (file)
@@ -164,15 +164,6 @@ private:
      */
     static QString directoryHashForUrl(const KUrl& url);
 
-    /**
-     * Returns the URL of the directory, where the mirrored view properties
-     * are stored into. Mirrored view properties are used if:
-     * - there is no write access for storing the view properties into
-     *   the original directory
-     * - for non local directories
-     */
-    static KUrl mirroredDirectory();
-
     Q_DISABLE_COPY(ViewProperties)
 
 private: