diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-15 22:58:20 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-15 22:58:20 +0200 |
commit | c407c15457b24cfcd85c32cb62473489645858f7 (patch) | |
tree | 035535c86de7dd39e79fcb2284d5b9628b44ea9c /src | |
parent | SubWindow: delete views right away when closing tab (diff) | |
download | smolbote-c407c15457b24cfcd85c32cb62473489645858f7.tar.xz |
Bookmarks manager bugfixes
WebProfile: remove addBookmark signal and member
Bookmarks: remove unused '...' button
Bookmarks: stop crashing if there's no selected item
Bookmarks: activating an item will only open it if it's a bookmark
Bookmarks: change header size split
Diffstat (limited to 'src')
-rw-r--r-- | src/browser.cpp | 1 | ||||
-rw-r--r-- | src/browser.h | 5 | ||||
-rw-r--r-- | src/webengine/widgets/pagemenu.cpp | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index 7c7dca3..4c6549c 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -145,7 +145,6 @@ void Browser::setup(const QString &defaultProfile) connect(m_bookmarks.get(), &BookmarksWidget::openUrl, this, [this](const QUrl &url) { m_windows.last()->createTab(url); }); - connect(WebProfile::defaultProfile(), &WebProfile::addBookmarkRequested, m_bookmarks.get(), &BookmarksWidget::addBookmark); // downloads m_downloads = std::make_shared<DownloadsWidget>(QString::fromStdString(m_config->value<std::string>("downloads.path").value())); diff --git a/src/browser.h b/src/browser.h index e6b94e4..8148e99 100644 --- a/src/browser.h +++ b/src/browser.h @@ -36,6 +36,11 @@ public: void setConfiguration(std::shared_ptr<Configuration> &config); void setup(const QString &defaultProfile); + std::shared_ptr<BookmarksWidget> bookmarks() + { + return m_bookmarks; + } + WebProfile *profile(const QString &name) const; const QStringList profiles() const { diff --git a/src/webengine/widgets/pagemenu.cpp b/src/webengine/widgets/pagemenu.cpp index 9cfeb71..21efd3d 100644 --- a/src/webengine/widgets/pagemenu.cpp +++ b/src/webengine/widgets/pagemenu.cpp @@ -19,6 +19,7 @@ #include <QVBoxLayout> #include <QWidgetAction> #include "browser.h" +#include <bookmarks/bookmarkswidget.h> PageMenu::PageMenu(WebView *parent) : QMenu(tr("Page"), parent) @@ -28,7 +29,9 @@ PageMenu::PageMenu(WebView *parent) auto *bookmarkAction = addAction(tr("Bookmark page")); connect(bookmarkAction, &QAction::triggered, parent, [parent]() { - parent->profile()->addBookmark(parent->title(), parent->url().toString()); + auto *browser = qobject_cast<Browser *>(qApp); + Q_CHECK_PTR(browser); + browser->bookmarks()->addBookmark(parent->title(), parent->url().toString()); }); auto *savePageAction = addAction(tr("Save Page")); |