| 1 | // -*- c-basic-offset:4; indent-tabs-mode:nil -*- |
|---|---|
| 2 | /* |
| 3 | This file is part of the KDE libraries |
| 4 | SPDX-FileCopyrightText: 2000 David Faure <faure@kde.org> |
| 5 | SPDX-FileCopyrightText: 2003 Alexander Kellett <lypanov@kde.org> |
| 6 | SPDX-FileCopyrightText: 2008 Norbert Frese <nf2@scheinwelt.at> |
| 7 | |
| 8 | SPDX-License-Identifier: LGPL-2.0-only |
| 9 | */ |
| 10 | |
| 11 | #include "kbookmarkowner.h" |
| 12 | |
| 13 | class Q_DECL_HIDDEN KBookmarkOwner::FutureBookmarkPrivate : public QSharedData |
| 14 | { |
| 15 | public: |
| 16 | QString title; |
| 17 | QUrl url; |
| 18 | QString icon; |
| 19 | }; |
| 20 | |
| 21 | KBookmarkOwner::FutureBookmark::FutureBookmark(const QString &title, const QUrl &url, const QString &icon) |
| 22 | : d(new FutureBookmarkPrivate) |
| 23 | { |
| 24 | d->title = title; |
| 25 | d->url = url; |
| 26 | d->icon = icon; |
| 27 | } |
| 28 | |
| 29 | KBookmarkOwner::FutureBookmark::FutureBookmark(const FutureBookmark &other) |
| 30 | : d(other.d) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | KBookmarkOwner::FutureBookmark &KBookmarkOwner::FutureBookmark::operator=(const FutureBookmark &other) |
| 35 | { |
| 36 | d = other.d; |
| 37 | return *this; |
| 38 | } |
| 39 | |
| 40 | KBookmarkOwner::FutureBookmark::~FutureBookmark() |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | QString KBookmarkOwner::FutureBookmark::title() const |
| 45 | { |
| 46 | return d->title; |
| 47 | } |
| 48 | |
| 49 | QUrl KBookmarkOwner::FutureBookmark::url() const |
| 50 | { |
| 51 | return d->url; |
| 52 | } |
| 53 | |
| 54 | QString KBookmarkOwner::FutureBookmark::icon() const |
| 55 | { |
| 56 | return d->icon; |
| 57 | } |
| 58 | |
| 59 | KBookmarkOwner::KBookmarkOwner() |
| 60 | : d(nullptr) |
| 61 | { |
| 62 | } |
| 63 | |
| 64 | KBookmarkOwner::~KBookmarkOwner() = default; |
| 65 | |
| 66 | bool KBookmarkOwner::enableOption(BookmarkOption action) const |
| 67 | { |
| 68 | if (action == ShowAddBookmark) { |
| 69 | return true; |
| 70 | } |
| 71 | if (action == ShowEditBookmark) { |
| 72 | return true; |
| 73 | } |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | void KBookmarkOwner::openFolderinTabs(const KBookmarkGroup &) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | void KBookmarkOwner::openInNewTab(const KBookmark &bm) |
| 82 | { |
| 83 | // fallback |
| 84 | openBookmark(bm, mb: Qt::LeftButton, km: Qt::NoModifier); |
| 85 | } |
| 86 | |
| 87 | void KBookmarkOwner::openInNewWindow(const KBookmark &bm) |
| 88 | { |
| 89 | // fallback |
| 90 | openBookmark(bm, mb: Qt::LeftButton, km: Qt::NoModifier); |
| 91 | } |
| 92 |
