From 216d98844be14f10f88de47608cb6068115f0975 Mon Sep 17 00:00:00 2001
From: Chocobo1
Date: Sat, 12 Mar 2016 20:04:03 +0800
Subject: [PATCH] Move m_searchPattern widget from code to .ui file
---
src/gui/search/searchwidget.cpp | 8 +-------
src/gui/search/searchwidget.h | 2 --
src/gui/search/searchwidget.ui | 10 ++++++++++
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/gui/search/searchwidget.cpp b/src/gui/search/searchwidget.cpp
index a0908977c..f52cb3a41 100644
--- a/src/gui/search/searchwidget.cpp
+++ b/src/gui/search/searchwidget.cpp
@@ -61,7 +61,6 @@
#include "mainwindow.h"
#include "addnewtorrentdialog.h"
#include "guiiconprovider.h"
-#include "lineedit.h"
#include "pluginselectdlg.h"
#include "searchsortmodel.h"
#include "searchtab.h"
@@ -78,13 +77,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
{
setupUi(this);
- m_searchPattern = new LineEdit(this);
- searchBarLayout->insertWidget(0, m_searchPattern);
- connect(m_searchPattern, SIGNAL(returnPressed()), searchButton, SLOT(click()));
-
QString searchPatternHint;
QTextStream stream(&searchPatternHint, QIODevice::WriteOnly);
-
stream << "
"
<< tr("A phrase to search for.") << "
"
<< tr("Spaces in a search term may be protected by double quotes.")
@@ -99,7 +93,6 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
"Search phrase example, illustrates quotes usage, double quoted"
"pair of space delimited words, the whole pair is highlighted")
<< "
" << flush;
-
m_searchPattern->setToolTip(searchPatternHint);
// Icons
@@ -120,6 +113,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
fillCatCombobox();
fillPluginComboBox();
+ connect(m_searchPattern, SIGNAL(returnPressed()), searchButton, SLOT(click()));
connect(m_searchPattern, SIGNAL(textEdited(QString)), this, SLOT(searchTextEdited(QString)));
connect(selectPlugin, SIGNAL(currentIndexChanged(int)), this, SLOT(selectMultipleBox(int)));
}
diff --git a/src/gui/search/searchwidget.h b/src/gui/search/searchwidget.h
index b09dddd47..4d8f74de6 100644
--- a/src/gui/search/searchwidget.h
+++ b/src/gui/search/searchwidget.h
@@ -38,7 +38,6 @@
#include "ui_searchwidget.h"
class MainWindow;
-class LineEdit;
class SearchEngine;
struct SearchResult;
class SearchTab;
@@ -82,7 +81,6 @@ private:
QString selectedCategory() const;
QString selectedPlugin() const;
- LineEdit *m_searchPattern;
SearchEngine *m_searchEngine;
QPointer m_currentSearchTab; // Selected tab
QPointer m_activeSearchTab; // Tab with running search
diff --git a/src/gui/search/searchwidget.ui b/src/gui/search/searchwidget.ui
index a4a8471ef..d3acb07f0 100644
--- a/src/gui/search/searchwidget.ui
+++ b/src/gui/search/searchwidget.ui
@@ -16,6 +16,9 @@
-
+
-
+
+
-
@@ -114,6 +117,13 @@
+
+
+ LineEdit
+ QLineEdit
+
+
+