summaryrefslogtreecommitdiffstats
path: root/src/libtdebluez
diff options
context:
space:
mode:
authorEmanoil Kotsev <[email protected]>2023-03-13 20:31:19 +0000
committerEmanoil Kotsev <[email protected]>2023-03-20 07:25:45 +0000
commitc95a42982628b4b06ceed0c01cada10806c9b53c (patch)
treeee5bb82e46741f57362bb5c4a0f2133d1d525cdb /src/libtdebluez
parent66c9d2a5920b30474b595603a79915d2be38cdbe (diff)
downloadtdebluez-c95a42982628b4b06ceed0c01cada10806c9b53c.tar.gz
tdebluez-c95a42982628b4b06ceed0c01cada10806c9b53c.zip
i18n and some minor corrections
Signed-off-by: Emanoil Kotsev <[email protected]>
Diffstat (limited to 'src/libtdebluez')
-rw-r--r--src/libtdebluez/adapterImpl.cpp25
-rw-r--r--src/libtdebluez/objectmanagerImpl.cpp44
2 files changed, 35 insertions, 34 deletions
diff --git a/src/libtdebluez/adapterImpl.cpp b/src/libtdebluez/adapterImpl.cpp
index 703f06f..adf4388 100644
--- a/src/libtdebluez/adapterImpl.cpp
+++ b/src/libtdebluez/adapterImpl.cpp
@@ -32,6 +32,7 @@
#include <tqdbusproxy.h>
#include <tqmessagebox.h>
+#include <tdelocale.h>
#include "adapterImpl.h"
@@ -90,7 +91,7 @@ void AdapterImpl::powerOn(bool state)
if (hcidx < 0)
{
// error handling
- tqDebug("Index for the device %s not found", device.local8Bit().data());
+ tqDebug(i18n("Index for the device %1 not found").arg(device));
return;
}
@@ -99,7 +100,7 @@ void AdapterImpl::powerOn(bool state)
TQFile file("/dev/rfkill");
if (!file.open(IO_ReadWrite))
{
- tqDebug("Failed to open %s", file.name().utf8().data());
+ tqDebug(i18n("Failed to open %1").arg(file.name()));
return;
}
@@ -110,10 +111,10 @@ void AdapterImpl::powerOn(bool state)
else
event.soft = 1;
- tqDebug("Bluetooth device %s switches: idx(%i), soft(%d).", device.local8Bit().data(), event.idx, event.soft);
+ tqDebug(i18n("Bluetooth device %1 switches: idx(%2), soft(%3).").arg(device).arg(event.idx).arg(event.soft));
if (write(file.handle(), &event, sizeof(event)) < 0)
- tqDebug("Failed to write to %s", file.name().utf8().data());
+ tqDebug(i18n("Failed to write to %1").arg(file.name()));
file.close();
}
@@ -124,18 +125,18 @@ TQString AdapterImpl::getPath()
void AdapterImpl::slotSetAlias(const TQString& alias)
{
- TQT_DBusError error;
- setAlias(alias, error);
- if (error.isValid())
- tqDebug("AdapterImpl::slotSetAlias(%s) failed: %s", alias.utf8().data(), error.message().utf8().data());
+ TQT_DBusError dbuserror;
+ setAlias(alias, dbuserror);
+ if (dbuserror.isValid())
+ tqDebug(i18n("AdapterImpl::slotSetAlias(%1) failed: %2").arg(alias).arg(dbuserror.message()));
}
void AdapterImpl::slotSetTimeout(int timeout)
{
- TQT_DBusError error;
- setDiscoverableTimeout(timeout, error);
- if (error.isValid())
- tqDebug("AdapterImpl::slotSetTimeout(%i) failed: %s", timeout, error.message().utf8().data());
+ TQT_DBusError dbuserror;
+ setDiscoverableTimeout(timeout, dbuserror);
+ if (dbuserror.isValid())
+ tqDebug(i18n("AdapterImpl::slotSetTimeout(%1) failed: %2").arg(timeout).arg(dbuserror.message()));
}
} // namespace TDEBluetooth
diff --git a/src/libtdebluez/objectmanagerImpl.cpp b/src/libtdebluez/objectmanagerImpl.cpp
index 789e221..96cb83e 100644
--- a/src/libtdebluez/objectmanagerImpl.cpp
+++ b/src/libtdebluez/objectmanagerImpl.cpp
@@ -191,12 +191,12 @@ bool ObjectManagerImpl::registerAgent()
{
if (!agentRegisteredStatus)
{
- TQT_DBusError error;
+ TQT_DBusError dbuserror;
agentManager->RegisterAgent(
- TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), DEVICE_PIN_CAPABILITY, error);
- if (error.isValid())
+ TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), DEVICE_PIN_CAPABILITY, dbuserror);
+ if (dbuserror.isValid())
{
- tqDebug("Could not register agent: %s", error.message().local8Bit().data());
+ tqDebug(i18n("Could not register agent: %1").arg(dbuserror.message()));
return false;
}
agentRegisteredStatus = true;
@@ -209,12 +209,12 @@ bool ObjectManagerImpl::unregisterAgent()
kdDebug() << k_funcinfo << endl;
if (agentRegisteredStatus)
{
- TQT_DBusError error;
+ TQT_DBusError dbuserror;
getAgentManager()->UnregisterAgent(
- TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), error);
- if (error.isValid())
+ TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), dbuserror);
+ if (dbuserror.isValid())
{
- tqDebug("Could not unregister agent");
+ tqDebug(i18n("Could not unregister agent"));
return false;
}
agentRegisteredStatus = false;
@@ -225,12 +225,12 @@ bool ObjectManagerImpl::unregisterAgent()
bool ObjectManagerImpl::requestDefaultAgent()
{
- TQT_DBusError error;
+ TQT_DBusError dbuserror;
agentManager->RequestDefaultAgent(
- TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), error);
- if (error.isValid())
+ TQT_DBusObjectPath(TQCString(DBUS_AUTH_SERVICE_PATH)), dbuserror);
+ if (dbuserror.isValid())
{
- tqDebug("Could not request default agent: %s", error.message().local8Bit().data());
+ tqDebug(i18n("Could not request default agent: %1").arg(dbuserror.message()));
return false;
}
agentIsDefaultAgent = true;
@@ -258,17 +258,17 @@ bool ObjectManagerImpl::initDBUS()
dBusConn = TQT_DBusConnection::addConnection(TQT_DBusConnection::SystemBus, DBUS_CONN_NAME);
if (!dBusConn.isConnected())
{
- tqDebug("Failed to open connection to system message bus: %s", dBusConn.lastError().message().local8Bit().data());
+ tqDebug(i18n("Failed to open connection to system message bus: %1").arg(dBusConn.lastError().message()));
TQTimer::singleShot(4000, this, TQT_SLOT(reconnect()));
return false;
}
setConnection(dBusConn);
TQT_DBusDataMap<TQT_DBusObjectPath> objects;
- TQT_DBusError error;
- if (!GetManagedObjects(objects, error))
+ TQT_DBusError dbuserror;
+ if (!GetManagedObjects(objects, dbuserror))
{
- tqDebug("GetManagedObjects(objects,error) FAILED:\n%s\n", error.message().latin1());
+ tqDebug(i18n("GetManagedObjects(objects,error) failed: %1").arg(dbuserror.message()));
return false;
}
@@ -278,7 +278,7 @@ bool ObjectManagerImpl::initDBUS()
bool ok = false;
slotInterfacesAdded(it.key(), it.data().toStringKeyMap(&ok));
if (!ok)
- tqWarning("Failed to convert dbus data to string map: %s", it.key().latin1());
+ tqWarning(i18n("Failed to convert dbus data to string map: %1").arg(it.key()));
}
connect(this, SIGNAL(InterfacesAdded(const TQT_DBusObjectPath&, const TQT_DBusDataMap< TQString >&)),
@@ -313,7 +313,7 @@ void ObjectManagerImpl::adapterPropertiesChanged(TQString path, const TQMap<
else
continue;
if (!ok)
- tqDebug("ObjectManagerImpl::adapterPropertiesChanged conversion failed");
+ tqDebug(i18n("ObjectManagerImpl::adapterPropertiesChanged conversion failed"));
}
}
@@ -367,7 +367,7 @@ void ObjectManagerImpl::devicePropertiesChanged(TQString path, const TQMap<TQStr
else
continue;
if (!ok)
- tqDebug("ObjectManagerImpl::devicePropertiesChanged conversion failed");
+ tqDebug(i18n("ObjectManagerImpl::devicePropertiesChanged conversion failed"));
}
}
@@ -385,7 +385,7 @@ void ObjectManagerImpl::mediaControlPropertiesChanged(TQString path, const TQMap
else
continue;
if (!ok)
- tqDebug("ObjectManagerImpl::mediaControlPropertiesChanged conversion failed");
+ tqDebug(i18n("ObjectManagerImpl::mediaControlPropertiesChanged conversion failed"));
}
}
@@ -468,7 +468,7 @@ void ObjectManagerImpl::slotInterfacesAdded(const TQT_DBusObjectPath& object, co
}
else
{
- tqWarning("Interface not implemented: %s", interface.local8Bit().data());
+ tqWarning(i18n("Interface not implemented: %1").arg(interface));
}
}
}
@@ -539,7 +539,7 @@ void ObjectManagerImpl::slotInterfacesRemoved(const TQT_DBusObjectPath& object,
}
else
{
- tqWarning("Interface not implemented: %s", (*it).local8Bit().data());
+ tqWarning(i18n("Interface not implemented: %1").arg((*it)));
}
}
}