From 1b1e327cb73491c17972a33a07c3c9beafe7f938 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 18 Sep 2022 09:57:29 +0300 Subject: Add Navigation and Tab toolbars --- src/bookmarks/bookmarksmenu.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/bookmarks/bookmarksmenu.cpp (limited to 'src/bookmarks/bookmarksmenu.cpp') diff --git a/src/bookmarks/bookmarksmenu.cpp b/src/bookmarks/bookmarksmenu.cpp deleted file mode 100644 index aad7289e..00000000 --- a/src/bookmarks/bookmarksmenu.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* ============================================================ - * The rekonq project - * ============================================================ - * SPDX-License-Identifier: GPL-2.0-or-later - * Copyright (C) 2008-2013 by Andrea Diamantini - * Copyright (C) 2010 by Yoann Laissus - * SPDX-License-Identifier: GPL-3.0-only - * Copyright (C) 2022 aqua - * ============================================================ */ - -#include "bookmarksmenu.hpp" -#include "bookmarkstreemodel.hpp" - -BookmarksMenu::BookmarksMenu(QWidget *parent) : QMenu(parent) -{ - connect(this, &QMenu::aboutToShow, this, &BookmarksMenu::refill); -} - -void BookmarksMenu::refill() -{ - Q_CHECK_PTR(model); - - for (auto *a : actions) { - removeAction(a); - delete a; - } - actions.clear(); - - actions.append(addSeparator()); - - const auto *root = model->item(); - Q_CHECK_PTR(root); - for (int i = 0; i < root->childCount(); ++i) { - const auto *child = root->child(i); - if (child->type() != BookmarksTreeItem::Bookmark) continue; - auto *action = addAction(child->data(BookmarksTreeItem::Title).toString(), this, [this, child]() { - emit loadUrl(child->data(BookmarksTreeItem::Href).toUrl(), rekonq::CurrentTab); - }); - actions.append(action); - } -} -- cgit v1.2.1