/* This file is part of the KDE libraries SPDX-FileCopyrightText: 1999 Reginald Stadlbauer SPDX-FileCopyrightText: 1999 Simon Hausmann SPDX-FileCopyrightText: 2000 Nicolas Hadacek SPDX-FileCopyrightText: 2000 Kurt Granroth SPDX-FileCopyrightText: 2000 Michael Koch SPDX-FileCopyrightText: 2001 Holger Freyther SPDX-FileCopyrightText: 2002 Ellis Whitehead SPDX-FileCopyrightText: 2002 Joseph Wenninger SPDX-FileCopyrightText: 2003 Andras Mantia SPDX-FileCopyrightText: 2005-2006 Hamish Rodda SPDX-License-Identifier: LGPL-2.0-only */ #ifndef KRECENTFILESACTION_P_H #define KRECENTFILESACTION_P_H #include "krecentfilesaction.h" class KRecentFilesActionPrivate { Q_DECLARE_PUBLIC(KRecentFilesAction) public: explicit KRecentFilesActionPrivate(KRecentFilesAction *parent) : q_ptr(parent) { } virtual ~KRecentFilesActionPrivate() { } void init(); void urlSelected(QAction *); int m_maxItems = 10; struct RecentActionInfo { QAction *action = nullptr; QUrl url; QString shortName; QMimeType mimeType; }; std::vector m_recentActions; std::vector::iterator findByUrl(const QUrl &url) { return std::find_if(m_recentActions.begin(), m_recentActions.end(), [&url](const RecentActionInfo &info) { return info.url == url; }); } std::vector::iterator findByAction(const QAction *action) { return std::find_if(m_recentActions.begin(), m_recentActions.end(), [action](const RecentActionInfo &info) { return info.action == action; }); } void removeAction(std::vector::iterator it); QAction *m_noEntriesAction = nullptr; QAction *clearSeparator = nullptr; QAction *clearAction = nullptr; KRecentFilesAction *const q_ptr; }; #endif // KRECENTFILESACTION_P_H