Check coding style 88/186188/2
authormk5004.lee <mk5004.lee@samsung.com>
Wed, 8 Aug 2018 03:13:45 +0000 (12:13 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Wed, 8 Aug 2018 03:18:41 +0000 (12:18 +0900)
- additional

Change-Id: I0367fa85c2c8d4f538b2508198e3c3d6ea96d95d
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
18 files changed:
parser/complication_parser_plugin.cc
parser/complication_parser_plugin_internal.cc
watchface-common/watchface-util.cc
watchface-common/watchface_exception.h
watchface-complication-provider/complication-provider-implementation.h
watchface-complication-provider/complication-provider.cc
watchface-complication-provider/complication-provider.h
watchface-complication-provider/watchface-complication-provider.cc
watchface-complication/complication-bundle.h
watchface-complication/complication-implementation.h
watchface-complication/complication.cc
watchface-complication/db-manager.h
watchface-complication/editables-container.cc
watchface-complication/editables-manager-implementation.h
watchface-complication/editables-manager.h
watchface-complication/received-editable.h
watchface-editor/editables-editor.cc
watchface-editor/watchface-editor.cc

index 9797867..b3bd16e 100644 (file)
@@ -32,7 +32,7 @@
 #include "watchface-complication/include/watchface-complication-internal.h"
 #include "watchface-complication/include/watchface-complication.h"
 
-#include "complication_parser_plugin_internal.h"
+#include "parser/complication_parser_plugin_internal.h"
 
 #define DEFAULT_SHORT_TEXT "default-short-text"
 #define DEFAULT_LONG_TEXT "default-long-text"
index d368933..d781b09 100644 (file)
@@ -23,7 +23,7 @@
 #include <dlog.h>
 #include <tzplatform_config.h>
 
-#include "complication_parser_plugin_internal.h"
+#include "parser/complication_parser_plugin_internal.h"
 
 #define BUSY_WAITING_USEC 50000 /* 0.05 sec */
 #define BUSY_WAITING_MAX 20 /* wait for max 1 sec */
index 15e4eef..d42f730 100644 (file)
 #include <fcntl.h>
 #include <glib.h>
 #include <gio/gio.h>
-#include <string>
 #include <cynara-client.h>
 #include <cynara-creds-gdbus.h>
 #include <cynara-session.h>
 
-#include "watchface-util.h"
-#include "watchface-common.h"
+#include <string>
+
+#include "watchface-common/watchface-util.h"
+#include "watchface-common/include/watchface-common.h"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
index 7e63eb5..f611b29 100644 (file)
@@ -19,7 +19,8 @@
 
 #include <string>
 #include <exception>
-#include "watchface-common.h"
+
+#include "watchface-common/include/watchface-common.h"
 
 #define THROW(error_code) throw Exception(error_code, __FILE__, __LINE__)
 
@@ -27,7 +28,8 @@ namespace watchface_complication {
 
 class Exception : public std::exception {
  public:
-  Exception(int error_code, std::string file = __FILE__, int line = __LINE__ ) {
+  explicit Exception(int error_code, std::string file = __FILE__,
+      int line = __LINE__ ) {
     _error_code = error_code;
     _whatMessage = file.substr(file.find_last_of("/") + 1) + ":"
         + std::to_string(line) + GetErrorString(error_code);
index 88ae1a1..b883b4c 100644 (file)
@@ -49,20 +49,21 @@ class ComplicationProvider::Impl : ComplicationConnector::IEventListener {
   Impl(ComplicationProvider* parent, const std::string& provider_id);
   class SenderInfo {
    public:
-      SenderInfo(const std::string& sender_name, const char* sender_app_id,
+    SenderInfo(const std::string& sender_name, const char* sender_app_id,
                       int watcher_id);
-      int CheckPrivilege(std::list<std::string>& required_privileges, GDBusConnection* connection);
-      bool CheckAppid(const std::string& Appid);
-      int GetWatcherID();
-      cynara_result GetPrivilegeResult();
-      void SetPrivilegeResult(cynara_result result);
+    int CheckPrivilege(std::list<std::string>& required_privileges,
+                        GDBusConnection* connection);
+    bool CheckAppid(const std::string& Appid);
+    int GetWatcherID();
+    cynara_result GetPrivilegeResult();
+    void SetPrivilegeResult(cynara_result result);
 
    private:
-      std::string sender_name_;
-      std::string sender_app_id_;
-      int watcher_id_;
-      std::list<std::string> sender_privileges_;
-      cynara_result privilege_result_;
+    std::string sender_name_;
+    std::string sender_app_id_;
+    int watcher_id_;
+    std::list<std::string> sender_privileges_;
+    cynara_result privilege_result_;
   };
 
  private:
index 54d32dc..de2d1dc 100644 (file)
 #include <glib.h>
 #include <unistd.h>
 
+#include <list>
+
 #include "watchface-common/watchface-util.h"
-#include "complication-provider.h"
-#include "complication-provider-implementation.h"
+#include "watchface-complication-provider/complication-provider.h"
+#include "watchface-complication-provider/complication-provider-implementation.h"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -63,11 +65,10 @@ ComplicationProvider::Impl::Impl(ComplicationProvider* parent,
   LOGI("subscribe signal %d", subscribe_id_);
 }
 
-ComplicationProvider::Impl::SenderInfo::SenderInfo(const std::string& sender_name,
-                                                    const char* sender_app_id,
-                                                    int watcher_id)
+ComplicationProvider::Impl::SenderInfo::SenderInfo(
+    const std::string& sender_name, const char* sender_app_id, int watcher_id)
   : sender_name_(sender_name), sender_app_id_(sender_app_id),
-     watcher_id_(watcher_id), privilege_result_(COMPLICATION_CYNARA_UNKNOWN) {
+    watcher_id_(watcher_id), privilege_result_(COMPLICATION_CYNARA_UNKNOWN) {
 }
 
 int ComplicationProvider::Impl::SenderInfo::CheckPrivilege(
index aef41e7..0fbaf06 100644 (file)
@@ -28,7 +28,7 @@ namespace watchface_complication {
 
 class EXPORT_API ComplicationProvider : public IComplicationEvent {
  public:
-  ComplicationProvider(const std::string& provider_id);
+  explicit ComplicationProvider(const std::string& provider_id);
   virtual ~ComplicationProvider();
 
  public:
index a83278e..fcfaee4 100644 (file)
@@ -29,8 +29,8 @@
 #include <list>
 
 #include "watchface-common/watchface-util.h"
-#include "complication-provider.h"
-#include "include/watchface-complication-provider.h"
+#include "watchface-complication-provider/complication-provider.h"
+#include "watchface-complication-provider/include/watchface-complication-provider.h"
 #include "watchface-complication/db-manager.h"
 #include "watchface-complication/include/watchface-complication-internal.h"
 
@@ -67,7 +67,7 @@ class CallbackInfo {
 
 class WatchComplicationProviderStub : public ComplicationProvider {
  public:
-  WatchComplicationProviderStub(const std::string& provider_id)
+  explicit WatchComplicationProviderStub(const std::string& provider_id)
     : ComplicationProvider(provider_id) {
   }
 
index e55f680..de6f049 100644 (file)
 #define WATCHFACE_COMPLICATION_COMPLICATION_BUNDLE_H_
 
 #include <bundle.h>
-#include <string>
 
 #include <watchface-common.h>
 
+#include <string>
+
 namespace watchface_complication {
 
 class EXPORT_API Bundle {
index 21e9112..8c1ff63 100644 (file)
 #define WATCHFACE_COMPLICATION_COMPLICATION_IMPLEMENTATION_H_
 
 #include <gio/gio.h>
+#include <dlog.h>
 
 #include <memory>
 #include <string>
 #include <map>
 #include <list>
-#include <dlog.h>
 
 #include "watchface-complication/complication.h"
 #include "watchface-complication/complication-connector.h"
index c378b12..cfceea2 100644 (file)
 #include <appsvc.h>
 #include <stdexcept>
 
+#include "watchface-common/watchface-util.h"
 #include "watchface-complication/complication.h"
 #include "watchface-complication/complication-implementation.h"
-#include "watchface-common/watchface-util.h"
-#include "watchface-complication-internal.h"
+#include "watchface-complication/include/watchface-complication-internal.h"
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -115,7 +115,8 @@ void Complication::Impl::OnSignal(GDBusConnection* connection,
       LOGI("invalid sender_appid");
       return;
     }
-    std::string provider_appid = DBManager::GetProviderAppId(cur_provider_id_.c_str());
+    std::string provider_appid =
+                DBManager::GetProviderAppId(cur_provider_id_.c_str());
     if (provider_appid.empty()) {
       LOGI("invalid provider_appid");
       return;
@@ -226,7 +227,7 @@ void Complication::Impl::RestoreStateOrSetDefault() {
     else
       cur_type_ = default_type_;
 
-    LOGI("get setting from bundle %s, %s", prev_provider_id, prev_provider_type);
+    LOGI("prev provider info %s, %s", prev_provider_id, prev_provider_type);
   }
 
   cur_data_idx_ = FindCandidateDataIdx(cur_provider_id_, cur_type_);
@@ -636,7 +637,8 @@ int Complication::UpdateLastContext() {
   }
 
   try {
-    impl_->last_context_data_.reset(new Bundle((impl_->context_data_.get())->GetRaw()));
+    impl_->last_context_data_.reset(
+                new Bundle((impl_->context_data_.get())->GetRaw()));
   } catch (const std::bad_alloc &ba) {
     LOGE("Bundle::Exception bad_alloc");
     return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
index 2a8c4ea..a15b031 100644 (file)
 #define WATCHFACE_COMPLICATION_DB_MANAGER_H_
 
 #include <gio/gio.h>
+#include <sqlite3.h>
+#include <watchface-common.h>
+
 #include <string>
 #include <memory>
 #include <list>
-#include <sqlite3.h>
 
-#include <watchface-common.h>
 #include "watchface-complication/complication-bundle.h"
 
 namespace watchface_complication {
@@ -48,9 +49,10 @@ class EXPORT_API DBManager {
                                         int support_type);
   static std::string GetProviderAppId(const char* provider_id);
   static std::list<std::string> GetProviderList(int support_type);
-  static std::list<std::string> GetRequiredPrivlegeList(std::string& provider_id);
+  static std::list<std::string> GetRequiredPrivlegeList(
+                  std::string& provider_id);
   static std::list<std::unique_ptr<ProviderInfo>> GetProviderListWithTypes(
-    int support_types);
+                  int support_types);
   static int GetSupportTypes(std::string& provider_id, int* types);
   static int GetProviderPeriod(std::string& provider_id, int* period);
   static std::string GetLabel(const char* provider_id);
index 7c6da49..b073bd2 100644 (file)
 #include <unistd.h>
 #include <bundle.h>
 #include <bundle_internal.h>
+
 #include <utility>
 
 #include "watchface-complication/editables-container.h"
 #include "watchface-complication/editables-container-implementation.h"
-#include "watchface-complication-internal.h"
+#include "watchface-complication/include/watchface-complication-internal.h"
 #include "watchface-common/watchface-util.h"
 
 #ifdef LOG_TAG
@@ -185,12 +186,14 @@ int EditablesContainer::RequestEdit() {
     }
 
     bundle_add(ed, "SETUP_APPID", i.get()->GetSetupAppId().c_str());
-    bundle_add(ed, "EDITABLE_ID", std::to_string(i.get()->GetEditableId()).c_str());
+    bundle_add(ed, "EDITABLE_ID",
+                        std::to_string(i.get()->GetEditableId()).c_str());
 
     int cur_data_idx = i.get()->GetCurDataIdx();
     bundle_add(ed, "CUR_DATA_IDX", std::to_string(cur_data_idx).c_str());
 
-    std::unique_ptr<const char*[]> arr(new const char*[i->GetCandidates().size()]);
+    std::unique_ptr<const char*[]> arr(
+                        new const char*[i->GetCandidates().size()]);
     int idx = 0;
     for (auto& data : i.get()->GetCandidates()) {
       arr.get()[idx++] = data->ToString();
index 821bbb2..a1663b1 100644 (file)
 #define WATCHFACE_COMPLICATION_EDITABLES_MANAGER_IMPLEMENTATION_H_
 
 #include <gio/gio.h>
+#include <app_common.h>
 
 #include <memory>
 #include <string>
 #include <list>
-#include <app_common.h>
 
 #include "watchface-complication/complication.h"
 #include "watchface-complication/complication-connector.h"
index da630d3..d0f2083 100644 (file)
 #define WATCHFACE_COMPLICATION_EDITABLES_MANAGER_H_
 
 #include <gio/gio.h>
+#include <watchface-common.h>
+
 #include <string>
 #include <memory>
 
-#include <watchface-common.h>
 #include "watchface-complication/complication-bundle.h"
 
 namespace watchface_complication {
index 7bffdd9..f2c56b7 100644 (file)
@@ -29,7 +29,7 @@ namespace watchface_complication {
 
 class EXPORT_API ReceivedEditable : public IEditable {
  public:
-  ReceivedEditable(std::string raw);
+  explicit ReceivedEditable(std::string raw);
   virtual ~ReceivedEditable();
   ReceivedEditable(ReceivedEditable const& other) = default;
   ReceivedEditable(ReceivedEditable && other) = default;
index b8b5273..e2f28dc 100644 (file)
@@ -106,7 +106,7 @@ void EditablesEditor::Impl::OnSignal(GDBusConnection* connection,
       return;
     }
 
-    bundle* data = bundle_decode(raw, strlen((char*)raw));
+    bundle* data = bundle_decode(raw, strlen(reinterpret_cast<char*>(raw)));
     const char** str_arr = NULL;
     int len = 0;
 
index bc9a096..04f8f45 100644 (file)
 #include <stdio.h>
 #include <errno.h>
 #include <glib.h>
-#include <string>
-
 #include <dlog.h>
 #include <app_control.h>
 
+#include <string>
+
 #include "watchface-editor/include/watchface-editor.h"
 #include "watchface-complication/complication.h"
 #include "watchface-editor/editables-editor.h"