X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7f4c3976c0626657362b6324c0dad2867cc24e9b..c2c075011c0924fb6af3ae345f839620ea78afc2:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 8fea3ba9d..1c43fc977 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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())); @@ -94,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, @@ -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); } @@ -575,16 +576,16 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url) // When an URL has been entered, the view should get the focus. // The focus must be requested asynchronously, as changing the URL might create // a new view widget. - QTimer::singleShot(0, this, SLOT(requestFocus())); + QTimer::singleShot(0, this, &DolphinViewContainer::requestFocus); } } else if (KProtocolManager::isSourceProtocol(url)) { - QString app = "konqueror"; + QString app = QStringLiteral("konqueror"); if (url.scheme().startsWith(QLatin1String("http"))) { showMessage(i18nc("@info:status", // krazy:exclude=qmethods "Dolphin does not support web pages, the web browser has been launched"), Information); - const KConfigGroup config(KSharedConfig::openConfig("kdeglobals"), "General"); + const KConfigGroup config(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), "General"); const QString browser = config.readEntry("BrowserApplication"); if (!browser.isEmpty()) { app = browser; @@ -653,7 +654,7 @@ void DolphinViewContainer::startSearching() { const QUrl url = m_searchBox->urlForSearching(); if (url.isValid() && !url.isEmpty()) { - m_view->setViewPropertiesContext("search"); + m_view->setViewPropertiesContext(QStringLiteral("search")); m_urlNavigator->setLocationUrl(url); } } @@ -681,7 +682,7 @@ void DolphinViewContainer::showErrorMessage(const QString& msg) bool DolphinViewContainer::isSearchUrl(const QUrl& url) const { - return url.scheme().contains("search"); + return url.scheme().contains(QStringLiteral("search")); } void DolphinViewContainer::saveViewState()