]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Automatically set url location bar to non-editable when focus out
authorWeng Xuetian <wengxt@gmail.com>
Sat, 29 Dec 2012 17:49:51 +0000 (12:49 -0500)
committerWeng Xuetian <wengxt@gmail.com>
Sat, 29 Dec 2012 17:49:51 +0000 (12:49 -0500)
BUG: 157593
REVIEW: 107748

src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h

index 8800a1732ebe6d3104f605f6aa90931747c9a369..26a6803ae086b381c3a8e00f769182ac5ba3999b 100644 (file)
@@ -128,6 +128,8 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
             this, SLOT(slotUrlNavigatorLocationChanged(KUrl)));
     connect(m_urlNavigator, SIGNAL(historyChanged()),
             this, SLOT(slotHistoryChanged()));
+    connect(m_urlNavigator, SIGNAL(returnPressed()),
+            this, SLOT(slotReturnPressed()));
 
     // Initialize status bar
     m_statusBar = new DolphinStatusBar(this);
@@ -574,6 +576,8 @@ void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl&
 
 void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
 {
+    slotReturnPressed();
+
     if (KProtocolManager::supportsListing(url)) {
         setSearchModeEnabled(isSearchUrl(url));
         m_view->setUrl(url);
@@ -657,6 +661,13 @@ void DolphinViewContainer::slotHistoryChanged()
     }
 }
 
+void DolphinViewContainer::slotReturnPressed()
+{
+    if (!GeneralSettings::editableUrl()) {
+        m_urlNavigator->setUrlEditable(false);
+    }
+}
+
 void DolphinViewContainer::startSearching()
 {
     const KUrl url = m_searchBox->urlForSearching();
index e2d1b18752ba36e318c3357d6d89da0c3d459309..bc58531a2700d6e50a1c32a4afccb77472255eff 100644 (file)
@@ -282,6 +282,8 @@ private slots:
 
     void slotHistoryChanged();
 
+    void slotReturnPressed();
+
     /**
      * Gets the search URL from the searchbox and starts searching.
      */