ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
-
-CONFIGURE_FILE(theme-manager.service.in theme-manager.service @ONLY)
-
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/theme-manager.service DESTINATION ${UNITDIR})
-INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d
- FILES_MATCHING
- PATTERN "*.conf")
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
- <policy user="root">
- <allow own="org.tizen.theme_manager"/>
- <allow send_destination="org.tizen.theme_manager" send_interface="org.tizen.theme_manager"/>
- </policy>
- <policy user="app_fw">
- <allow own="org.tizen.theme_manager"/>
- <allow send_destination="org.tizen.theme_manager" send_interface="org.tizen.theme_manager"/>
- </policy>
- <policy context="default">
- <deny own="org.tizen.theme_manager"/>
- <deny send_destination="org.tizen.theme_manager"/>
- <allow send_destination="org.tizen.theme_manager" send_interface="org.tizen.theme_manager" send_member="SendData"/>
- </policy>
-</busconfig>
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+ <policy user="root">
+ <allow own="org.tizen.ThemeManager"/>
+ <allow send_destination="org.tizen.ThemeManager" send_interface="org.tizen.ThemeManager"/>
+ </policy>
+ <policy user="app_fw">
+ <allow own="org.tizen.ThemeManager"/>
+ <allow send_destination="org.tizen.ThemeManager" send_interface="org.tizen.ThemeManager"/>
+ </policy>
+ <policy context="default">
+ <deny own="org.tizen.ThemeManager"/>
+ <deny send_destination="org.tizen.ThemeManager"/>
+ <allow send_destination="org.tizen.ThemeManager" send_interface="org.tizen.ThemeManager" send_member="SendData"/>
+ </policy>
+</busconfig>
[Service]
Type=dbus
-BusName=org.tizen.theme_manager
+BusName=org.tizen.ThemeManager
User=app_fw
Group=app_fw
SmackProcessLabel=System
-ExecStart=@PREFIX@/bin/theme-provider
+ExecStart=/usr/bin/theme-provider
+
+[Install]
+WantedBy=multi-user.target
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
+Source1002: %{name}.service
+Source1003: %{name}.conf
BuildRequires: cmake
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dlog)
%install
%make_install
+install -m 755 -d %{buildroot}%{_unitdir}
+install -m 644 %{SOURCE1002} %{buildroot}%{_unitdir}
+install -m 755 -d %{buildroot}%{_sysconfdir}/dbus-1/system.d
+install -m 644 %{SOURCE1003} %{buildroot}%{_sysconfdir}/dbus-1/system.d
+
%if 0%{?gcov:1}
mkdir -p %{buildroot}%{_datadir}/gcov/obj
install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
%post
/sbin/ldconfig
+systemctl reenable %{name}
+
+%preun
+systemctl disable %{name}
+
+%postun
+/sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_libdir}/libtizen-theme-provider.so
%{_sysconfdir}/package-manager/parserlib/metadata/libtizen-theme-plugin.so
%{_datarootdir}/parser-plugins/tizen-theme-plugin.info
-%{_unitdir}/theme-manager.service
-%config %{_sysconfdir}/dbus-1/system.d/*theme_manager*.conf
+%{_unitdir}/%{name}.service
+%{_sysconfdir}/dbus-1/system.d/%{name}.conf
#################################################
# tizen-theme-manager-gcov
namespace {
-const char kDbusBusName[] = "tizen.theme_manager";
-const char kDbusInterfaceName[] = "org.tizen.theme_manager";
-const char kDbusObjectPath[] = "/org/tizen/theme_manager";
+const char kDbusBusName[] = "org.tizen.ThemeManager";
+const char kDbusInterfaceName[] = "org.tizen.ThemeManager";
+const char kDbusObjectPath[] = "/org/tizen/ThemeManager";
const char kDBusMethodSendData[] = "SendData";
}
};
gchar introspection_xml[] =
"<node>"
- " <interface name='org.tizen.theme_manager'>"
+ " <interface name='org.tizen.ThemeManager'>"
" <method name='SendData'>"
" <arg type='i' name='command' direction='in'/>"
" <arg type='s' name='serialized' direction='in'/>"
#include <streambuf>
#include <string>
+#include "theme/dbus/request_broker.h"
#include "theme/loader/theme_info.h"
#include "theme/utils/logging.h"
#include "theme_plugin/theme_info_builder.h"
return builder.Build();
}
+using ttm::dbus::Command;
+using ttm::dbus::RequestBroker;
int ThemeParser::Commit(ThemeOperation operation,
const loader::ThemeInfo& theme) {
+ tizen_base::Bundle theme_info = theme.Serialize();
+ tizen_base::Bundle reply;
switch (operation) {
case ThemeOperation::ADD:
LOG(DEBUG) << "Add Theme: " << theme.GetId();
- // send dbus request at here
+ reply = RequestBroker::GetInst().SendData(Command::ADD, theme_info);
break;
case ThemeOperation::UPDATE:
LOG(DEBUG) << "Update Theme: " << theme.GetId();
- // send dbus request at here
+ reply = RequestBroker::GetInst().SendData(Command::UPDATE, theme_info);
break;
case ThemeOperation::REMOVE:
LOG(DEBUG) << "Remove Theme: " << theme.GetId();
- // send dbus request at here
+ reply = RequestBroker::GetInst().SendData(Command::REMOVE, theme_info);
break;
+ default:
+ return -1;
}
return 0;
}
TEST_F(ThemeInfoLoaderTest, Load) {
EXPECT_CALL(GetMock<GioMock>(),
- g_dbus_message_new_method_call(StrEq("org.tizen.theme_manager"),
- StrEq("/org/tizen/theme_manager"), StrEq("org.tizen.theme_manager"),
+ g_dbus_message_new_method_call(StrEq("org.tizen.ThemeManager"),
+ StrEq("/org/tizen/ThemeManager"), StrEq("org.tizen.ThemeManager"),
StrEq("SendData"))).Times(1);
std::shared_ptr<ThemeInfo> info = loader_->Load(std::string("id"));