]> cloud.milkyroute.net Git - dolphin.git/commitdiff
add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + fix compilation
authorDavid Faure <faure@kde.org>
Sat, 25 Jun 2016 14:39:49 +0000 (16:39 +0200)
committerDavid Faure <faure@kde.org>
Sat, 25 Jun 2016 14:40:18 +0000 (16:40 +0200)
This fixes some URLs built from local paths without scheme.

CMakeLists.txt
src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/panels/places/placesitem.cpp
src/panels/places/placesitemmodel.cpp
src/settings/kcm/kcmdolphingeneral.cpp
src/statusbar/mountpointobservercache.cpp
src/views/dolphinview.cpp

index 7e6111307d4d56d43e9b991c6f7d5481dcc3a89a..86b06e889b1b0b8ba3f3c1d99f4553016f864005 100644 (file)
@@ -102,6 +102,8 @@ else()
     )
 endif()
 
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
+
 add_subdirectory(src)
 add_subdirectory(doc)
 
index 3a06d2c0e4494b91ddeaa3d9132ac272a3a62ca4..34008b5eb685104d69f3b18b67affea2912dfcfc 100644 (file)
@@ -83,7 +83,7 @@ namespace {
     // Used for GeneralSettings::version() to determine whether
     // an updated version of Dolphin is running.
     const int CurrentDolphinVersion = 200;
-};
+}
 
 DolphinMainWindow::DolphinMainWindow() :
     KXmlGuiWindow(0),
index 73ffd5c2d42d7a188bc8732b22f6dbeccfd23c2e..1c43fc9779450f5c392c0479af052a336fb07759 100644 (file)
@@ -95,7 +95,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
 
     m_view = new DolphinView(url, this);
     connect(m_view, &DolphinView::urlChanged,
-            m_urlNavigator, &KUrlNavigator::setUrl);
+            m_urlNavigator, &KUrlNavigator::setLocationUrl);
     connect(m_view, &DolphinView::urlChanged,
             m_messageWidget, &KMessageWidget::hide);
     connect(m_view, &DolphinView::directoryLoadingCompleted,
index fe30f62f967372c403519d352d9b2277f6a435c8..92a0200039404ce84c943a8a20bf874709ac4e86 100644 (file)
@@ -374,9 +374,9 @@ void KFileItemModelRolesUpdater::slotItemsRemoved(const KItemRangeList& itemRang
             m_balooFileMonitor->clear();
         } else {
             QStringList newFileList;
-            foreach (const QString& itemUrl, m_balooFileMonitor->files()) {
-                if (m_model->index(itemUrl) >= 0) {
-                    newFileList.append(itemUrl);
+            foreach (const QString& file, m_balooFileMonitor->files()) {
+                if (m_model->index(QUrl::fromLocalFile(file)) >= 0) {
+                    newFileList.append(file);
                 }
             }
             m_balooFileMonitor->setFiles(newFileList);
@@ -707,10 +707,10 @@ void KFileItemModelRolesUpdater::resolveRecentlyChangedItems()
     updateChangedItems();
 }
 
-void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& itemUrl)
+void KFileItemModelRolesUpdater::applyChangedBalooRoles(const QString& file)
 {
 #ifdef HAVE_BALOO
-    const KFileItem item = m_model->fileItem(itemUrl);
+    const KFileItem item = m_model->fileItem(QUrl::fromLocalFile(file));
 
     if (item.isNull()) {
         // itemUrl is not in the model anymore, probably because
index a04064d0b3762622d815fadc4fb4a495e302c793..b32f8204d76efcdc2474544f52e6d4046ba23240 100644 (file)
@@ -276,12 +276,12 @@ void PlacesItem::initializeDevice(const QString& udi)
         Solid::Block *block = m_device.as<Solid::Block>();
         if (block) {
             const QString device = block->device();
-            setUrl(QStringLiteral("audiocd:/?device=%1").arg(device));
+            setUrl(QUrl(QStringLiteral("audiocd:/?device=%1").arg(device)));
         } else {
-            setUrl(QStringLiteral("audiocd:/"));
+            setUrl(QUrl(QStringLiteral("audiocd:/")));
         }
     } else if (m_mtp) {
-        setUrl(QStringLiteral("mtp:udi=%1").arg(m_device.udi()));
+        setUrl(QUrl(QStringLiteral("mtp:udi=%1").arg(m_device.udi())));
     }
 }
 
index a42cb0403a5dcbb8885943e9aae40e523f62b052..25c4d51f67eaed8440ac5ab73f28d6702b975401 100644 (file)
@@ -1099,17 +1099,17 @@ QUrl PlacesItemModel::createTimelineUrl(const QUrl& url)
         const int year = date.year();
         const int month = date.month();
         const int day = date.day();
-        timelineUrl = "timeline:/" + timelineDateString(year, month) +
-              '/' + timelineDateString(year, month, day);
+        timelineUrl = QUrl("timeline:/" + timelineDateString(year, month) +
+              '/' + timelineDateString(year, month, day));
     } else if (path.endsWith(QLatin1String("thismonth"))) {
         const QDate date = QDate::currentDate();
-        timelineUrl = "timeline:/" + timelineDateString(date.year(), date.month());
+        timelineUrl = QUrl("timeline:/" + timelineDateString(date.year(), date.month()));
     } else if (path.endsWith(QLatin1String("lastmonth"))) {
         const QDate date = QDate::currentDate().addMonths(-1);
-        timelineUrl = "timeline:/" + timelineDateString(date.year(), date.month());
+        timelineUrl = QUrl("timeline:/" + timelineDateString(date.year(), date.month()));
     } else {
         Q_ASSERT(path.endsWith(QLatin1String("today")));
-        timelineUrl= url;
+        timelineUrl = url;
     }
 
     return timelineUrl;
index 6a02e02973c9625f5aa51434030cb106c82d504b..3cf7e7652b97c8cdc00e6ce0a79973b603ace318 100644 (file)
@@ -48,7 +48,7 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV
     QTabWidget* tabWidget = new QTabWidget(this);
 
     // initialize 'Behavior' tab
-    BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QDir::homePath(), tabWidget);
+    BehaviorSettingsPage* behaviorPage = new BehaviorSettingsPage(QUrl::fromLocalFile(QDir::homePath()), tabWidget);
     tabWidget->addTab(behaviorPage, i18nc("@title:tab Behavior settings", "Behavior"));
     connect(behaviorPage, &BehaviorSettingsPage::changed, this, static_cast<void(DolphinGeneralConfigModule::*)()>(&DolphinGeneralConfigModule::changed));
 
index ab3744eac89011e2e335fb3a791e0211a667438d..48796ac5a0d549e9e37bddd3a9f0e31c7d0e1a65 100644 (file)
@@ -62,10 +62,10 @@ MountPointObserver* MountPointObserverCache::observerForUrl(const QUrl& url)
         } else {
             // Even if determining the mount point failed, the observer might still
             // be able to retrieve information about the url.
-            cachedObserverUrl = url.toLocalFile();
+            cachedObserverUrl = url;
         }
     } else {
-        cachedObserverUrl = url.url();
+        cachedObserverUrl = url;
     }
 
     MountPointObserver* observer = m_observerForMountPoint.value(cachedObserverUrl);
index 25aad9b51446021d991bac7b3e21f25b1af92ee8..5466fd38efc716351cb6264823208ffe15a37c06 100644 (file)
@@ -1278,7 +1278,7 @@ QUrl DolphinView::openItemAsFolderUrl(const KFileItem& item, const bool browseTh
             if (desktopFile.hasLinkType()) {
                 const QString linkUrl = desktopFile.readUrl();
                 if (!linkUrl.startsWith(QLatin1String("http"))) {
-                    return linkUrl;
+                    return QUrl::fromUserInput(linkUrl);
                 }
             }
         }