KNewStuff

knewstuffaction.cpp
1 /*
2  This file is part of KNewStuff2.
3  SPDX-FileCopyrightText: 2002 Cornelius Schumacher <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #include "knewstuffaction.h"
9 
10 #include <QAction>
11 #include <KLocalizedString>
12 #include <KActionCollection>
13 
14 using namespace KNS3;
15 
16 #if KNEWSTUFF_BUILD_DEPRECATED_SINCE(5, 78)
18  const QObject *receiver,
19  const char *slot, KActionCollection *parent,
20  const char *name)
21 {
22  QAction *action = new QAction(what, parent);
23  parent->addAction(QLatin1String(name), action);
24  action->setIcon(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")));
25  QObject::connect(action, SIGNAL(triggered(bool)), receiver, slot);
26 
27  return action;
28 }
29 #endif
30 
31 #if KNEWSTUFF_BUILD_DEPRECATED_SINCE(5, 78)
33  const QObject *receiver,
34  const char *slot, KActionCollection *parent,
35  const char *name)
36 {
37  QAction *action = new QAction(what, parent);
38  parent->addAction(QLatin1String(name), action);
39  action->setIcon(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")));
40  QObject::connect(action, SIGNAL(triggered(bool)), receiver, slot);
41 
42  return action;
43 }
44 #endif
void setIcon(const QIcon &icon)
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
QIcon fromTheme(const QString &name)
The namespace for the KNewStuff classes.
Definition: button.cpp:19
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KNEWSTUFF_EXPORT QAction * standardActionUpload(const QString &what, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name=nullptr)
Standard action for Uploading files with Hot New Stuff.
KNEWSTUFF_EXPORT QAction * standardAction(const QString &what, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name=nullptr)
Standard action for the Hot New Stuff Download.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 18 2021 22:43:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.