aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks
diff options
context:
space:
mode:
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: