[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.1/kdebase/runtime/kurifilter-plugins/ikws
From: Frederik Gladhorn <gladhorn () kde ! org>
Date: 2008-10-12 13:41:34
Message-ID: 1223818894.615722.4170.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 870407 by gladhorn:
backport 870406
M +1 -2 ikwsopts.cpp
M +21 -16 searchproviderdlg.cpp
M +1 -1 searchproviderdlg.h
--- branches/KDE/4.1/kdebase/runtime/kurifilter-plugins/ikws/ikwsopts.cpp \
#870406:870407 @@ -343,8 +343,7 @@
{
SearchProviderDialog dlg(0, this);
- // Provider can be 0 if the user chooses accept but has not entered \{...} in the \
query and chooses cancel then.
- if (dlg.exec() && dlg.provider())
+ if (dlg.exec())
{
m_dlg->lvSearchProviders->setCurrentItem(displaySearchProvider(dlg.provider()));
configChanged();
--- branches/KDE/4.1/kdebase/runtime/kurifilter-plugins/ikws/searchproviderdlg.cpp \
#870406:870407 @@ -73,23 +73,28 @@
|| m_dlg->leQuery->text().isEmpty()));
}
-void SearchProviderDialog::slotOk()
-{
- if ((m_dlg->leQuery->text().indexOf("\\{") == -1)
- && KMessageBox::warningContinueCancel(0,
- i18n("The URI does not contain a \\{...} placeholder for the user \
query.\n"
- "This means that the same page is always going to be visited, "
- "regardless of what the user types."),
- QString(), KGuiItem(i18n("Keep It"))) == KMessageBox::Cancel)
- return;
- if (!m_provider)
- m_provider = new SearchProvider;
- m_provider->setName(m_dlg->leName->text().trimmed());
- m_provider->setQuery(m_dlg->leQuery->text().trimmed());
- m_provider->setKeys(m_dlg->leShortcut->text().trimmed().split(",", \
QString::SkipEmptyParts));
- m_provider->setCharset(m_dlg->cbCharset->currentIndex() ? \
m_dlg->cbCharset->currentText() : QString());
- KDialog::accept();
+void SearchProviderDialog::slotButtonClicked(int button) {
+ if (button == KDialog::Ok) {
+ if ((m_dlg->leQuery->text().indexOf("\\{") == -1)
+ && KMessageBox::warningContinueCancel(0,
+ i18n("The URI does not contain a \\{...} placeholder for the user \
query.\n" + "This means that the same page is always going to be \
visited, " + "regardless of what the user types."),
+ QString(), KGuiItem(i18n("Keep It"))) == KMessageBox::Cancel) {
+ return;
+ }
+
+ if (!m_provider)
+ m_provider = new SearchProvider;
+ m_provider->setName(m_dlg->leName->text().trimmed());
+ m_provider->setQuery(m_dlg->leQuery->text().trimmed());
+ m_provider->setKeys(m_dlg->leShortcut->text().trimmed().split(",", \
QString::SkipEmptyParts)); + \
m_provider->setCharset(m_dlg->cbCharset->currentIndex() ? \
m_dlg->cbCharset->currentText() : QString()); + KDialog::accept();
+ } else {
+ KDialog::slotButtonClicked(button);
+ }
}
#include "searchproviderdlg.moc"
--- branches/KDE/4.1/kdebase/runtime/kurifilter-plugins/ikws/searchproviderdlg.h \
#870406:870407 @@ -45,7 +45,7 @@
protected Q_SLOTS:
void slotChanged();
- void slotOk();
+ virtual void slotButtonClicked(int button);
private:
SearchProvider *m_provider;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic