X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6719072837f30c1822768da65e6ea222e987e32f..76e3eab6ea3545339da2fd30b838acbc8c0ff607:/src/dolphinurlnavigator.cpp diff --git a/src/dolphinurlnavigator.cpp b/src/dolphinurlnavigator.cpp index 1dfe5420f..ad0a86b77 100644 --- a/src/dolphinurlnavigator.cpp +++ b/src/dolphinurlnavigator.cpp @@ -12,43 +12,43 @@ #include "dolphinurlnavigatorscontroller.h" #include "global.h" -#include #include +#include #include #include #include -DolphinUrlNavigator::DolphinUrlNavigator(QWidget *parent) : - DolphinUrlNavigator(QUrl(), parent) -{} +DolphinUrlNavigator::DolphinUrlNavigator(QWidget *parent) + : DolphinUrlNavigator(QUrl(), parent) +{ +} -DolphinUrlNavigator::DolphinUrlNavigator(const QUrl &url, QWidget *parent) : - KUrlNavigator(DolphinPlacesModelSingleton::instance().placesModel(), url, parent) +DolphinUrlNavigator::DolphinUrlNavigator(const QUrl &url, QWidget *parent) + : KUrlNavigator(DolphinPlacesModelSingleton::instance().placesModel(), url, parent) { - const GeneralSettings* settings = GeneralSettings::self(); + const GeneralSettings *settings = GeneralSettings::self(); setUrlEditable(settings->editableUrl()); setShowFullPath(settings->showFullPath()); setHomeUrl(Dolphin::homeUrl()); setPlacesSelectorVisible(DolphinUrlNavigatorsController::placesSelectorVisible()); editor()->setCompletionMode(KCompletion::CompletionMode(settings->urlCompletionMode())); setWhatsThis(xi18nc("@info:whatsthis location bar", - "This describes the location of the files and folders " - "displayed below.The name of the currently viewed " - "folder can be read at the very right. To the left of it is the " - "name of the folder that contains it. The whole line is called " - "the path to the current location because " - "following these folders from left to right leads here." - "This interactive path " - "is more powerful than one would expect. To learn more " - "about the basic and advanced features of the location bar " - "click here. " - "This will open the dedicated page in the Handbook.")); + "This describes the location of the files and folders " + "displayed below.The name of the currently viewed " + "folder can be read at the very right. To the left of it is the " + "name of the folder that contains it. The whole line is called " + "the path to the current location because " + "following these folders from left to right leads here." + "This interactive path " + "is more powerful than one would expect. To learn more " + "about the basic and advanced features of the location bar " + "click here. " + "This will open the dedicated page in the Handbook.")); DolphinUrlNavigatorsController::registerDolphinUrlNavigator(this); - connect(this, &KUrlNavigator::returnPressed, - this, &DolphinUrlNavigator::slotReturnPressed); + connect(this, &KUrlNavigator::returnPressed, this, &DolphinUrlNavigator::slotReturnPressed); } DolphinUrlNavigator::~DolphinUrlNavigator() @@ -85,7 +85,7 @@ std::unique_ptr DolphinUrlNavigator::visualSta return visualState; } -void DolphinUrlNavigator::setVisualState(const VisualState& visualState) +void DolphinUrlNavigator::setVisualState(const VisualState &visualState) { setUrlEditable(visualState.isUrlEditable); if (!visualState.isUrlEditable) { @@ -101,6 +101,16 @@ void DolphinUrlNavigator::setVisualState(const VisualState& visualState) } } +void DolphinUrlNavigator::clearText() const +{ + editor()->lineEdit()->clear(); +} + +void DolphinUrlNavigator::setPlaceholderText(const QString &text) +{ + editor()->lineEdit()->setPlaceholderText(text); +} + void DolphinUrlNavigator::slotReturnPressed() { if (!GeneralSettings::editableUrl()) {