Fix coding rule 40/234540/5
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 27 May 2020 06:18:21 +0000 (15:18 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 27 May 2020 09:59:56 +0000 (09:59 +0000)
Change-Id: I9b40e5f5c5e8c4e1086c8a2ae1d08c3fd9f27d0b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/main/main.cc
src/theme/dbus/request_broker.cc
src/theme/dbus/request_broker.h
src/unit_tests/test_theme_info_loader.cc

index 86622cc..bc05653 100644 (file)
@@ -54,16 +54,26 @@ bool ThemeManager::Init() {
   }
 
   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();
 
index d23bb23..9428f97 100644 (file)
@@ -16,6 +16,8 @@
 
 #include <gio/gio.h>
 
+#include <string>
+
 #include "theme/dbus/request_broker.h"
 #include "theme/utils/logging.h"
 
@@ -211,9 +213,7 @@ tizen_base::Bundle RequestBroker::SendData(Command cmd,
   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,
@@ -234,10 +234,10 @@ void RequestBroker::OnResultReceivedCb(GObject *source_object,
   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;
@@ -268,9 +268,7 @@ void RequestBroker::SendDataAsync(Command cmd, tizen_base::Bundle& data) {
   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,
index 5539081..5c92256 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <map>
 #include <memory>
+#include <string>
 
 #include "theme/dbus/request_filter.h"
 
index 0aa22bd..d691f20 100644 (file)
@@ -32,37 +32,33 @@ using namespace ttm::loader;
 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;
 }
 
@@ -102,7 +98,8 @@ class ThemeInfoLoaderTest : public testing::Test {
       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) {
@@ -119,7 +116,6 @@ TEST_F(ThemeInfoLoaderTest, RemoveEvent) {
 }
 
 TEST_F(ThemeInfoLoaderTest, RemoveEvent_N) {
-  std::shared_ptr<IThemeEvent> handler;
   std::string id("id");
   int ret = loader_->RemoveEvent(id);
   EXPECT_NE(0, ret);
@@ -142,4 +138,4 @@ TEST_F(ThemeInfoLoaderTest, LoadCurrent) {
 TEST_F(ThemeInfoLoaderTest, Load) {
   std::shared_ptr<ThemeInfo> info = loader_->Load(std::string("id"));
   EXPECT_NE(nullptr, info);
-}
\ No newline at end of file
+}