X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Faction.h;h=8b580a28149f768914162bd48d9b7923f890014a;hp=dbef28cbb097b3dac1fae9110e8c1511e503e203;hb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e;hpb=c52a94cb937654bf06d5074bf0736a52ec94a52d diff --git a/src/uisupport/action.h b/src/uisupport/action.h index dbef28cb..8b580a28 100644 --- a/src/uisupport/action.h +++ b/src/uisupport/action.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,10 +20,9 @@ * Parts of this API have been shamelessly stolen from KDE's kaction.h * ***************************************************************************/ -#ifndef ACTION_H_ -#define ACTION_H_ +#pragma once -#ifndef HAVE_KDE4 +#include "uisupport-export.h" #include #include @@ -32,7 +31,7 @@ /** This declares/implements a subset of KAction's API (notably we've left out global shortcuts * for now), which should make it easy to plug in KDE support later on. */ -class Action : public QWidgetAction +class UISUPPORT_EXPORT Action : public QWidgetAction { Q_OBJECT @@ -48,8 +47,8 @@ public : Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType) explicit Action(QObject *parent); - Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); - Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); + Action(const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0); + Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = nullptr, const char *slot = nullptr, const QKeySequence &shortcut = 0); QKeySequence shortcut(ShortcutTypes types = ActiveShortcut) const; void setShortcut(const QShortcut &shortcut, ShortcutTypes type = ShortcutTypes(ActiveShortcut | DefaultShortcut)); @@ -70,24 +69,3 @@ private slots: Q_DECLARE_OPERATORS_FOR_FLAGS(Action::ShortcutTypes) - -#else /* HAVE_KDE4 */ -#include - -class Action : public KAction -{ - Q_OBJECT - -public: - explicit Action(QObject *parent); - Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); - Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0); - -private: - void init(); -}; - - -#endif - -#endif