/* ============================================================ * The rekonq project * ============================================================ * SPDX-License-Identifier: GPL-3.0-only * Copyright (C) 2022 aqua * ============================================================ */ #include "bookmarkspanel.hpp" #include "bookmarks/bookmarkstreemodel.hpp" BookmarksPanel::BookmarksPanel(QWidget *parent) : QTreeView(parent) { connect(this, &QTreeView::activated, this, [this](const QModelIndex &index) { auto *item = model()->item(index); const auto url = item->data(BookmarksTreeItem::Href).toUrl(); emit loadUrl(url, rekonq::CurrentTab); }); } BookmarkModel *BookmarksPanel::model() const { auto *m = qobject_cast(QTreeView::model()); Q_CHECK_PTR(m); return m; }