Fixed minor issues and inconsistencies. 03/51703/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 12 Nov 2015 10:59:52 +0000 (12:59 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 12 Nov 2015 11:13:31 +0000 (13:13 +0200)
Change-Id: I38d39ae564e3426fb61b2424118bb8ce30ca35d7
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-common/inc/App/AppControl.h
lib-common/inc/Utils/Callback.h
lib-common/inc/Utils/Logger.h
lib-common/src/App/AppControl.cpp
lib-common/src/Ui/Control.cpp
lib-common/src/Ui/Naviframe.cpp
lib-common/src/Ui/NaviframePage.cpp
lib-common/src/Ui/Popup.cpp
lib-common/src/Ui/TabPage.cpp
lib-common/src/Ui/Thumbnail.cpp
main-app/res/po/CMakeLists.txt

index d973883..9f2f172 100644 (file)
@@ -88,7 +88,7 @@ namespace App
                void reset();
 
                app_control_h m_AppControl;
-               bool m_Detached;
+               bool m_AutoTerminate;
        };
 }
 
index 0cf93aa..80e7f11 100644 (file)
  * @endcode
  */
 #define makeCallback(method) \
-       Utils::Callback<decltype(method)>::makeWithFirstParam<method>()
+       ::Utils::Callback<decltype(method)>::makeWithFirstParam<method>()
 
 /**
  * @brief Make C-style callback from non-static class method with object as last parameter.
  * @see makeCallback()
  */
 #define makeCallbackWithLastParam(method) \
-       Utils::Callback<decltype(method)>::makeWithLastParam<method>()
+       ::Utils::Callback<decltype(method)>::makeWithLastParam<method>()
 
 #endif /* UTILS_CALLBACK_H */
index e25b9bb..886f997 100644 (file)
@@ -24,7 +24,7 @@
 #define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
 #include "Utils/Tracer.h"
-#define TRACE Utils::Tracer tracer(LOG_TAG, __MODULE__, __func__, __LINE__)
+#define TRACE ::Utils::Tracer tracer(LOG_TAG, __MODULE__, __func__, __LINE__)
 
 #define DLOG(prio, fmt, arg...) dlog_print(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg)
 #define DBG(fmt, arg...) DLOG(DLOG_DEBUG, fmt, ##arg)
index 605c6c6..3f6bb5d 100644 (file)
@@ -23,7 +23,7 @@
 using namespace App;
 
 AppControl::AppControl()
-       : m_AppControl(nullptr), m_Detached(false)
+       : m_AppControl(nullptr), m_AutoTerminate(true)
 {
 }
 
@@ -37,7 +37,7 @@ AppControl::AppControl(const char *operation, const char *mime, const char *uri)
 }
 
 AppControl::AppControl(AppControl &&that)
-       : m_AppControl(that.m_AppControl), m_Detached(that.m_Detached)
+       : m_AppControl(that.m_AppControl), m_AutoTerminate(that.m_AutoTerminate)
 {
        that.m_AppControl = nullptr;
 }
@@ -65,7 +65,6 @@ void AppControl::addExtra(const char *key, const char **array, int length)
 int AppControl::launch(app_control_reply_cb replyCallback, void *userData,
                bool groupMode)
 {
-       m_Detached = !groupMode;
        if (groupMode) {
                app_control_set_launch_mode(m_AppControl, APP_CONTROL_LAUNCH_MODE_GROUP);
        }
@@ -83,14 +82,14 @@ void AppControl::terminate()
 
 void AppControl::detach()
 {
-       m_Detached = true;
+       m_AutoTerminate = false;
 }
 
 AppControl &AppControl::operator=(AppControl &&that)
 {
        reset();
        m_AppControl = that.m_AppControl;
-       m_Detached = that.m_Detached;
+       m_AutoTerminate = that.m_AutoTerminate;
        that.m_AppControl = nullptr;
 
        return *this;
@@ -99,7 +98,7 @@ AppControl &AppControl::operator=(AppControl &&that)
 void AppControl::reset()
 {
        if (m_AppControl) {
-               if (!m_Detached) {
+               if (m_AutoTerminate) {
                        terminate();
                }
                app_control_destroy(m_AppControl);
index 80e00c5..5d27431 100644 (file)
@@ -19,6 +19,8 @@
 #include "Ui/Window.h"
 #include "Utils/Callback.h"
 
+#define CONTROL_DATA_KEY "Ui::Control"
+
 using namespace Ui;
 
 Control::Control()
@@ -53,13 +55,13 @@ Window *Control::getWindow() const
 
 Control *Control::getControl(Evas_Object *obj)
 {
-       return (Control *) evas_object_smart_data_get(obj);
+       return (Control *) evas_object_data_get(obj, CONTROL_DATA_KEY);
 }
 
 void Control::setEvasObject(Evas_Object *object)
 {
        m_Object = object;
-       evas_object_smart_data_set(m_Object, this);
+       evas_object_data_set(m_Object, CONTROL_DATA_KEY, this);
        evas_object_event_callback_add(m_Object, EVAS_CALLBACK_FREE,
                        makeCallback(&Control::onDestroy), this);
 }
@@ -69,7 +71,7 @@ Evas_Object *Control::resetEvasObject()
        Evas_Object *object = m_Object;
        evas_object_event_callback_del(m_Object, EVAS_CALLBACK_FREE,
                        makeCallback(&Control::onDestroy));
-       evas_object_smart_data_set(m_Object, nullptr);
+       evas_object_data_del(m_Object, CONTROL_DATA_KEY);
        m_Object = nullptr;
        return object;
 }
index 24a0757..152eb10 100644 (file)
@@ -58,7 +58,7 @@ void Naviframe::navigateToView(View *view)
 {
        if (view != getCurrentView()) {
                NaviframePage *page = static_cast<NaviframePage*>(view->getPage());
-               elm_naviframe_item_promote(page->m_NaviItem);
+               elm_naviframe_item_pop_to(page->m_NaviItem);
        }
 }
 
index 6ef7a16..125a9b5 100644 (file)
@@ -36,7 +36,7 @@ NaviframePage::~NaviframePage()
 
 void NaviframePage::setTitle(const char *title)
 {
-       elm_object_item_domain_translatable_part_text_set(m_NaviItem, "elm.text.title", nullptr, title);
+       elm_object_item_translatable_part_text_set(m_NaviItem, "elm.text.title", title);
        elm_naviframe_item_title_enabled_set(m_NaviItem, title != nullptr, EINA_TRUE);
 }
 
index 2d04ea2..675d8b0 100644 (file)
@@ -47,13 +47,12 @@ Popup *Popup::create(Evas_Object *parent, const char *title,
 
 void Popup::setTitle(const char *title)
 {
-       elm_object_domain_translatable_part_text_set(getEvasObject(), PART_POPUP_TITLE,
-                       nullptr, title);
+       elm_object_translatable_part_text_set(getEvasObject(), PART_POPUP_TITLE, title);
 }
 
 void Popup::setText(const char *text)
 {
-       elm_object_domain_translatable_text_set(getEvasObject(), nullptr, text);
+       elm_object_translatable_text_set(getEvasObject(), text);
 }
 
 void Popup::setContent(Evas_Object *content)
@@ -69,7 +68,7 @@ Evas_Object *Popup::addButton(const char *text, ButtonCallback callback)
 
        Evas_Object *button = elm_button_add(getEvasObject());
        elm_object_style_set(button, "bottom");
-       elm_object_domain_translatable_text_set(button, nullptr, text);
+       elm_object_translatable_text_set(button, text);
        elm_object_part_content_set(getEvasObject(), buttonParts[m_ButtonCount], button);
 
        m_ButtonCbs[m_ButtonCount] = std::move(callback);
@@ -84,10 +83,7 @@ Evas_Object *Popup::addButton(const char *text, ButtonCallback callback)
 Evas_Object *Popup::onCreate(Evas_Object *parent)
 {
        Evas_Object *popup = elm_popup_add(parent);
-
        elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
-       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
        eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, nullptr);
        evas_object_show(popup);
 
index 7dd4c75..38b12d1 100644 (file)
@@ -52,7 +52,7 @@ Evas_Object *TabPage::onCreate(Evas_Object *parent)
 
 void TabPage::setTitle(const char *title)
 {
-       elm_object_item_domain_translatable_text_set(m_TabItem, nullptr, title);
+       elm_object_item_translatable_text_set(m_TabItem, title);
 }
 
 void TabPage::setStyle(const char *style)
index 45b7e3f..da69a9b 100644 (file)
@@ -32,7 +32,7 @@ namespace
        } params[] = {
                { GROUP_THUMBNAIL_SMALL, GROUP_THUMBNAIL_DEFAULT_SMALL },
                { GROUP_THUMBNAIL_MEDIUM, GROUP_THUMBNAIL_DEFAULT_MEDIUM },
-               { GROUP_THUMBNAIL_LARGE, GROUP_THUMBNAIL_DEFAULT_LARGE },
+               { GROUP_THUMBNAIL_LARGE, GROUP_THUMBNAIL_DEFAULT_LARGE }
        };
 
        const std::string layoutPath = App::getResourcePath(COMMON_THUMBNAIL_EDJ);
index afc5607..f8e9eda 100755 (executable)
@@ -2,14 +2,13 @@ file(GLOB PO_FILES *.po)
 
 foreach(PO_FILE ${PO_FILES})
        get_filename_component(LANG ${PO_FILE} NAME_WE)
-       set(MO_FILE ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.mo)
-       add_custom_command(OUTPUT ${MO_FILE}
+       set(MO_FILE ${LANG}.mo)
+
+       add_custom_target(${MO_FILE}
                COMMAND msgfmt -o ${MO_FILE} ${PO_FILE}
                DEPENDS ${PO_FILE}
        )
+
+       add_dependencies(${PROJECT_NAME} ${MO_FILE})
        install(FILES ${MO_FILE} DESTINATION ${LOCALEDIR}/${LANG}/LC_MESSAGES RENAME ${PACKAGE}.mo)
-       set(MO_FILES ${MO_FILES} ${MO_FILE})
 endforeach(PO_FILE)
-
-add_custom_target(po ALL DEPENDS ${MO_FILES})
-