]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Hide search-mode buttons in the read-only mode
authorPeter Penz <peter.penz19@gmail.com>
Thu, 10 Mar 2011 22:26:16 +0000 (23:26 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 10 Mar 2011 22:28:33 +0000 (23:28 +0100)
When a searching has been triggered externally (e.g. by clicking on a tag) the search-mode settings like "From here"... are ignored and should not be shown at all. The current patch is only a quick workaround until a clean layout will be provided for this case.

src/search/dolphinsearchbox.cpp

index 17a691e44c0ce12bdeecde33e3d944a3981c0055..eb1b8dff8284a943f2f0810ccba25158c07334a5 100644 (file)
@@ -104,7 +104,7 @@ void DolphinSearchBox::setSearchPath(const KUrl& url)
     const QString elidedLocation = metrics.elidedText(location, Qt::ElideMiddle, maxWidth);
     m_fromHereButton->setText(i18nc("action:button", "From Here (%1)", elidedLocation));
 
-    const bool showSearchFromButtons = url.isLocalFile();
+    const bool showSearchFromButtons = url.isLocalFile() && !m_readOnly;
     m_separator->setVisible(showSearchFromButtons);
     m_fromHereButton->setVisible(showSearchFromButtons);
     m_everywhereButton->setVisible(showSearchFromButtons);
@@ -393,10 +393,10 @@ void DolphinSearchBox::applyReadOnlyState()
     // has been done
     m_searchInput->setVisible(!m_readOnly);
     m_infoLabel->setVisible(m_readOnly);
-    m_fileNameButton->setEnabled(!m_readOnly);
-    m_contentButton->setEnabled(!m_readOnly);
-    m_fromHereButton->setEnabled(!m_readOnly);
-    m_everywhereButton->setEnabled(!m_readOnly);
+    m_fileNameButton->setVisible(!m_readOnly);
+    m_contentButton->setVisible(!m_readOnly);
+    m_fromHereButton->setVisible(!m_readOnly);
+    m_everywhereButton->setVisible(!m_readOnly);
 }
 
 #include "dolphinsearchbox.moc"