[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/dolphin/src/search
From:       Peter Penz <peter.penz19 () gmail ! com>
Date:       2010-11-25 15:42:16
Message-ID: 20101125154216.1812BAC8A2 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1200741 by ppenz:

Don't offer the "Search everywhere" option for non-local URLs.


 M  +26 -18    dolphinsearchbox.cpp  
 M  +4 -2      dolphinsearchbox.h  


--- trunk/KDE/kdebase/apps/dolphin/src/search/dolphinsearchbox.cpp #1200740:1200741
@@ -57,10 +57,11 @@
     m_nepomukActivated(false),
     m_topLayout(0),
     m_searchInput(0),
+    m_fileNameButton(0),
+    m_contentButton(0),
+    m_separator(0),
     m_fromHereButton(0),
     m_everywhereButton(0),
-    m_fileNameButton(0),
-    m_contentButton(0),
     m_searchPath(),
     m_startSearchTimer(0)
 {
@@ -94,6 +95,11 @@
 
     const QString elidedLocation = metrics.elidedText(location, Qt::ElideMiddle, maxWidth);
     m_fromHereButton->setText(i18nc("action:button", "From Here (%1)", elidedLocation));
+
+    const bool showSearchFromButtons = url.isLocalFile();
+    m_separator->setVisible(showSearchFromButtons);
+    m_fromHereButton->setVisible(showSearchFromButtons);
+    m_everywhereButton->setVisible(showSearchFromButtons);
 }
 
 KUrl DolphinSearchBox::searchPath() const
@@ -249,6 +255,21 @@
     searchInputLayout->addWidget(searchLabel);
     searchInputLayout->addWidget(m_searchInput);
 
+    // Create "Filename" and "Content" button
+    m_fileNameButton = new QPushButton(this);
+    m_fileNameButton->setText(i18nc("action:button", "Filename"));
+    initButton(m_fileNameButton);
+
+    m_contentButton = new QPushButton();
+    m_contentButton->setText(i18nc("action:button", "Content"));
+    initButton(m_contentButton);;
+
+    QButtonGroup* searchWhatGroup = new QButtonGroup(this);
+    searchWhatGroup->addButton(m_fileNameButton);
+    searchWhatGroup->addButton(m_contentButton);
+
+    m_separator = new KSeparator(Qt::Vertical, this);
+
     // Create "From Here" and "Everywhere"button
     m_fromHereButton = new QPushButton(this);
     m_fromHereButton->setText(i18nc("action:button", "From Here"));
@@ -262,27 +283,14 @@
     searchLocationGroup->addButton(m_fromHereButton);
     searchLocationGroup->addButton(m_everywhereButton);
 
-    // Create "Filename" and "Content" button
-    m_fileNameButton = new QPushButton(this);
-    m_fileNameButton->setText(i18nc("action:button", "Filename"));
-    initButton(m_fileNameButton);
-
-    m_contentButton = new QPushButton();
-    m_contentButton->setText(i18nc("action:button", "Content"));
-    initButton(m_contentButton);;
-
-    QButtonGroup* searchWhatGroup = new QButtonGroup(this);
-    searchWhatGroup->addButton(m_fileNameButton);
-    searchWhatGroup->addButton(m_contentButton);
-
     // Apply layout for the options
     QHBoxLayout* optionsLayout = new QHBoxLayout();
     optionsLayout->setMargin(0);
+    optionsLayout->addWidget(m_fileNameButton);
+    optionsLayout->addWidget(m_contentButton);
+    optionsLayout->addWidget(m_separator);
     optionsLayout->addWidget(m_fromHereButton);
     optionsLayout->addWidget(m_everywhereButton);
-    optionsLayout->addWidget(new KSeparator(Qt::Vertical));
-    optionsLayout->addWidget(m_fileNameButton);
-    optionsLayout->addWidget(m_contentButton);
     optionsLayout->addStretch(1);
 
     m_topLayout = new QVBoxLayout(this);
--- trunk/KDE/kdebase/apps/dolphin/src/search/dolphinsearchbox.h #1200740:1200741
@@ -26,6 +26,7 @@
 
 class AbstractSearchFilterWidget;
 class KLineEdit;
+class KSeparator;
 class QFormLayout;
 class QPushButton;
 class QVBoxLayout;
@@ -119,10 +120,11 @@
     QVBoxLayout* m_topLayout;
 
     KLineEdit* m_searchInput;
+    QPushButton* m_fileNameButton;
+    QPushButton* m_contentButton;
+    KSeparator* m_separator;
     QPushButton* m_fromHereButton;
     QPushButton* m_everywhereButton;
-    QPushButton* m_fileNameButton;
-    QPushButton* m_contentButton;
 
     KUrl m_searchPath;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic