Skip to content

Commit f5e487c

Browse files
committed
add dbus related stuff
1 parent 1854e06 commit f5e487c

File tree

19 files changed

+193
-20
lines changed

19 files changed

+193
-20
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
66

77
find_package(KDE4 REQUIRED)
88
include_directories(${KDE4_INCLUDES})
9+
include_directories(${PROJECT_SOURCE_DIR}/lib)
10+
911
add_definitions(${KDE4_DEFINITIONS})
1012
find_package(QCA2 REQUIRED)
1113
find_package(QOAuth REQUIRED)

backend/dropbox/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include_directories(${QT_QTCORE_INCLUDE_DIR}
2-
${PROJECT_SOURCE_DIR}/lib
32
${QOAuth_INCLUDE_DIR}
43
${QT_QTGUI_INCLUDE_DIR}
54
${QCA2_INCLUDE_DIR}

daemon/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1+
find_package(PkgConfig REQUIRED)
12

3+
_pkgconfig_invoke("dbus-1" DBUS SESSION_BUS_SERVICES_DIR "" "--variable=session_bus_services_dir")
4+
5+
set(daemon_SRCS
6+
daemon.cpp
7+
main.cpp
8+
)
9+
10+
set(daemon_MOC_HDRS
11+
daemon.h
12+
)
13+
14+
qt4_wrap_cpp(
15+
daemon_MOC_SRCS
16+
${daemon_MOC_HDRS}
17+
)
18+
19+
add_executable(qcloud_daemon ${daemon_SRCS} ${daemon_MOC_SRCS})
20+
21+
target_link_libraries(qcloud_daemon
22+
${QT_QTCORE_LIBRARY}
23+
)
24+
25+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/org.qcloud.daemon.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.qcloud.daemon.service)
26+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.qcloud.daemon.service DESTINATION ${DBUS_SESSION_BUS_SERVICES_DIR})

daemon/daemon.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "daemon.h"
2+
3+
namespace QCloud {
4+
Daemon::Daemon (int& argc, char** argv) : QCoreApplication (argc, argv)
5+
{
6+
7+
}
8+
9+
Daemon::~Daemon()
10+
{
11+
12+
}
13+
}

daemon/daemon.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <QCoreApplication>
2+
namespace QCloud {
3+
class Daemon : public QCoreApplication
4+
{
5+
Q_OBJECT
6+
public:
7+
Daemon (int& argc, char** argv);
8+
virtual ~Daemon();
9+
};
10+
}

daemon/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include <QCoreApplication>
2+
#include "daemon.h"
3+
4+
int main(int argc, char* argv[])
5+
{
6+
QCloud::Daemon app(argc, argv);
7+
8+
return app.exec();
9+
}

daemon/org.qcloud.daemon.service.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[D-BUS Service]
2+
Name=org.qcloud.daemon
3+
Exec=@CMAKE_INSTALL_PREFIX@/bin/qcloud-daemon

daemon/service.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "service.h"
2+
3+
namespace QCloud {
4+
5+
Service::Service (QObject* parent) : Server (parent)
6+
{
7+
8+
}
9+
10+
Service::~Service()
11+
{
12+
13+
}
14+
15+
}

daemon/service.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <QCoreApplication>
2+
#include "server.h"
3+
namespace QCloud {
4+
class Service : public Server
5+
{
6+
Q_OBJECT
7+
public:
8+
explicit Service (QObject* parent = 0);
9+
virtual ~Service();
10+
};
11+
}

lib/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include_directories(${QT_INCLUDE_DIR}
2-
${PROJECT_SOURCE_DIR}/lib
32
${QOAuth_INCLUDE_DIR}
43
${QCA2_INCLUDE_DIR}
54
${CMAKE_CURRENT_BINARY_DIR}
@@ -17,7 +16,7 @@ set(qcloud_SRCS
1716
client.cpp
1817
)
1918

20-
set(qcloud_MOC_HDRS
19+
set(qcloud_HDRS
2120
ibackend.h
2221
oauthbackend.h
2322
authorizewidget.h
@@ -28,6 +27,8 @@ set(qcloud_MOC_HDRS
2827
client.h
2928
)
3029

30+
set(qcloud_MOC_HDRS ${qcloud_HDRS} client_p.h)
31+
3132
qt4_wrap_cpp(
3233
qcloud_MOC_SRCS
3334
${qcloud_MOC_HDRS}
@@ -45,7 +46,7 @@ qt4_add_dbus_adaptor(qcloud_SRCS
4546

4647
qt4_add_dbus_interface(qcloud_SRCS
4748
daemon.xml
48-
org.qcloud.daemon
49+
org.qcloud.Daemon
4950
)
5051

5152
add_library(qcloud SHARED ${qcloud_SRCS} ${qcloud_MOC_SRCS} ${qcloud_UI_SRCS})

0 commit comments

Comments
 (0)