static char *_universal_switch_gendial_new_text_get(void *data, Evas_Object *obj, const char *part)
{
auto item_data = static_cast<GenGroupItemData *>(data);
- if (!safeStrCmp(item_data->itc.c_str(), "multiline")) {
- if (!safeStrCmp(part, "elm.text")) {
- if (!item_data->keyStr.empty()) {
- return (char *)g_strdup(_(item_data->keyStr.c_str()));
- }
- } else if (!safeStrCmp(part, "elm.text.multiline")) {
- if (!item_data->sub_desc.empty()) {
- return (char *)g_strdup(_(item_data->sub_desc.c_str()));
- }
- }
+ using namespace std::string_literals;
+
+ if (item_data->itc == "multiline") {
+ if (part == "elm.text"s && !item_data->keyStr.empty())
+ return strdup(item_data->keyStr.c_str());
+ else if (part == "elm.text.multiline"s && !item_data->sub_desc.empty())
+ return strdup(item_data->sub_desc.c_str());
} else {
- if (!safeStrCmp(part, "elm.text")) {
- if (!item_data->keyStr.empty()) {
- return (char *)g_strdup(_(item_data->keyStr.c_str()));
- }
- } else if (!safeStrCmp(part, "elm.text.sub")) {
- if (!item_data->sub_desc.empty()) {
- return (char *)g_strdup(_(item_data->sub_desc.c_str()));
- }
- }
+ if (part == "elm.text"s && !item_data->keyStr.empty())
+ return strdup(item_data->keyStr.c_str());
+ else if (part == "elm.text.sub"s && !item_data->sub_desc.empty())
+ return strdup(item_data->sub_desc.c_str());
}
- return NULL;
+
+ return nullptr;
}
static bool on_app_create(void *priv)
#include <system_settings.h>
#include <app.h>
+/* TODO remove after setting-common-draw-genlist.cpp is deleted */
+
/*return True just when NULL or '\0' */
bool isEmptyStr(const char *str)
{
return strcmp(s1, s2);
}
-
-PopupBtnResponse get_popup_btn_response_type(Evas_Object *obj)
-{
- if (!obj) return PopupBtnResponse::INVALID;
-
- auto rsp_type = PopupBtnResponse::CANCEL;
- char *btn_str = elm_entry_markup_to_utf8(elm_object_text_get(obj));
- if (btn_str) {
- if (0 == safeStrCmp(btn_str, _("IDS_CST_BUTTON_CLOSE"))
- /*KeyStr_Try */
- || 0 == safeStrCmp(btn_str, _("IDS_SAPPS_SK_TRY_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_OK"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_YES"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_STOP"))
- || 0 == safeStrCmp(btn_str,
- _("IDS_ST_BUTTON_DISCONNECT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_USE_MOTION"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_TPOP_TRY_AGAIN"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_DELETE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_RESET"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_FORMAT_ABB"))
- || 0 == safeStrCmp(btn_str,
- _("IDS_ST_HEADER_FORMAT_MVERB_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_CONTINUE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_SAVE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_ENABLE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_DISABLE"))
- || 0 == safeStrCmp(btn_str, _("IDS_SA_BUTTON_DONE_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_TURN_OFF"))
- || 0 == safeStrCmp(btn_str, _("IDS_CLD_BUTTON_EXPORT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_UNINSTALL"))
- || 0 == safeStrCmp(btn_str, _("IDS_SMEMO_BUTTON_IMPORT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_CLEAR_CACHE_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_MTTRL_BUTTON_ENABLE_MOTION"))
- /* The below 'Add switch' label must be substituted with valid localization tag
- * once it is defined */
- || 0 == safeStrCmp(btn_str, _("Add switch"))) {
- rsp_type = PopupBtnResponse::OK;
- } else { /*for others, */
- rsp_type = PopupBtnResponse::CANCEL;
- }
- FREE(btn_str);
- } else {
- rsp_type = PopupBtnResponse::INVALID;
- }
- FREE(btn_str);
- return rsp_type;
-}