]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/15.08'
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Mon, 9 Nov 2015 08:33:20 +0000 (09:33 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Mon, 9 Nov 2015 08:33:20 +0000 (09:33 +0100)
CMakeLists.txt
src/dolphinmainwindow.cpp
src/dolphintabwidget.cpp
src/dolphinviewcontainer.cpp
src/global.cpp
src/global.h
src/main.cpp
src/settings/startup/startupsettingspage.cpp

index 36feb87ca446bd56e4a1fcf21b88aa6d15395854..df70c7c132fe5bb8cb5363889d7c96b67f81bc53 100644 (file)
@@ -5,7 +5,7 @@ project(Dolphin)
 # KDE Application Version, managed by release script
 set (KDE_APPLICATIONS_VERSION_MAJOR "15")
 set (KDE_APPLICATIONS_VERSION_MINOR "08")
-set (KDE_APPLICATIONS_VERSION_MICRO "1")
+set (KDE_APPLICATIONS_VERSION_MICRO "3")
 set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
 
 set(QT_MIN_VERSION "5.4.0")
index 5a731512b9f71091b635d5e2cfb2771a79ff2e53..9b05168fd57c522af1210526123d980d35b34b4d 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "dolphinmainwindow.h"
 
+#include "global.h"
 #include "dolphindockwidget.h"
 #include "dolphincontextmenu.h"
 #include "dolphinnewfilemenu.h"
@@ -639,7 +640,7 @@ void DolphinMainWindow::goHome(Qt::MouseButtons buttons)
 {
     // The default case (left button pressed) is handled in goHome().
     if (buttons == Qt::MiddleButton) {
-        openNewTab(GeneralSettings::self()->homeUrl());
+        openNewTab(Dolphin::homeUrl());
     }
 }
 
index ca626d47a3b9b83a91267017cea2e29a621312a7..0b1f07e0e22b8539ef53576a810afaec0eda3d8b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <QApplication>
 #include <KConfigGroup>
+#include <KShell>
 #include <kio/global.h>
 #include <KRun>
 
@@ -255,16 +256,16 @@ void DolphinTabWidget::detachTab(int index)
 {
     Q_ASSERT(index >= 0);
 
-    const QString separator(QLatin1Char(' '));
-    QString command = QLatin1String("dolphin");
+    QStringList args;
 
     const DolphinTabPage* tabPage = tabPageAt(index);
-    command += separator + tabPage->primaryViewContainer()->url().url();
+    args << tabPage->primaryViewContainer()->url().url();
     if (tabPage->splitViewEnabled()) {
-        command += separator + tabPage->secondaryViewContainer()->url().url();
-        command += separator + QLatin1String("-split");
+        args << tabPage->secondaryViewContainer()->url().url();
+        args << QStringLiteral("--split");
     }
 
+    const QString command = QStringLiteral("dolphin %1").arg(KShell::joinArgs(args));
     KRun::runCommand(command, this);
 
     closeTab(index);
index 8fea3ba9d0bb8389d89724b9f0cd74605c0286fe..6ceb18d6fe610ffa4d59be41e42cc355a4aaae07 100644 (file)
@@ -39,6 +39,7 @@
 #ifdef KActivities_FOUND
 #endif
 
+#include "global.h"
 #include "dolphin_generalsettings.h"
 #include "filterbar/filterbar.h"
 #include "search/dolphinsearchbox.h"
@@ -77,7 +78,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     const GeneralSettings* settings = GeneralSettings::self();
     m_urlNavigator->setUrlEditable(settings->editableUrl());
     m_urlNavigator->setShowFullPath(settings->showFullPath());
-    m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(settings->homeUrl()));
+    m_urlNavigator->setHomeUrl(Dolphin::homeUrl());
     KUrlComboBox* editor = m_urlNavigator->editor();
     editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
 
@@ -304,7 +305,7 @@ void DolphinViewContainer::readSettings()
         // settings of the URL navigator and the filterbar.
         m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl());
         m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath());
-        m_urlNavigator->setHomeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
+        m_urlNavigator->setHomeUrl(Dolphin::homeUrl());
         setFilterBarVisible(GeneralSettings::filterBar());
     }
 
@@ -340,7 +341,7 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
         // started with a search-URL, the home URL is used as fallback.
         QUrl url = m_searchBox->searchPath();
         if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) {
-            url = QUrl::fromLocalFile(GeneralSettings::self()->homeUrl());
+            url = Dolphin::homeUrl();
         }
         m_urlNavigator->setLocationUrl(url);
     }
index 2f23ae4d4c36cee336bc8cf6d4e193fd3a086d5f..d87a29c7ab7e8de9ecc8c454df0abadbf86fdf9c 100644 (file)
@@ -20,6 +20,8 @@
 #include "global.h"
 #include "dolphindebug.h"
 
+#include "dolphin_generalsettings.h"
+
 QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
 {
     QList<QUrl> urls;
@@ -33,3 +35,8 @@ QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
     }
     return urls;
 }
+
+QUrl Dolphin::homeUrl()
+{
+    return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile);
+}
index 7f1931f0d191359d4ef1a9f868909d104932b2ed..0ac2e9acb6010d4dac8371f6d621177f9f08a9b5 100644 (file)
 
 namespace Dolphin {
     QList<QUrl> validateUris(const QStringList& uriList);
+
+    /**
+     * Returns the home url which is defined in General Settings
+     */
+    QUrl homeUrl();
 }
 
 #endif //GLOBAL_H
index b4ca2c6af74273a22d555e6bd02cc75d17387348..bcc9f8a85f4fb7d1256aa1fc2ca261c16668a737 100644 (file)
@@ -113,8 +113,7 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 
     if (urls.isEmpty()) {
         // We need at least one URL to open Dolphin
-        const QUrl homeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
-        urls.append(homeUrl);
+        urls.append(Dolphin::homeUrl());
     }
 
     const bool splitView = parser.isSet("split") || GeneralSettings::splitView();
index 48d2a7b753b96e68ae0bdaea92150477be5880cb..03258cf04ca76543ac1a65928a159abcc57c4534 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "startupsettingspage.h"
 
+#include "global.h"
 #include "dolphinmainwindow.h"
 #include "dolphinviewcontainer.h"
 
@@ -128,7 +129,7 @@ void StartupSettingsPage::applySettings()
 {
     GeneralSettings* settings = GeneralSettings::self();
 
-    const QUrl url(QUrl::fromLocalFile(m_homeUrl->text()));
+    const QUrl url(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile));
     KFileItem fileItem(url);
     if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) {
         settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile));
@@ -163,8 +164,8 @@ void StartupSettingsPage::slotSettingsChanged()
 
 void StartupSettingsPage::selectHomeUrl()
 {
-    const QString homeUrl = m_homeUrl->text();
-    QUrl url = QFileDialog::getExistingDirectoryUrl(this, QString(), QUrl::fromLocalFile(homeUrl));
+    const QUrl homeUrl(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile));
+    QUrl url = QFileDialog::getExistingDirectoryUrl(this, QString(), homeUrl);
     if (!url.isEmpty()) {
         m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
         slotSettingsChanged();
@@ -183,7 +184,7 @@ void StartupSettingsPage::useDefaultLocation()
 
 void StartupSettingsPage::loadSettings()
 {
-    const QUrl url(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
+    const QUrl url(Dolphin::homeUrl());
     m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
     m_splitView->setChecked(GeneralSettings::splitView());
     m_editableUrl->setChecked(GeneralSettings::editableUrl());