summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-12-30 04:29:19 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-12-30 04:29:19 +0100
commit590a6509163fa784bb6ad9cb43e2978163ea6d76 (patch)
tree7f5a8adcbcdf277b1457703936e14266d5d9777c
parent1f66032a83f840889bed67ded4fad8647e29a4bf (diff)
downloadpolkit-tqt-590a6509163fa784bb6ad9cb43e2978163ea6d76.tar.gz
polkit-tqt-590a6509163fa784bb6ad9cb43e2978163ea6d76.zip
Use the formatted strings instead of joining the message.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--examples/PkExample.cpp6
-rw-r--r--examples/PkExampleHelper.cpp4
-rw-r--r--examples/agent/tqtlistener.cpp16
3 files changed, 13 insertions, 13 deletions
diff --git a/examples/PkExample.cpp b/examples/PkExample.cpp
index 99c0e641f..9223082b3 100644
--- a/examples/PkExample.cpp
+++ b/examples/PkExample.cpp
@@ -338,7 +338,7 @@ void PkExample::actionActivated()
// will run as root (setuid is not needed, see DBus docs).
// In the helper application you will issue checkAuthorizationSync,
// passing the action id and the caller pid (which DBus will tell you).
- tqDebug("Pretending to be the mechanism for action " + action->actionId());
+ tqDebug(TQString("Pretending to be the mechanism for action %1").arg(action->actionId()));
Authority::Result result;
UnixProcessSubject subject(static_cast<uint>(getpid()));
@@ -350,13 +350,13 @@ void PkExample::actionActivated()
if (result == Authority::Yes)
{
// in the helper you will do the action
- tqDebug("caller is authorized to do: " + action->actionId());
+ tqDebug(TQString("caller is authorized to do: %1").arg(action->actionId()));
item->setPixmap(1, TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"));
}
else
{
// or return false to notify the caller that the action is not authorized.
- tqDebug("caller is NOT authorized to do: " + action->actionId());
+ tqDebug(TQString("caller is NOT authorized to do: %1").arg(action->actionId()));
item->setPixmap(1, TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-no.png"));
}
actionList->insertItem(item);
diff --git a/examples/PkExampleHelper.cpp b/examples/PkExampleHelper.cpp
index 7b27de58f..3df798f59 100644
--- a/examples/PkExampleHelper.cpp
+++ b/examples/PkExampleHelper.cpp
@@ -110,13 +110,13 @@ bool PkExampleHelper::set(const TQString &action)
if (result == Authority::Yes)
{
// Caller is authorized so we can perform the action
- tqDebug(TQString("Implicit authorization set to ") + action);
+ tqDebug(TQString("Implicit authorization set to %1").arg(action));
return setValue(action);
}
else
{
// Caller is not authorized so the action can't be performed
- tqDebug(TQString("Can't set the implicit authorization to ") + action);
+ tqDebug(TQString("Can't set the implicit authorization to %1").arg(action));
return false;
}
}
diff --git a/examples/agent/tqtlistener.cpp b/examples/agent/tqtlistener.cpp
index 59cfd40f2..f227d2aed 100644
--- a/examples/agent/tqtlistener.cpp
+++ b/examples/agent/tqtlistener.cpp
@@ -39,14 +39,14 @@ void TQtListener::initiateAuthentication(const TQString &actionId, const TQStrin
const TQString &iconName, const PolkitTQt::Details &details, const TQString &cookie,
const PolkitTQt::Identity::List &identities, AsyncResult *result)
{
- tqDebug("Initiate authentication for " + actionId + " with message " + message);
- tqDebug(" iconName " + iconName);
+ tqDebug(TQString("Initiate authentication for %1 with message %2").arg(actionId).arg(message));
+ tqDebug(TQString(" iconName %1").arg(iconName));
TQStringList dkeys = details.keys();
for (const TQString &dkey : dkeys)
{
- tqDebug(" key " + dkey);
+ tqDebug(TQString(" key %1").arg(dkey));
}
- tqDebug(" cookie " + cookie);
+ tqDebug(TQString(" cookie %1").arg(cookie));
for (const PolkitTQt::Identity &identity : identities)
{
@@ -76,7 +76,7 @@ void TQtListener::cancelAuthentication()
void TQtListener::request(const TQString &request, bool echo)
{
- tqDebug("Request: " + request);
+ tqDebug(TQString("Request: %1").arg(request));
Session *session = (Session*)sender();
bool ok;
TQString text = TQInputDialog::getText("TQt Agent", "Enter authorization password:",
@@ -93,7 +93,7 @@ void TQtListener::request(const TQString &request, bool echo)
void TQtListener::completed(bool gainedAuthorization)
{
- tqDebug(TQString("Completed: ") + (gainedAuthorization ? "true" : "false"));
+ tqDebug(TQString("Completed: %1").arg(gainedAuthorization ? "true" : "false"));
Session *session = (Session*)sender();
session->result()->setCompleted();
delete session;
@@ -101,12 +101,12 @@ void TQtListener::completed(bool gainedAuthorization)
void TQtListener::showError(const TQString &text)
{
- tqDebug("Error: " + text);
+ tqDebug(TQString("Error: %1").arg(text));
}
void TQtListener::showInfo(const TQString &text)
{
- tqDebug("Info: " + text);
+ tqDebug(TQString("Info: %1").arg(text));
}
#include "tqtlistener.moc"