mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
BrowsingLibrary: Clear search line when switching tabs
This commit is contained in:
parent
ca39d3cd14
commit
d000ae0d0b
@ -62,30 +62,12 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
|
|||||||
m->addAction(tr("Export Bookmarks..."), this, SLOT(exportBookmarks()));
|
m->addAction(tr("Export Bookmarks..."), this, SLOT(exportBookmarks()));
|
||||||
ui->importExport->setMenu(m);
|
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()));
|
connect(ui->searchLine, SIGNAL(textChanged(QString)), this, SLOT(search()));
|
||||||
|
|
||||||
QzTools::setWmClass("Browsing Library", this);
|
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()
|
void BrowsingLibrary::search()
|
||||||
{
|
{
|
||||||
if (ui->tabs->current_index() == 0) {
|
if (ui->tabs->current_index() == 0) {
|
||||||
|
@ -47,7 +47,6 @@ public:
|
|||||||
BookmarksManager* bookmarksManager() { return m_bookmarksManager; }
|
BookmarksManager* bookmarksManager() { return m_bookmarksManager; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void currentIndexChanged(int index);
|
|
||||||
void search();
|
void search();
|
||||||
|
|
||||||
void importBookmarks();
|
void importBookmarks();
|
||||||
|
Loading…
Reference in New Issue
Block a user