}
ttm::dbus::RequestBroker& r = ttm::dbus::RequestBroker::GetInst();
- std::shared_ptr<ttm::provider::ThemeInfoProxy> tip = std::make_shared<ttm::provider::ThemeInfoProxy>("/opt/dbspace/.tizen_theme.db");
- std::shared_ptr<ttm::dbus::IRequestHandler> crh = std::make_shared<ttm::provider::ControlRequestHandler>(tip);
- std::shared_ptr<ttm::dbus::IRequestHandler> perh = std::make_shared<ttm::provider::PackageEventRequestHandler>(tip);
- std::shared_ptr<ttm::dbus::IRequestHandler> srh = std::make_shared<ttm::provider::SelectionRequestHandler>(tip);
-
- r.RegisterRequestFilter(ttm::dbus::RequestFilter(ttm::dbus::Command::SET_ID, crh));
- r.RegisterRequestFilter(ttm::dbus::RequestFilter(ttm::dbus::Command::ADD, perh));
- r.RegisterRequestFilter(ttm::dbus::RequestFilter(ttm::dbus::Command::REMOVE, perh));
- r.RegisterRequestFilter(ttm::dbus::RequestFilter(ttm::dbus::Command::UPDATE, perh));
- r.RegisterRequestFilter(ttm::dbus::RequestFilter(ttm::dbus::Command::GET, srh));
+ std::shared_ptr<ttm::provider::ThemeInfoProxy> tip =
+ std::make_shared<ttm::provider::ThemeInfoProxy>(
+ "/opt/dbspace/.tizen_theme.db");
+ std::shared_ptr<ttm::dbus::IRequestHandler> crh =
+ std::make_shared<ttm::provider::ControlRequestHandler>(tip);
+ std::shared_ptr<ttm::dbus::IRequestHandler> perh =
+ std::make_shared<ttm::provider::PackageEventRequestHandler>(tip);
+ std::shared_ptr<ttm::dbus::IRequestHandler> srh =
+ std::make_shared<ttm::provider::SelectionRequestHandler>(tip);
+
+ r.RegisterRequestFilter(
+ ttm::dbus::RequestFilter(ttm::dbus::Command::SET_ID, crh));
+ r.RegisterRequestFilter(
+ ttm::dbus::RequestFilter(ttm::dbus::Command::ADD, perh));
+ r.RegisterRequestFilter(
+ ttm::dbus::RequestFilter(ttm::dbus::Command::REMOVE, perh));
+ r.RegisterRequestFilter(
+ ttm::dbus::RequestFilter(ttm::dbus::Command::UPDATE, perh));
+ r.RegisterRequestFilter(
+ ttm::dbus::RequestFilter(ttm::dbus::Command::GET, srh));
r.Listen();
#include <gio/gio.h>
+#include <string>
+
#include "theme/dbus/request_broker.h"
#include "theme/utils/logging.h"
g_dbus_message_set_body(msg,
g_variant_new("(is)",
static_cast<int>(cmd),
- reinterpret_cast<char*>(data.ToRaw().first.get())
- )
- );
+ reinterpret_cast<char*>(data.ToRaw().first.get())));
GDBusMessage* reply = g_dbus_connection_send_message_with_reply_sync(
connection_, msg, G_DBUS_SEND_MESSAGE_FLAGS_NONE,
GError* err = nullptr;
GDBusMessage* reply = g_dbus_connection_send_message_with_reply_finish(conn,
res, &err);
- if (!reply) {
+ if (!reply) {
LOG(ERROR) << "No reply . err[" << (err ? err->message : "Unknown") << "]";
- return;
- }
+ return;
+ }
int command;
char *serialized = nullptr;
g_dbus_message_set_body(msg,
g_variant_new("(is)",
static_cast<int>(cmd),
- reinterpret_cast<char*>(data.ToRaw().first.get())
- )
- );
+ reinterpret_cast<char*>(data.ToRaw().first.get())));
g_dbus_connection_send_message_with_reply(connection_, msg,
G_DBUS_SEND_MESSAGE_FLAGS_NONE, -1, nullptr,
#include <map>
#include <memory>
+#include <string>
#include "theme/dbus/request_filter.h"
static GDBusMessage* msg;
static GVariant *gv;
-static GDBusConnection* __g_bus_get_sync_fake(GBusType type, GCancellable *cancel,
- GError **error)
-{
- GDBusConnection *con = (GDBusConnection*)g_object_new(G_TYPE_OBJECT, NULL);
+static GDBusConnection* __g_bus_get_sync_fake(GBusType type,
+ GCancellable *cancel, GError **error) {
+ GDBusConnection *con =
+ reinterpret_cast<GDBusConnection*>(g_object_new(G_TYPE_OBJECT, NULL));
return con;
}
-void __g_variant_get_fake(GVariant *value, const gchar *format_string, va_list l)
-{
+void __g_variant_get_fake(GVariant *value, const gchar *format_string,
+ va_list l) {
}
GDBusMessage* __g_dbus_message_new_method_call_fake(const gchar *name,
- const gchar *path, const gchar *interface_, const gchar *method)
-{
+ const gchar *path, const gchar *interface_, const gchar *method) {
return msg;
}
-void __g_dbus_message_set_body_fake(GDBusMessage *message, GVariant *body)
-{
+void __g_dbus_message_set_body_fake(GDBusMessage *message, GVariant *body) {
}
-GVariant* __g_dbus_message_get_body_fake(GDBusMessage *message)
-{
+GVariant* __g_dbus_message_get_body_fake(GDBusMessage *message) {
return gv;
}
GDBusMessage* __g_dbus_connection_send_message_with_reply_sync_fake(
GDBusConnection *connection,
GDBusMessage *message, GDBusSendMessageFlags flags, gint timeout_msec,
- volatile guint32 *out_serial, GCancellable *cancellable, GError **error)
-{
+ volatile guint32 *out_serial, GCancellable *cancellable, GError **error) {
return msg;
}
g_variant_unref(gv);
}
- std::unique_ptr<ThemeInfoLoader> loader_ = std::make_unique<ThemeInfoLoader>();
+ std::unique_ptr<ThemeInfoLoader> loader_ =
+ std::make_unique<ThemeInfoLoader>();
};
TEST_F(ThemeInfoLoaderTest, AddEvent) {
}
TEST_F(ThemeInfoLoaderTest, RemoveEvent_N) {
- std::shared_ptr<IThemeEvent> handler;
std::string id("id");
int ret = loader_->RemoveEvent(id);
EXPECT_NE(0, ret);
TEST_F(ThemeInfoLoaderTest, Load) {
std::shared_ptr<ThemeInfo> info = loader_->Load(std::string("id"));
EXPECT_NE(nullptr, info);
-}
\ No newline at end of file
+}