This fixes some URLs built from local paths without scheme.
)
endif()
+add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
+
add_subdirectory(src)
add_subdirectory(doc)
// Used for GeneralSettings::version() to determine whether
// an updated version of Dolphin is running.
const int CurrentDolphinVersion = 200;
-};
+}
DolphinMainWindow::DolphinMainWindow() :
KXmlGuiWindow(0),
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,
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);
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
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())));
}
}
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;
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));
} 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);
if (desktopFile.hasLinkType()) {
const QString linkUrl = desktopFile.readUrl();
if (!linkUrl.startsWith(QLatin1String("http"))) {
- return linkUrl;
+ return QUrl::fromUserInput(linkUrl);
}
}
}