aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-04-18 21:37:52 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-04-18 21:37:52 +0200
commit0b70b2802e355a44e6ccbbfcabd03c0992f812e0 (patch)
tree26491a414e5711574aa3a925662b6ca78d59704f /lib/bookmarks
parentStyle pass (diff)
downloadsmolbote-0b70b2802e355a44e6ccbbfcabd03c0992f812e0.tar.xz
Load URL/Search page menu actions
Diffstat (limited to 'lib/bookmarks')
-rw-r--r--lib/bookmarks/bookmarkswidget.cpp12
-rw-r--r--lib/bookmarks/bookmarkswidget.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/bookmarks/bookmarkswidget.cpp b/lib/bookmarks/bookmarkswidget.cpp
index cae1eb3..f56c53b 100644
--- a/lib/bookmarks/bookmarkswidget.cpp
+++ b/lib/bookmarks/bookmarkswidget.cpp
@@ -105,11 +105,6 @@ BookmarksWidget::~BookmarksWidget()
delete ui;
}
-BookmarksView *BookmarksWidget::model() const
-{
- return ui->treeWidget;
-}
-
void BookmarksWidget::save()
{
/*
@@ -129,6 +124,13 @@ void BookmarksWidget::save()
}
}
+void BookmarksWidget::addBookmark(const QString &title, const QString &url)
+{
+ auto *bookmark = ui->treeWidget->createBookmark(nullptr);
+ bookmark->setText(0, title);
+ bookmark->setText(1, url);
+}
+
void BookmarksWidget::search(const QString &term, std::function<void(QStringList &)> callback) const
{
QStringList ret;
diff --git a/lib/bookmarks/bookmarkswidget.h b/lib/bookmarks/bookmarkswidget.h
index 40f5c04..b1934b3 100644
--- a/lib/bookmarks/bookmarkswidget.h
+++ b/lib/bookmarks/bookmarkswidget.h
@@ -27,7 +27,6 @@ class BookmarksWidget : public QWidget
public:
explicit BookmarksWidget(const QString &path, QWidget *parent = nullptr);
~BookmarksWidget() override;
- BookmarksView *model() const;
void save();
@@ -35,6 +34,7 @@ signals:
void openUrl(const QUrl &url);
public slots:
+ void addBookmark(const QString &title, const QString &url);
void search(const QString &term, std::function<void(QStringList &)> callback) const;
private: