From 7c53a87adc27550ff875d6c17fccdbfbe2942ee1 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 8 Jan 2024 11:54:17 +0900 Subject: [PATCH] Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines Signed-off-by: Michele Calgaro --- Mainpage.dox | 6 ++-- examples/PkExample.cpp | 48 ++++++++++++++--------------- examples/PkExampleHelper.cpp | 2 +- examples/agent/tqtlistener.cpp | 14 ++++----- examples/main.cpp | 2 +- gui/polkit-tqt-gui-action.cpp | 2 +- gui/polkit-tqt-gui-actionbutton.cpp | 12 ++++---- 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Mainpage.dox b/Mainpage.dox index 83718a18f..89147c625 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -74,9 +74,9 @@ This demonstrates the use of ActionButtons, that lets you associate multiple but single action with extreme ease. \c listenPB and \c listenCB are kept in sync with the action. \code -connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); -connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); -connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); +connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); +connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); +connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); \endcode Those three signals are all you need to control the action and the activation. Action::activated() diff --git a/examples/PkExample.cpp b/examples/PkExample.cpp index bdfc018cd..f329af699 100644 --- a/examples/PkExample.cpp +++ b/examples/PkExample.cpp @@ -145,32 +145,32 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", ::tqt_cast(bt)->addTo(toolBar); // this signal is emitted when the user click on the action, // it will only happen if it was inserted in a TQMenu or a TQToolBar - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); // This signal was propagated from the TQButton just for // convenience in this case we don't have any benefit but the code // look cleaner - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); // this is the Action activated signal, it is always emmited whenever // someone click and get authorized to do the action - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(cryPB, "org.tqt.policykit.examples.cry", this); bt->setText("Cry!"); bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png")); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(bleedPB, "org.tqt.policykit.examples.bleed", this); bt->setText("Bleed!"); bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/action-locked-default.png")); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); // This action is more customized bt = new ActionButton(playPB, "org.tqt.policykit.examples.play", this); @@ -191,9 +191,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", bt->setToolTip("Go ahead, play!", Action::Yes); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(listenPB, "org.tqt.policykit.examples.listen", this); bt->setText("Listen!"); @@ -202,9 +202,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(deletePB, "org.tqt.policykit.examples.delete", this); bt->setText("Delete!"); @@ -213,9 +213,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(setPB, "org.tqt.policykit.examples.set", this); bt->setText("Set!"); @@ -224,9 +224,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); bt = new ActionButton(shoutPB, "org.tqt.policykit.examples.shout", this); bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-no.png"), Action::No); @@ -237,9 +237,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application", bt->setText("Shout!", Action::Yes); ::tqt_cast(bt)->addTo(menuActions); ::tqt_cast(bt)->addTo(toolBar); - connect(bt, SIGNAL(activated()), this, SLOT(activateAction())); - connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate())); - connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated())); + connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction())); + connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate())); + connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated())); } void PkExample::languageChange() diff --git a/examples/PkExampleHelper.cpp b/examples/PkExampleHelper.cpp index 53d6cbc93..225816d31 100644 --- a/examples/PkExampleHelper.cpp +++ b/examples/PkExampleHelper.cpp @@ -52,7 +52,7 @@ PkExampleHelper::PkExampleHelper(int argc, char **argv) : TQApplication(argc, ar return; } // Exit if not used for 10 minutes - TQTimer::singleShot(600000, this, TQT_SLOT(quit())); + TQTimer::singleShot(600000, this, TQ_SLOT(quit())); tqDebug("Register successful"); } diff --git a/examples/agent/tqtlistener.cpp b/examples/agent/tqtlistener.cpp index 2532dd689..90a327faf 100644 --- a/examples/agent/tqtlistener.cpp +++ b/examples/agent/tqtlistener.cpp @@ -52,13 +52,13 @@ void TQtListener::initiateAuthentication(const TQString &actionId, const TQStrin { tqDebug(identity.toString()); Session *session = new Session(identity, cookie, result); - connect(session, TQT_SIGNAL(request(const TQString&, bool)), this, - TQT_SLOT(request(const TQString&, bool))); - connect(session, TQT_SIGNAL(completed(bool)), this, TQT_SLOT(completed(bool))); - connect(session, TQT_SIGNAL(showError(const TQString&)), this, - TQT_SLOT(showError(const TQString&))); - connect(session, TQT_SIGNAL(showInfo(const TQString&)), this, - TQT_SLOT(showInfo(const TQString&))); + connect(session, TQ_SIGNAL(request(const TQString&, bool)), this, + TQ_SLOT(request(const TQString&, bool))); + connect(session, TQ_SIGNAL(completed(bool)), this, TQ_SLOT(completed(bool))); + connect(session, TQ_SIGNAL(showError(const TQString&)), this, + TQ_SLOT(showError(const TQString&))); + connect(session, TQ_SIGNAL(showInfo(const TQString&)), this, + TQ_SLOT(showInfo(const TQString&))); session->initiate(); } } diff --git a/examples/main.cpp b/examples/main.cpp index 81cc4c20d..4d3a1d239 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -28,6 +28,6 @@ int main(int argc, char *argv[]) TQApplication app(argc, argv); PkExample *example = new PkExample; example->show(); - app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); + app.connect(&app, TQ_SIGNAL(lastWindowClosed()), &app, TQ_SLOT(quit())); return app.exec(); } diff --git a/gui/polkit-tqt-gui-action.cpp b/gui/polkit-tqt-gui-action.cpp index c7f80d14b..fad976681 100644 --- a/gui/polkit-tqt-gui-action.cpp +++ b/gui/polkit-tqt-gui-action.cpp @@ -191,7 +191,7 @@ Action::Action(const TQString &actionId, TQObject *parent) : TQAction(parent), d setPolkitAction(actionId); // track the config changes to update the action - connect(Authority::instance(), SIGNAL(configChanged()), this, SLOT(slotConfigChanged())); + connect(Authority::instance(), TQ_SIGNAL(configChanged()), this, TQ_SLOT(slotConfigChanged())); } Action::~Action() diff --git a/gui/polkit-tqt-gui-actionbutton.cpp b/gui/polkit-tqt-gui-actionbutton.cpp index eaf4a3aa7..402b2f024 100644 --- a/gui/polkit-tqt-gui-actionbutton.cpp +++ b/gui/polkit-tqt-gui-actionbutton.cpp @@ -40,8 +40,8 @@ namespace Gui void ActionButtonPrivate::addButton(TQButton *button) { buttons.append(button); - TQObject::connect(button, TQT_SIGNAL(clicked()), q, TQT_SLOT(streamClicked())); - TQObject::connect(q, TQT_SIGNAL(toggled(bool)), button, TQT_SLOT(toggle())); + TQObject::connect(button, TQ_SIGNAL(clicked()), q, TQ_SLOT(streamClicked())); + TQObject::connect(q, TQ_SIGNAL(toggled(bool)), button, TQ_SLOT(toggle())); q->updateButton(); } @@ -49,8 +49,8 @@ void ActionButtonPrivate::removeButton(TQButton *button) { if (buttons.contains(button)) { - TQObject::disconnect(button, SIGNAL(clicked(bool)), q, SLOT(streamClicked())); - TQObject::disconnect(q, SIGNAL(toggled(bool)), button, SLOT(toggle())); + TQObject::disconnect(button, TQ_SIGNAL(clicked(bool)), q, TQ_SLOT(streamClicked())); + TQObject::disconnect(q, TQ_SIGNAL(toggled(bool)), button, TQ_SLOT(toggle())); TQValueList::iterator butIt = buttons.find(button); if (butIt != buttons.end()) { @@ -67,7 +67,7 @@ ActionButton::ActionButton(ActionButtonPrivate &dd, const TQString &actionId, TQ : Action(actionId, parent), d(&dd) { d->q = this; - connect(this, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton())); + connect(this, TQ_SIGNAL(dataChanged()), this, TQ_SLOT(updateButton())); } ActionButton::ActionButton(TQButton *button, const TQString &actionId, TQObject *parent) @@ -77,7 +77,7 @@ ActionButton::ActionButton(TQButton *button, const TQString &actionId, TQObject d->buttons.append(button); setButton(button); - connect(this, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton())); + connect(this, TQ_SIGNAL(dataChanged()), this, TQ_SLOT(updateButton())); } ActionButton::~ActionButton()