mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
keep references to strings in QDBusConnection, QDBusError and QDBusServer
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
aa5e8933df
commit
3707083061
3 changed files with 8 additions and 4 deletions
|
@ -344,7 +344,8 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address,
|
|||
d = new QDBusConnectionPrivate;
|
||||
// setConnection does the error handling for us
|
||||
QDBusErrorInternal error;
|
||||
DBusConnection *c = dbus_connection_open_private(address.toUtf8().constData(), error);
|
||||
const QByteArray addressref = address.toUtf8();
|
||||
DBusConnection *c = dbus_connection_open_private(addressref.constData(), error);
|
||||
if (c) {
|
||||
if (!dbus_bus_register(c, error)) {
|
||||
dbus_connection_unref(c);
|
||||
|
@ -383,7 +384,8 @@ QDBusConnection QDBusConnection::connectToPeer(const QString &address,
|
|||
d = new QDBusConnectionPrivate;
|
||||
// setPeer does the error handling for us
|
||||
QDBusErrorInternal error;
|
||||
DBusConnection *c = dbus_connection_open_private(address.toUtf8().constData(), error);
|
||||
const QByteArray addressref = address.toUtf8();
|
||||
DBusConnection *c = dbus_connection_open_private(addressref.constData(), error);
|
||||
|
||||
d->setPeer(c, error);
|
||||
_q_manager()->setConnection(name, d);
|
||||
|
|
|
@ -193,7 +193,8 @@ QDBusError::QDBusError(const QDBusMessage &qdmsg)
|
|||
if (qdmsg.type() != QDBusMessage::ErrorMessage)
|
||||
return;
|
||||
|
||||
code = getError(qdmsg.errorName().toUtf8().constData());
|
||||
const QByteArray errorref = qdmsg.errorName().toUtf8();
|
||||
code = getError(errorref.constData());
|
||||
nm = qdmsg.errorName();
|
||||
msg = qdmsg.errorMessage();
|
||||
}
|
||||
|
|
|
@ -51,7 +51,8 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
|||
this, SIGNAL(newConnection(QDBusConnection)));
|
||||
|
||||
QDBusErrorInternal error;
|
||||
d->setServer(dbus_server_listen(address.toUtf8().constData(), error), error);
|
||||
const QByteArray addressref = address.toUtf8();
|
||||
d->setServer(dbus_server_listen(addressref.constData(), error), error);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Reference in a new issue