aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-04-17 13:36:08 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-04-17 13:36:08 +0200
commit1e99b19616f102b57f52dfc01ea3ccdb6a24a607 (patch)
tree120672a1635e3bc2110b780d93afbfe0a9f30216 /lib
parentAddress bar searches work again (diff)
downloadsmolbote-1e99b19616f102b57f52dfc01ea3ccdb6a24a607.tar.xz
Add loading progess bar to the address bar
Diffstat (limited to 'lib')
-rw-r--r--lib/bookmarks/bookmarkswidget.cpp4
-rw-r--r--lib/bookmarks/bookmarkswidget.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/bookmarks/bookmarkswidget.cpp b/lib/bookmarks/bookmarkswidget.cpp
index b5bf471..339e913 100644
--- a/lib/bookmarks/bookmarkswidget.cpp
+++ b/lib/bookmarks/bookmarkswidget.cpp
@@ -129,7 +129,7 @@ void BookmarksWidget::save()
}
}
-QStringList BookmarksWidget::search(const QString& term) const
+void BookmarksWidget::search(const QString& term, std::function<void(QStringList&)> callback) const
{
QStringList ret;
const QList<QTreeWidgetItem *> res = ui->treeWidget->findItems(term, Qt::MatchContains | Qt::MatchRecursive, 1);
@@ -138,5 +138,5 @@ QStringList BookmarksWidget::search(const QString& term) const
ret.append(i->text(1));
}
- return ret;
+ callback(ret);
}
diff --git a/lib/bookmarks/bookmarkswidget.h b/lib/bookmarks/bookmarkswidget.h
index f0cd73d..6322918 100644
--- a/lib/bookmarks/bookmarkswidget.h
+++ b/lib/bookmarks/bookmarkswidget.h
@@ -35,7 +35,7 @@ signals:
void openUrl(const QUrl &url);
public slots:
- QStringList search(const QString &term) const;
+ void search(const QString &term, std::function<void(QStringList&)> callback) const;
private:
Ui::BookmarksDialog *ui;