1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

BrowsingLibrary: Clear search line when switching tabs

This commit is contained in:
David Rosca 2016-12-31 10:11:52 +01:00
parent ca39d3cd14
commit d000ae0d0b
2 changed files with 1 additions and 20 deletions

View File

@ -62,30 +62,12 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
m->addAction(tr("Export Bookmarks..."), this, SLOT(exportBookmarks()));
ui->importExport->setMenu(m);
connect(ui->tabs, SIGNAL(CurrentChanged(int)), this, SLOT(currentIndexChanged(int)));
connect(ui->tabs, &FancyTabWidget::CurrentChanged, ui->searchLine, &QLineEdit::clear);
connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(search()));
QzTools::setWmClass("Browsing Library", this);
}
void BrowsingLibrary::currentIndexChanged(int index)
{
switch (index) {
case 0:
ui->searchLine->show();
search();
break;
case 1:
ui->searchLine->show();
search();
break;
default:
qWarning("BrowsingLibrary::currentIndexChanged() received index out of range!");
}
}
void BrowsingLibrary::search()
{
if (ui->tabs->current_index() == 0) {

View File

@ -47,7 +47,6 @@ public:
BookmarksManager* bookmarksManager() { return m_bookmarksManager; }
private slots:
void currentIndexChanged(int index);
void search();
void importBookmarks();