DBus-1-TQt
1.0
tqdbusserver.cpp
Go to the documentation of this file.
1
/* qdbusserver.cpp
2
*
3
* Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
4
*
5
* Licensed under the Academic Free License version 2.1
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20
* USA.
21
*
22
*/
23
24
#include "
tqdbusserver.h
"
25
#include "
tqdbusconnection_p.h
"
26
27
TQT_DBusServer::TQT_DBusServer
(
const
TQString &addr, TQObject *parent)
28
: TQObject(parent)
29
{
30
d
=
new
TQT_DBusConnectionPrivate
(
this
);
31
32
if
(addr.isEmpty())
33
return
;
34
35
d
->
setServer
(dbus_server_listen(addr.utf8().data(), &
d
->
error
));
36
}
37
38
bool
TQT_DBusServer::isConnected
()
const
39
{
40
return
d
->
server
&& dbus_server_get_is_connected(
d
->
server
);
41
}
42
43
TQT_DBusError
TQT_DBusServer::lastError
()
const
44
{
45
return
d
->
lastError
;
46
}
47
48
TQString
TQT_DBusServer::address
()
const
49
{
50
TQString addr;
51
if
(
d
->
server
) {
52
char
*c = dbus_server_get_address(
d
->
server
);
53
addr = TQString::fromUtf8(c);
54
dbus_free(c);
55
}
56
57
return
addr;
58
}
59
60
#include "tqdbusserver.moc"
TQT_DBusServer::d
TQT_DBusConnectionPrivate * d
Definition:
tqdbusserver.h:50
TQT_DBusError
Class for transporting D-Bus errors.
Definition:
tqdbuserror.h:40
TQT_DBusConnectionPrivate::setServer
void setServer(DBusServer *server)
Definition:
tqdbusintegrator.cpp:553
TQT_DBusConnectionPrivate::error
DBusError error
Definition:
tqdbusconnection_p.h:109
TQT_DBusConnectionPrivate::server
DBusServer * server
Definition:
tqdbusconnection_p.h:118
TQT_DBusServer::TQT_DBusServer
TQT_DBusServer(const TQString &address, TQObject *parent=0)
Definition:
tqdbusserver.cpp:27
TQT_DBusConnectionPrivate
Definition:
tqdbusconnection_p.h:69
tqdbusserver.h
TQT_DBusConnectionPrivate::lastError
TQT_DBusError lastError
Definition:
tqdbusconnection_p.h:110
TQT_DBusServer::address
TQString address() const
Definition:
tqdbusserver.cpp:48
TQT_DBusServer::isConnected
bool isConnected() const
Definition:
tqdbusserver.cpp:38
tqdbusconnection_p.h
TQT_DBusServer::lastError
TQT_DBusError lastError() const
Definition:
tqdbusserver.cpp:43
build
dbus-1-tqt-C9swNv
dbus-1-tqt-14.2.0~pre10
src
tqdbusserver.cpp
Generated by
1.8.17