Paths like file:/home/me work now instead of showing
an error message.
BUG: 352743
BUG: 353550
FIXED-IN: 15.08.3
REVIEW: 125586
#include "dolphinmainwindow.h"
#include "dolphinmainwindow.h"
#include "dolphindockwidget.h"
#include "dolphincontextmenu.h"
#include "dolphinnewfilemenu.h"
#include "dolphindockwidget.h"
#include "dolphincontextmenu.h"
#include "dolphinnewfilemenu.h"
{
// The default case (left button pressed) is handled in goHome().
if (buttons == Qt::MiddleButton) {
{
// The default case (left button pressed) is handled in goHome().
if (buttons == Qt::MiddleButton) {
- openNewTab(GeneralSettings::self()->homeUrl());
+ openNewTab(Dolphin::homeUrl());
#ifdef KActivities_FOUND
#endif
#ifdef KActivities_FOUND
#endif
#include "dolphin_generalsettings.h"
#include "filterbar/filterbar.h"
#include "search/dolphinsearchbox.h"
#include "dolphin_generalsettings.h"
#include "filterbar/filterbar.h"
#include "search/dolphinsearchbox.h"
const GeneralSettings* settings = GeneralSettings::self();
m_urlNavigator->setUrlEditable(settings->editableUrl());
m_urlNavigator->setShowFullPath(settings->showFullPath());
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()));
KUrlComboBox* editor = m_urlNavigator->editor();
editor->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode()));
// settings of the URL navigator and the filterbar.
m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl());
m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath());
// 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());
}
setFilterBarVisible(GeneralSettings::filterBar());
}
// started with a search-URL, the home URL is used as fallback.
QUrl url = m_searchBox->searchPath();
if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) {
// 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);
}
}
m_urlNavigator->setLocationUrl(url);
}
#include "global.h"
#include "dolphindebug.h"
#include "global.h"
#include "dolphindebug.h"
+#include "dolphin_generalsettings.h"
+
QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
{
QList<QUrl> urls;
QList<QUrl> Dolphin::validateUris(const QStringList& uriList)
{
QList<QUrl> urls;
+
+QUrl Dolphin::homeUrl()
+{
+ return QUrl::fromUserInput(GeneralSettings::homeUrl(), QString(), QUrl::AssumeLocalFile);
+}
namespace Dolphin {
QList<QUrl> validateUris(const QStringList& uriList);
namespace Dolphin {
QList<QUrl> validateUris(const QStringList& uriList);
+
+ /**
+ * Returns the home url which is defined in General Settings
+ */
+ QUrl homeUrl();
if (urls.isEmpty()) {
// We need at least one URL to open Dolphin
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();
}
const bool splitView = parser.isSet("split") || GeneralSettings::splitView();
#include "startupsettingspage.h"
#include "startupsettingspage.h"
#include "dolphinmainwindow.h"
#include "dolphinviewcontainer.h"
#include "dolphinmainwindow.h"
#include "dolphinviewcontainer.h"
{
GeneralSettings* settings = GeneralSettings::self();
{
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));
KFileItem fileItem(url);
if ((url.isValid() && fileItem.isDir()) || (url.scheme() == QLatin1String("timeline"))) {
settings->setHomeUrl(url.toDisplayString(QUrl::PreferLocalFile));
void StartupSettingsPage::selectHomeUrl()
{
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();
if (!url.isEmpty()) {
m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
slotSettingsChanged();
void StartupSettingsPage::loadSettings()
{
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());
m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
m_splitView->setChecked(GeneralSettings::splitView());
m_editableUrl->setChecked(GeneralSettings::editableUrl());