Commit 685d6ec2 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port away from deprecated KActionMenu::setDelayed()

parent 9de7e6dc
......@@ -28,6 +28,7 @@
#include <kparts/browserextension.h>
#include <kparts/textextension.h>
#include <kwidgetsaddons_version.h>
#include <kactioncollection.h>
#include <QMenu>
#include <kmessagebox.h>
......@@ -51,7 +52,11 @@ PluginBabelFish::PluginBabelFish(QObject *parent,
m_menu = new KActionMenu(QIcon::fromTheme(QStringLiteral("babelfish")), i18n("Translate Web &Page"),
actionCollection());
actionCollection()->addAction(QStringLiteral("translatewebpage"), m_menu);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
m_menu->setPopupMode(QToolButton::InstantPopup);
#else
m_menu->setDelayed(false);
#endif
connect(m_menu->menu(), SIGNAL(aboutToShow()),
this, SLOT(slotAboutToShow()));
......
......@@ -19,7 +19,7 @@
#include "settingsplugin.h"
#include <kwidgetsaddons_version.h>
#include <kconfig.h>
#include <KLocalizedString>
#include <kmessagebox.h>
......@@ -52,7 +52,11 @@ SettingsPlugin::SettingsPlugin(QObject *parent,
setComponentData(KAboutData(QStringLiteral("khtmlsettingsplugin"), i18n("HTML Settings"), QStringLiteral("1.0")));
KActionMenu *menu = new KActionMenu(QIcon::fromTheme(QStringLiteral("configure")), i18n("HTML Settings"), actionCollection());
actionCollection()->addAction(QStringLiteral("action menu"), menu);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
menu->setPopupMode(QToolButton::InstantPopup);
#else
menu->setDelayed(false);
#endif
KToggleAction *action = actionCollection()->add<KToggleAction>(QStringLiteral("javascript"));
action->setText(i18n("Java&Script"));
......
......@@ -25,6 +25,7 @@
#include <QMenu>
#include <QRegExp>
#include <kwidgetsaddons_version.h>
#include <kactionmenu.h>
#include <kservicetypetrader.h>
#include <klocalizedstring.h>
......@@ -56,7 +57,11 @@ UAChangerPlugin::UAChangerPlugin(QObject *parent,
i18n("Change Browser Identification"),
actionCollection());
actionCollection()->addAction("changeuseragent", m_pUAMenu);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
m_pUAMenu->setPopupMode(QToolButton::InstantPopup);
#else
m_pUAMenu->setDelayed(false);
#endif
connect(m_pUAMenu->menu(), &QMenu::aboutToShow, this, &UAChangerPlugin::slotAboutToShow);
if (parent!=nullptr) {
......
......@@ -24,6 +24,9 @@
#include "konqpixmapprovider.h"
#include "konqdebug.h"
#include <kwidgetsaddons_version.h>
#include <QIcon>
#include <QMenu>
#include <QAction>
......@@ -85,7 +88,11 @@ KonqMostOftenURLSAction::KonqMostOftenURLSAction(const QString &text,
: KActionMenu(QIcon::fromTheme(QStringLiteral("go-jump")), text, parent),
m_parsingDone(false)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
setPopupMode(QToolButton::InstantPopup);
#else
setDelayed(false);
#endif
connect(menu(), SIGNAL(aboutToShow()), SLOT(slotFillMenu()));
connect(menu(), SIGNAL(triggered(QAction*)), SLOT(slotActivated(QAction*)));
......@@ -216,7 +223,11 @@ void KonqMostOftenURLSAction::slotActivated(QAction *action)
KonqHistoryAction::KonqHistoryAction(const QString &text, QObject *parent)
: KActionMenu(QIcon::fromTheme(QStringLiteral("go-jump")), text, parent)
{
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
setPopupMode(QToolButton::InstantPopup);
#else
setDelayed(false);
#endif
connect(menu(), SIGNAL(aboutToShow()), SLOT(slotFillMenu()));
connect(menu(), SIGNAL(triggered(QAction*)), SLOT(slotActivated(QAction*)));
setEnabled(!KonqHistoryManager::kself()->entries().isEmpty());
......
......@@ -26,6 +26,7 @@
#include <QEvent>
#include <QMenu>
#include <kwidgetsaddons_version.h>
#include <ktoolbar.h>
#include <kactionmenu.h>
#include <kconfig.h>
......@@ -187,7 +188,11 @@ void KBookmarkBar::fillBookmarkBar(const KBookmarkGroup &parent)
}
} else {
KBookmarkActionMenu *action = new KBookmarkActionMenu(bm, nullptr);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
action->setPopupMode(QToolButton::InstantPopup);
#else
action->setDelayed(false);
#endif
if (m_toolBar) {
m_toolBar->addAction(action);
}
......
......@@ -55,6 +55,8 @@
#include <konq_events.h>
#include <konqpixmapprovider.h>
#include <kwidgetsaddons_version.h>
#include <kbookmarkmanager.h>
#include <klineedit.h>
#include <kzip.h>
......@@ -3791,7 +3793,11 @@ void KonqMainWindow::initActions()
m_pamBookmarks = new KBookmarkActionMenu(s_bookmarkManager->root(),
i18n("&Bookmarks"), this);
actionCollection()->addAction(QStringLiteral("bookmarks"), m_pamBookmarks);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
m_pamBookmarks->setPopupMode(QToolButton::InstantPopup);
#else
m_pamBookmarks->setDelayed(false);
#endif
// The actual menu needs a different action collection, so that the bookmarks
// don't appear in kedittoolbar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment