summaryrefslogtreecommitdiff
path: root/ism
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2020-07-27 14:36:19 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2020-07-30 17:00:03 +0900
commitb5b134980782a4eaf707945ff63d12459764b75d (patch)
tree9d8462002c08a17b9ca336ddcfcfdae22cd69f23 /ism
parentcc796b5193abdb53789f9721a3f3e6b83faa7efa (diff)
downloadisf-b5b134980782a4eaf707945ff63d12459764b75d.tar.gz
isf-b5b134980782a4eaf707945ff63d12459764b75d.tar.bz2
isf-b5b134980782a4eaf707945ff63d12459764b75d.zip
Reduce package dependencies
Change-Id: I1c14e7f5cd38050346d256397157f94a266c53a2 Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
Diffstat (limited to 'ism')
-rw-r--r--ism/extras/efl_panel/Makefile.am2
-rw-r--r--ism/extras/efl_panel/isf_panel_efl.cpp5
-rw-r--r--ism/src/Makefile.am10
-rw-r--r--ism/src/isf_query_utility.cpp31
-rw-r--r--ism/src/isf_query_utility.h3
-rw-r--r--ism/src/scim_module.cpp8
6 files changed, 34 insertions, 25 deletions
diff --git a/ism/extras/efl_panel/Makefile.am b/ism/extras/efl_panel/Makefile.am
index 52f664cd..2287b3f2 100644
--- a/ism/extras/efl_panel/Makefile.am
+++ b/ism/extras/efl_panel/Makefile.am
@@ -55,6 +55,7 @@ isf_panel_efl_CXXFLAGS = @ECOREX_CFLAGS@ \
@XKBCOMMON_CFLAGS@ \
@APP_CONTROL_CFLAGS@ \
@PKGMGR_INFO_CFLAGS@ \
+ @PACKAGE_MANAGER_CFLAGS@ \
@AUL_CFLAGS@ \
-fPIE
@@ -76,6 +77,7 @@ isf_panel_efl_LDFLAGS = @LTLIBINTL@ -rpath $(libdir) \
@XKBCOMMON_LIBS@ \
@APP_CONTROL_LIBS@ \
@PKGMGR_INFO_LIBS@ \
+ @PACKAGE_MANAGER_LIBS@ \
@AUL_LIBS@ \
-pie
diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp
index 1ce3a71c..940ac1b7 100644
--- a/ism/extras/efl_panel/isf_panel_efl.cpp
+++ b/ism/extras/efl_panel/isf_panel_efl.cpp
@@ -37,10 +37,13 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <malloc.h>
+
#include <Eina.h>
#include <Ecore.h>
#include <Ecore_File.h>
-#include <malloc.h>
+#include <tzplatform_config.h>
+
#include "scim_private.h"
#include "scim.h"
#include "scim_stl_map.h"
diff --git a/ism/src/Makefile.am b/ism/src/Makefile.am
index 549650ed..6acf40d3 100644
--- a/ism/src/Makefile.am
+++ b/ism/src/Makefile.am
@@ -117,8 +117,8 @@ libprofile_la_CXXFLAGS = @SYSTEM_INFO_CFLAGS@
libprofile_la_LIBADD = @SYSTEM_INFO_LIBS@
libisf_pkg_la_SOURCES = isf_pkg.cpp
-libisf_pkg_la_CXXFLAGS = @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @PACKAGE_MANAGER_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
-libisf_pkg_la_LIBADD = @DLOG_LIBS@ @PKGMGR_INFO_LIBS@ @PACKAGE_MANAGER_LIBS@ @TZPLATFORM_CONFIG_LIBS@
+libisf_pkg_la_CXXFLAGS = @DLOG_CFLAGS@ @PKGMGR_INFO_CFLAGS@ @TZPLATFORM_CONFIG_CFLAGS@
+libisf_pkg_la_LIBADD = @DLOG_LIBS@ @PKGMGR_INFO_LIBS@ @TZPLATFORM_CONFIG_LIBS@
if SCIM_LD_VERSION_SCRIPT
LD_VERSION_SCRIPT_OPTION="-Wl,--version-script=$(srcdir)/libscim.version-script"
@@ -175,7 +175,7 @@ libscim@SCIM_EPOCH@_la_CXXFLAGS = @EVAS_CFLAGS@ \
@ECORE_IMF_CFLAGS@ \
@ECORE_INPUT_CFLAGS@ \
@DLOG_CFLAGS@ \
- @DB_UTIL_CFLAGS@ \
+ @SQLITE3_CFLAGS@ \
@TZPLATFORM_CONFIG_CFLAGS@ \
@PKGMGR_INFO_CFLAGS@ \
@VCONF_CFLAGS@ \
@@ -192,7 +192,7 @@ libscim@SCIM_EPOCH@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION)
@ECORE_INPUT_LIBS@ \
@EINA_LIBS@ \
@DLOG_LIBS@ \
- @DB_UTIL_LIBS@ \
+ @SQLITE3_LIBS@ \
@TZPLATFORM_CONFIG_LIBS@ \
@PKGMGR_INFO_LIBS@ \
@VCONF_LIBS@ \
@@ -250,7 +250,6 @@ lib@ISF_CONTROL@_la_SOURCES = \
lib@ISF_CONTROL@_la_CXXFLAGS = @EINA_CFLAGS@ \
@DLOG_CFLAGS@ \
- @TZPLATFORM_CONFIG_CFLAGS@ \
@VCONF_CFLAGS@
lib@ISF_CONTROL@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(SCIM_AGE) \
@@ -258,7 +257,6 @@ lib@ISF_CONTROL@_la_LDFLAGS = -version-info $(SCIM_CURRENT):$(SCIM_REVISION):$(
-rpath $(libdir) \
@EINA_LIBS@ \
@DLOG_LIBS@ \
- @TZPLATFORM_CONFIG_LIBS@ \
@VCONF_LIBS@ \
-lstdc++
diff --git a/ism/src/isf_query_utility.cpp b/ism/src/isf_query_utility.cpp
index aa27c535..7720b1e2 100644
--- a/ism/src/isf_query_utility.cpp
+++ b/ism/src/isf_query_utility.cpp
@@ -43,9 +43,7 @@
#include "scim.h"
#include "isf_query_utility.h"
#include "scim_helper.h"
-#include <db-util.h>
-#include "isf_debug.h"
-
+#include <sqlite3.h>
using namespace scim;
@@ -74,7 +72,8 @@ using namespace scim;
///////////////////////////////////////////////////////////////////////////////////////////////////
// DATABASE
///////////////////////////////////////////////////////////////////////////////////////////////////
-#define DB_PATH tzplatform_mkpath(TZ_USER_DB, ".ime_info.db")
+#define USER_DB "/opt/usr/home/owner/.applications/dbspace/"
+#define DB_PATH USER_DB".ime_info.db"
static struct {
const char* pPath;
sqlite3* pHandle;
@@ -225,6 +224,16 @@ static inline int _db_create_table(void)
return ret;
}
+static int _db_open(const char *pszFilePath, sqlite3 **ppDB)
+{
+ int rc = sqlite3_open(pszFilePath, ppDB);
+ if (SQLITE_OK != rc) {
+ return rc;
+ }
+
+ return rc;
+}
+
static inline int _db_init(void)
{
if (!isf_db_check_path_available()) {
@@ -233,11 +242,11 @@ static inline int _db_init(void)
}
struct stat stat;
- int ret = db_util_open(databaseInfo.pPath, &databaseInfo.pHandle, DB_UTIL_REGISTER_HOOK_METHOD);
+ int ret = _db_open(databaseInfo.pPath, &databaseInfo.pHandle);
if (ret != SQLITE_OK) {
LOGE ("db_util_open(\"%s\", ~) returned %d: %s", databaseInfo.pPath, ret, sqlite3_errmsg(databaseInfo.pHandle));
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EIO;
@@ -247,7 +256,7 @@ static inline int _db_init(void)
char buf_err[256];
LOGE("lstat failed. %s", strerror_r (errno, buf_err, sizeof (buf_err)));
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -ENOENT;
@@ -256,7 +265,7 @@ static inline int _db_init(void)
if (!S_ISREG(stat.st_mode)) {
LOGE ("S_ISREG failed.");
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EINVAL;
@@ -266,7 +275,7 @@ static inline int _db_init(void)
if (_db_create_table() != 0) {
LOGE ("CREATE TABLE IF NOT EXISTS ime_info ~ failed.");
if (databaseInfo.pHandle)
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
databaseInfo.need_reset = true;
return -EIO;
@@ -328,7 +337,7 @@ static inline int _db_disconnect(void)
if (!databaseInfo.pHandle)
return 0;
- db_util_close(databaseInfo.pHandle);
+ sqlite3_close(databaseInfo.pHandle);
databaseInfo.pHandle = NULL;
@@ -1808,7 +1817,7 @@ EXAPI int isf_db_rollback_transaction(void)
*/
EXAPI int isf_db_check_path_available(void)
{
- const char *user_db_path = tzplatform_getenv(TZ_USER_DB);
+ const char *user_db_path = USER_DB;
char buf_err[256];
if (access(user_db_path, F_OK) != 0) {
LOGW("access failed : %s, errno(%d) - %s", user_db_path, errno, strerror_r(errno, buf_err, sizeof(buf_err)));
diff --git a/ism/src/isf_query_utility.h b/ism/src/isf_query_utility.h
index 0fd94eef..f2dbc479 100644
--- a/ism/src/isf_query_utility.h
+++ b/ism/src/isf_query_utility.h
@@ -25,9 +25,6 @@
#ifndef __ISF_QUERY_UTILITY_H__
#define __ISF_QUERY_UTILITY_H__
-/* For multi-user support */
-#include <tzplatform_config.h>
-
using namespace scim;
diff --git a/ism/src/scim_module.cpp b/ism/src/scim_module.cpp
index f08a4242..3a74bcff 100644
--- a/ism/src/scim_module.cpp
+++ b/ism/src/scim_module.cpp
@@ -310,7 +310,7 @@ Module::load (const String &name, const String &type)
bool
Module::unload ()
{
- if (!m_impl->handle)
+ if (!m_impl || !m_impl->handle)
return true;
if (is_resident ())
@@ -340,7 +340,7 @@ Module::unload ()
bool
Module::make_resident () const
{
- if (m_impl->handle) {
+ if (m_impl && m_impl->handle) {
return lt_dlmakeresident (m_impl->handle) == 0;
}
return false;
@@ -349,7 +349,7 @@ Module::make_resident () const
bool
Module::is_resident () const
{
- if (m_impl->handle) {
+ if (m_impl && m_impl->handle) {
return lt_dlisresident (m_impl->handle) == 1;
}
return false;
@@ -358,7 +358,7 @@ Module::is_resident () const
bool
Module::valid () const
{
- return (m_impl->handle && m_impl->init);
+ return (m_impl && m_impl->handle && m_impl->init);
}
String