summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2016-06-25 16:39:49 +0200
committerDavid Faure <[email protected]>2016-06-25 16:40:18 +0200
commite615bfaed4cd562d31ea0506529f730c414b6ec0 (patch)
treee83924de3e0a12c63f13fccf8f04bfcc39a1dd34
parent6bb62f17b525baf89e7f35f4f3a321876c3a31ab (diff)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING) + fix compilation
This fixes some URLs built from local paths without scheme.
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/dolphinmainwindow.cpp2
-rw-r--r--src/dolphinviewcontainer.cpp2
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.cpp10
-rw-r--r--src/panels/places/placesitem.cpp6
-rw-r--r--src/panels/places/placesitemmodel.cpp10
-rw-r--r--src/settings/kcm/kcmdolphingeneral.cpp2
-rw-r--r--src/statusbar/mountpointobservercache.cpp4
-rw-r--r--src/views/dolphinview.cpp2
9 files changed, 21 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e61113..86b06e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,6 +102,8 @@ else()
)
endif()
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
+
add_subdirectory(src)
add_subdirectory(doc)
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 3a06d2c..34008b5 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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),
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 73ffd5c..1c43fc9 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -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,
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
index fe30f62..92a0200 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
@@ -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
diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp
index a04064d..b32f820 100644
--- a/src/panels/places/placesitem.cpp
+++ b/src/panels/places/placesitem.cpp
@@ -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())));
}
}
diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp
index a42cb04..25c4d51 100644
--- a/src/panels/places/placesitemmodel.cpp
+++ b/src/panels/places/placesitemmodel.cpp
@@ -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;
diff --git a/src/settings/kcm/kcmdolphingeneral.cpp b/src/settings/kcm/kcmdolphingeneral.cpp
index 6a02e02..3cf7e76 100644
--- a/src/settings/kcm/kcmdolphingeneral.cpp
+++ b/src/settings/kcm/kcmdolphingeneral.cpp
@@ -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));
diff --git a/src/statusbar/mountpointobservercache.cpp b/src/statusbar/mountpointobservercache.cpp
index ab3744e..48796ac 100644
--- a/src/statusbar/mountpointobservercache.cpp
+++ b/src/statusbar/mountpointobservercache.cpp
@@ -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);
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 25aad9b..5466fd3 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -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);
}
}
}