#include <QMenu>
-DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
- KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
+DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject *parent)
+ : KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
{
setPopupMode(QToolButton::InstantPopup);
setEnabled(false);
addSeparator();
- connect(menu(), &QMenu::triggered,
- this, &DolphinRecentTabsMenu::handleAction);
+ connect(menu(), &QMenu::triggered, this, &DolphinRecentTabsMenu::handleAction);
}
-void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state)
+void DolphinRecentTabsMenu::rememberClosedTab(const QUrl &url, const QByteArray &state)
{
- QAction* action = new QAction(menu());
+ QAction *action = new QAction(menu());
action->setText(url.path());
action->setData(state);
const QString iconName = KIO::iconNameForUrl(url);
handleAction(menu()->actions().at(2));
}
-void DolphinRecentTabsMenu::handleAction(QAction* action)
+void DolphinRecentTabsMenu::handleAction(QAction *action)
{
if (action == m_clearListAction) {
// Clear all actions except the "Empty Recently Closed Tabs"
// action and the separator
- QList<QAction*> actions = menu()->actions();
+ QList<QAction *> actions = menu()->actions();
const int count = actions.size();
for (int i = count - 1; i >= 2; i--) {
removeAction(actions.at(i));