Use the formatted strings instead of joining the message.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 3 years ago
parent 1f66032a83
commit 590a650916
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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);

@ -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;
}
}

@ -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"

Loading…
Cancel
Save