w3-home clean up 50/194650/1
authorShubhojeet <shubhojeet.y@samsung.com>
Thu, 6 Dec 2018 21:53:53 +0000 (03:23 +0530)
committerShubhojeet <shubhojeet.y@samsung.com>
Thu, 6 Dec 2018 21:58:39 +0000 (03:28 +0530)
Change-Id: Ic0ec58243757e3bdebd6fdd6d2011c0f040ee5b2

src/add-viewer_util.c
src/apps/apps_db.c [deleted file]
src/dbus_util.c
src/edit.c
src/layout.c
src/notification/noti_action_buttons_view.c
src/notification/noti_detail_view.c
src/popup.c
src/widget.c
src/xml.c

index 5c6ad8ffd14542c869f3e87be4d0d6ed9825df65..4e718276eece5950e1f7846bf1781a555c2008ff 100755 (executable)
 
 #include <Elementary.h>
 #include <dlog.h>
-#include <device/display.h>
-#include <appsvc.h>
-#include <widget_service.h>
 #include <app.h>
-#include <aul.h>
 
 #include "add-viewer_debug.h"
 #include "add-viewer_package.h"
@@ -56,157 +52,6 @@ static struct {
        },
 };
 
-struct result_data {
-       struct add_viewer_package *package;
-       int size;
-};
-
-extern int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id);
-
-extern int aul_listen_app_dead_signal(int (*func)(int signal, void *data), void *data);
-
-int _dead_cb(int pid, void *data)
-{
-       char pkgname[256];
-
-       if (aul_app_get_pkgname_bypid(pid, pkgname, sizeof(pkgname)) != AUL_R_OK) {
-               ErrPrint("Failed to get pkgname for %d\n", pid);
-               return 0;
-       }
-
-       if (s_info.setup && !strcmp(pkgname, s_info.setup)) {
-               ErrPrint("Setup app is terminated [%s]\n", s_info.setup);
-               free(s_info.setup);
-               s_info.setup = NULL;
-               elm_exit();
-       }
-
-       return 0;
-}
-
-HAPI int add_viewer_util_init(void)
-{
-       aul_listen_app_dead_signal(_dead_cb, NULL);
-
-       return 0;
-}
-
-HAPI int add_viewer_util_fini(void)
-{
-       return 0;
-}
-
-static void response_callback(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
-{
-       struct result_data *res_data = user_data;
-       char *content_info = NULL;
-
-       if (s_info.setup) {
-               free(s_info.setup);
-               s_info.setup = NULL;
-       }
-
-       if (result != APP_CONTROL_RESULT_SUCCEEDED) {
-               ErrPrint("Operation is canceled: %d\n", result);
-               elm_exit();
-               return;
-       }
-
-       app_control_get_extra_data(reply, EXTRA_KEY_CONTENT_INFO , &content_info);
-
-       /**
-        * \TODO
-        * Use this content_info to add a new widget
-        */
-
-       free(res_data);
-
-       /**
-        * If the box is successfully added, do we need to terminate this?
-        */
-}
-
-HAPI int add_viewer_util_add_to_home(struct add_viewer_package *package, int size, int use_noti)
-{
-       int ret = -EINVAL;
-       char *setup;
-
-       setup = widget_service_get_app_id_of_setup_app(add_viewer_package_list_pkgname(package));
-       if (setup) {
-               app_control_h service;
-               struct result_data *res_data;
-
-               if (s_info.setup) {
-                       ErrPrint("Setup is already launched: %s\n", s_info.setup);
-                       free(s_info.setup);
-                       s_info.setup = NULL;
-               }
-
-               DbgPrint("Setup App: %s\n", setup);
-
-               res_data = malloc(sizeof(*res_data));
-               if (!res_data) {
-                       free(setup);
-                       return -ENOMEM;
-               }
-
-               res_data->package = package;
-               res_data->size = size;
-
-               ret = app_control_create(&service);
-               if (ret != APP_CONTROL_ERROR_NONE) {
-                       free(setup);
-                       free(res_data);
-                       return -EFAULT;
-               }
-
-               ret = app_control_set_app_id(service, setup);
-               if (ret != APP_CONTROL_ERROR_NONE) {
-                       free(setup);
-                       free(res_data);
-                       app_control_destroy(service);
-                       return -EFAULT;
-               }
-
-               ret = app_control_set_operation(service, SERVICE_OPERATION_WIDGET_SETUP);
-               if (ret != APP_CONTROL_ERROR_NONE) {
-                       free(setup);
-                       free(res_data);
-                       app_control_destroy(service);
-                       return -EFAULT;
-               }
-
-               ret = app_control_send_launch_request(service, response_callback, res_data);
-
-               free(res_data);
-               app_control_destroy(service);
-
-               if (ret != APP_CONTROL_ERROR_NONE)
-                       free(setup);
-               else
-                       s_info.setup = setup;
-       } else {
-               /**
-                * \TODO
-                * Create a new widget without content_info
-                */
-       }
-
-       return ret;
-}
-
-HAPI int add_viewer_util_is_lcd_off(void)
-{
-       display_state_e state;
-
-       if (device_display_get_state(&state) != 0) {
-               ErrPrint("Idle lock state is not valid\n");
-               state = DISPLAY_STATE_NORMAL; /* UNLOCK */
-       }
-
-       return state == DISPLAY_STATE_SCREEN_OFF;
-}
-
 HAPI char *add_viewer_util_highlight_keyword(const char *name, const char *filter)
 {
        char *highlighted_name;
diff --git a/src/apps/apps_db.c b/src/apps/apps_db.c
deleted file mode 100755 (executable)
index 83ee749..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * w-home
- * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sqlite3.h>
-
-#include "log.h"
-#include "util.h"
-#include "apps/apps_data.h"
-#include "apps/apps_db.h"
-
-#define APPS_DB_NAME ".apps-data.db"
-#define QUERY_MAXLEN   4096
-static sqlite3 *apps_db = NULL;
-
-enum {
-       COL_ID = 0,
-       COL_APPLICATION_ID,
-       COL_PACKAGE_ID,
-       COL_LABEL,
-       COL_ICON,
-       COL_POSITION,
-};
-
-#define CREATE_APPS_DB_TABLE "create table if not exists apps(\
-       id INTEGER PRIMARY KEY AUTOINCREMENT,\
-appId          TEXT,\
-pkgId          TEXT,\
-label          TEXT,\
-iconPath       TEXT,\
-position       TEXT);"
-
-#define UPDATE_APPS_DB_TABLE "UPDATE apps set \
-       appId='%s',\
-pkgId='%s',\
-label='%s',\
-iconPath='%s,\
-position=%d' WHERE id = %d"
-
-#define INSERT_APPS_DB_TABLE "INSERT into apps \
-       (appId, pkgId, label, iconPath, position)\
-VALUES('%s','%s','%s','%s',%d)"
-
-#define SELECT_ITEM "SELECT * FROM apps;"
-
-static bool _apps_db_open(void);
-
-bool apps_db_create(void)
-{
-       char *errMsg;
-       int ret;
-       const char *db_path = util_get_data_file_path(APPS_DB_NAME);
-       FILE *fp = fopen(db_path, "r");
-       if (fp) {
-               fclose(fp);
-               _APPS_E("Apps DB[%s] exist", db_path);
-               return false;
-       }
-
-       ret = sqlite3_open(db_path, &apps_db);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error : [%d] : path [%s]", ret, db_path);
-               return false;
-       }
-       ret = sqlite3_exec(apps_db, "PRAGMA journal_mode = PERSIST",
-                       NULL, NULL, &errMsg);
-       if (ret != SQLITE_OK) {
-               _APPS_E("SQL error(%d) : %s", ret, errMsg);
-               sqlite3_free(errMsg);
-               return false;
-       }
-
-       ret = sqlite3_exec(apps_db, CREATE_APPS_DB_TABLE, NULL, NULL, &errMsg);
-       if (ret != SQLITE_OK) {
-               _APPS_E("SQL error(%d) : %s", ret, errMsg);
-               sqlite3_free(errMsg);
-               return false;
-       }
-
-       return true;
-}
-
-bool apps_db_close(void)
-{
-       if (apps_db) {
-               sqlite3_exec(apps_db, "COMMIT TRANSACTION", NULL, NULL, NULL);
-               sqlite3_close(apps_db);
-               apps_db = NULL;
-       }
-       return true;
-}
-
-bool apps_db_update(apps_data_s *item)
-{
-       char query[QUERY_MAXLEN];
-       sqlite3_stmt *stmt;
-       if (!_apps_db_open())
-               return false;
-
-       snprintf(query, QUERY_MAXLEN, UPDATE_APPS_DB_TABLE,
-                       item->app_id,
-                       item->pkg_id,
-                       item->label,
-                       item->icon,
-                       item->position,
-                       item->db_id);
-       int ret = sqlite3_prepare(apps_db, query, QUERY_MAXLEN , &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error : [%s,%s]", query, sqlite3_errmsg(apps_db));
-               goto ERROR;
-       }
-       ret = sqlite3_step(stmt);
-       if (ret != SQLITE_DONE && ret != SQLITE_ROW && ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               goto ERROR;
-       }
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               apps_db_close();
-               return false;
-       }
-
-       apps_db_close();
-       return true;
-
-ERROR:
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK)
-               _APPS_E("sqlite error [%d]", ret);
-       apps_db_close();
-       return false;
-}
-
-bool apps_db_insert(apps_data_s *item)
-{
-       char query[QUERY_MAXLEN];
-       sqlite3_stmt *stmt;
-       if (!_apps_db_open())
-               return false;
-
-       snprintf(query, QUERY_MAXLEN, INSERT_APPS_DB_TABLE,
-                       item->app_id,
-                       item->pkg_id,
-                       item->label,
-                       item->icon,
-                       item->position);
-
-       int ret = sqlite3_prepare(apps_db, query, QUERY_MAXLEN , &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error : [%s,%s]", query, sqlite3_errmsg(apps_db));
-               goto ERROR;
-       }
-       ret = sqlite3_step(stmt);
-       if (ret != SQLITE_DONE && ret != SQLITE_ROW && ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               goto ERROR;
-       }
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               apps_db_close();
-               return false;
-       }
-
-       item->db_id = (int)sqlite3_last_insert_rowid(apps_db);
-
-       apps_db_close();
-       return true;
-ERROR:
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK)
-               _APPS_E("sqlite error [%d]", ret);
-       apps_db_close();
-       return false;
-}
-
-bool apps_db_delete(apps_data_s *item)
-{
-       char query[QUERY_MAXLEN];
-       sqlite3_stmt *stmt;
-       if (!_apps_db_open())
-               return false;
-
-       snprintf(query, QUERY_MAXLEN, "DELETE FROM apps WHERE id=%d", item->db_id);
-       int ret = sqlite3_prepare(apps_db, query, QUERY_MAXLEN , &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error : [%s,%s]", query, sqlite3_errmsg(apps_db));
-               goto ERROR;
-       }
-       ret = sqlite3_step(stmt);
-       if (ret != SQLITE_DONE && ret != SQLITE_ROW && ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               goto ERROR;
-       }
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               apps_db_close();
-               return false;
-       }
-
-       apps_db_close();
-       return true;
-ERROR:
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK)
-               _APPS_E("sqlite error [%d]", ret);
-       apps_db_close();
-       return false;
-}
-
-bool apps_db_get_list(Eina_List **apps_db_list)
-{
-       sqlite3_stmt *stmt;
-       const char *str = NULL;
-
-       if (!_apps_db_open())
-               return false;
-
-       int ret = sqlite3_prepare_v2(apps_db, SELECT_ITEM, strlen(SELECT_ITEM), &stmt, NULL);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error : [%s,%s]", SELECT_ITEM, sqlite3_errmsg(apps_db));
-               goto ERROR;
-       }
-
-       while (sqlite3_step(stmt) == SQLITE_ROW) {
-               apps_data_s *item = (apps_data_s *)malloc(sizeof(apps_data_s));
-               memset(item, 0, sizeof(apps_data_s));
-
-               item->db_id = sqlite3_column_int(stmt, COL_ID);
-
-               str = (const char *) sqlite3_column_text(stmt, COL_APPLICATION_ID);
-               item->app_id = (!str || !strlen(str)) ? NULL : strdup(str);
-
-               str = (const char *) sqlite3_column_text(stmt, COL_PACKAGE_ID);
-               item->pkg_id = (!str || !strlen(str)) ? NULL : strdup(str);
-
-               str = (const char *) sqlite3_column_text(stmt, COL_LABEL);
-               item->label = (!str) ? NULL : strdup(str);
-
-               str = (const char *)sqlite3_column_text(stmt, COL_ICON);
-               item->icon = (!str || !strlen(str)) ? NULL : strdup(str);
-
-               item->position = sqlite3_column_int(stmt, COL_POSITION);
-               *apps_db_list = eina_list_append(*apps_db_list, item);
-       }
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK) {
-               _APPS_E("sqlite error [%d]", ret);
-               apps_db_close();
-               return false;
-       }
-
-       apps_db_close();
-       return true;
-ERROR:
-       ret = sqlite3_finalize(stmt);
-       if (ret != SQLITE_OK)
-               _APPS_E("sqlite error [%d]", ret);
-       apps_db_close();
-       return false;
-}
-
-static bool _apps_db_open(void)
-{
-       if (!apps_db) {
-               int ret;
-               ret = sqlite3_open(util_get_data_file_path(APPS_DB_NAME), &apps_db);
-               if (ret != SQLITE_OK) {
-                       _APPS_E("sqlite error : [%d] : path [%s]", ret, util_get_data_file_path(APPS_DB_NAME));
-                       return false;
-               }
-       }
-       return true;
-}
index f96ada377f33d03f164b59f6792634855e7990c5..d9d1c7cc2efe4a3cbeea63a2a5f36f261420e108 100755 (executable)
  * limitations under the License.
  */
 
-#include <stdbool.h>
-#include <Ecore.h>
-#include <aul.h>
 #include <gio/gio.h>
-#include <syspopup_caller.h>
-#include <Evas.h>
-#include <dlog.h>
-#include <elm_theme.h>
 
 #include "util.h"
 #include "home_app_manager.h"
index a89e79e10e34c8988de594fc92831863a83a916e..4b7b620e00a246dfad304e2bbcf168780171c621 100755 (executable)
@@ -26,7 +26,6 @@
 #include <vconf.h>
 #include <widget_viewer_evas.h>
 #include <app_control.h>
-#include <circle/efl_extension_rotary.h>
 
 #include "util.h"
 #include "conf.h"
index c35beed36b8b15d97d177bb0f733e0e7891120b8..7d0321050ba6af710eb9a0229c9d7d804c4d2204 100755 (executable)
@@ -21,7 +21,6 @@
 #include <bundle.h>
 #include <dlog.h>
 #include <widget_viewer_evas.h>
-#include <aul.h>
 #include <system_settings.h>
 
 #include "util.h"
index 83440d3423e23b7db049aa0fb50f2157bc850843..198fe5592442ea446c72b4c29550b27d8e63b69b 100755 (executable)
@@ -17,8 +17,6 @@
 
 /* Notification API headers */
 #include <notification.h>
-#include <notification_internal.h>
-#include <notification_text_domain.h>
 #include <Elementary.h>
 #include <Ecore.h>
 #include <glib.h>
index 619e1ba9456e9fac8098bf1c06d311c84e8af770..86baab5c088de3d3d88bb0a739121f7cc546bcdc 100755 (executable)
@@ -17,8 +17,6 @@
 
 /* Notification API headers */
 #include <notification.h>
-#include <notification_internal.h>
-#include <notification_text_domain.h>
 #include <Elementary.h>
 #include <glib.h>
 #include <stdbool.h>
index 172134b076397e7d716762fb0d834e677f0e8216..7ad58ece79c15af600686de6601b1b523b96bd84 100755 (executable)
@@ -15,9 +15,7 @@
  * limitations under the License.
  */
 
-#include <aul.h>
 #include <app.h>
-#include <appsvc.h>
 #include <bundle.h>
 #include <Elementary.h>
 #include <Evas.h>
index 30d011306b7f15f1a4a56f6177926609813aca58..93af334e85fed232fcaca6133ec415609ed0a45a 100755 (executable)
@@ -17,7 +17,6 @@
 
 #include <Elementary.h>
 #include <widget_service.h>
-#include <widget_service_internal.h>
 #include <widget_errno.h>
 #include <stdbool.h>
 #include <dlog.h>
@@ -25,7 +24,6 @@
 #include <widget.h>
 #include <vconf.h>
 #include <app_preference.h>
-//#include <widget_viewer_evas_internal.h> /* feed_access_event */
 #include <widget_viewer_evas.h>
 #include <system_settings.h>
 
index d8c585eb0583d1749b9e53e9e86e21f15293eb86..0100c9499ac6281251d362f30e52579981f81f00 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#include <aul.h>
 #include <Eina.h>
 #include <Evas.h>