X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/2e6450da1cc62c0c8ad6f868becf0fa4a1f32022..30299e00b137fb5abf31e6f82fc8f4753f9a929a:/src/dolphinrecenttabsmenu.cpp diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp index f425df218..38eb4f657 100644 --- a/src/dolphinrecenttabsmenu.cpp +++ b/src/dolphinrecenttabsmenu.cpp @@ -1,33 +1,21 @@ -/*************************************************************************** - * Copyright (C) 2014 by Emmanuel Pescosta * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2014 Emmanuel Pescosta + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "dolphinrecenttabsmenu.h" -#include #include +#include #include + #include DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) : KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent) { - setDelayed(false); + setPopupMode(QToolButton::InstantPopup); setEnabled(false); m_clearListAction = new QAction(i18n("Empty Recently Closed Tabs"), this); @@ -55,7 +43,7 @@ void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& } else { insertAction(menu()->actions().at(2), action); } - emit closedTabsCountChanged(menu()->actions().size() - 2); + Q_EMIT closedTabsCountChanged(menu()->actions().size() - 2); // Assure that only up to 6 closed tabs are shown in the menu. // 8 because of clear action + separator + 6 closed tabs if (menu()->actions().size() > 8) { @@ -81,14 +69,14 @@ void DolphinRecentTabsMenu::handleAction(QAction* action) for (int i = 2; i < count; ++i) { removeAction(actions.at(i)); } - emit closedTabsCountChanged(0); + Q_EMIT closedTabsCountChanged(0); } else { const QByteArray state = action->data().toByteArray(); removeAction(action); delete action; action = nullptr; - emit restoreClosedTab(state); - emit closedTabsCountChanged(menu()->actions().size() - 2); + Q_EMIT restoreClosedTab(state); + Q_EMIT closedTabsCountChanged(menu()->actions().size() - 2); } if (menu()->actions().count() <= 2) {