summaryrefslogtreecommitdiff
path: root/src/panels/bookmarksmenu.hpp
blob: f162244e0f544b01ffbc00cdcc15dbe9c673ea4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ============================================================
 *     The rekonq project
 * ============================================================
 * SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright (C) 2008-2013 by Andrea Diamantini <adjam7 at gmail dot com>
 * Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com>
 * SPDX-License-Identifier: GPL-3.0-only
 * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
 * ============================================================ */

#pragma once

#include "rekonq.hpp"
#include <QMenu>

class BookmarksTreeModel;
class BookmarksMenu : public QMenu {
  Q_OBJECT

public:
  explicit BookmarksMenu(QWidget *parent = nullptr);
  ~BookmarksMenu() override = default;

  void setModel(const BookmarksTreeModel *ptr)
  {
    Q_CHECK_PTR(ptr);
    model = ptr;
  }

signals:
  void loadUrl(const QUrl &url, rekonq::OpenType type);

private slots:
  void refill();

private:
  const BookmarksTreeModel *model = nullptr;
  QList<QAction *> actions;
};