db-util
com-core
vconf
+ libtzplatform-config
)
FOREACH(flag ${svc_pkgs_CFLAGS})
#include <com-core.h>
#include <com-core_packet.h>
+/* For multi-user support */
+#include <tzplatform_config.h>
+
#include "shortcut.h"
#include "shortcut_internal.h"
.server_fd = -1,
.client_fd = -1,
.socket_file = "/tmp/.shortcut.service",
- .dbfile = "/opt/dbspace/.shortcut_service.db",
+ .dbfile = "",
.handle = NULL,
.initialized = 0,
.db_opened = 0,
{
int ret;
+ s_info.dbfile = tzplatform_mkpath(TZ_SYS_DB, ".shortcut_service.db");
ret = db_util_open(s_info.dbfile, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
if (ret != SQLITE_OK) {
DbgPrint("Failed to open a %s\n", s_info.dbfile);
-Name: libshortcut
-Summary: Shortcut add feature supporting library
-Version: 0.6.11
-Release: 0
-Group: HomeTF/Framework
-License: Apache
-Source0: %{name}-%{version}.tar.gz
+Name: libshortcut
+Summary: Shortcut add feature supporting library
+Version: 0.6.11
+Release: 0
+Group: Graphics & UI Framework/Libraries
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
-Requires(post): /sbin/ldconfig
+Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
+Requires: tizen-platform-config-tools
BuildRequires: cmake, gettext-tools, coreutils
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(com-core)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(libtzplatform-config)
%description
[Shortcut] AddToHome feature supporting library for menu/home screen developers.
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}/opt/dbspace
-touch %{buildroot}/opt/dbspace/.shortcut_service.db
-touch %{buildroot}/opt/dbspace/.shortcut_service.db-journal
+mkdir -p %{buildroot}%{TZ_SYS_DB}
+touch %{buildroot}%{TZ_SYS_DB}/.shortcut_service.db
+touch %{buildroot}%{TZ_SYS_DB}/.shortcut_service.db-journal
-%post
+%post -n libshortcut -p /sbin/ldconfig
-%postun
+%postun -n libshortcut -p /sbin/ldconfig
%files -n libshortcut
%manifest %{name}.manifest
%{_libdir}/*.so*
%{_prefix}/etc/package-manager/parserlib/*
%{_datarootdir}/license/*
-%attr(640,root,app) /opt/dbspace/.shortcut_service.db
-%attr(640,root,app) /opt/dbspace/.shortcut_service.db-journal
+%attr(640,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.shortcut_service.db
+%attr(640,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.shortcut_service.db-journal
%files devel
%manifest %{name}.manifest
sqlite3
libxml-2.0
db-util
+ libtzplatform-config
)
FOREACH(flag ${bin_pkgs_CFLAGS})
#include <libxml/tree.h>
#include <dlog.h>
+/* For multi-user support */
+#include <tzplatform_config.h>
+
#include "dlist.h"
#if !defined(SECURE_LOGD)
const char *dbfile;
sqlite3 *handle;
} s_info = {
- .dbfile = "/opt/dbspace/.shortcut_service.db",
+ .dbfile = "",
.handle = NULL,
};
int ret;
struct stat stat;
+ s_info.dbfile = tzplatform_mkpath(TZ_SYS_DB, ".shortcut_service.db");
ret = db_util_open(s_info.dbfile, &s_info.handle, DB_UTIL_REGISTER_HOOK_METHOD);
if (ret != SQLITE_OK) {
ErrPrint("Failed to open a DB\n");
#include <Elementary.h>
#include <shortcut.h>
+/* For multi-user support */
+#include <tzplatform_config.h>
+
+#define FILE_PNG tzplatform_mkpath(TZ_SYS_SHARE, "image/what.png")
+
static int result_cb(int ret, int pid, void *data)
{
printf("Client: Return %d (%d)\n", ret, pid);
{
int ret;
- ret = add_to_home_shortcut("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", result_cb, NULL);
+ ret = add_to_home_shortcut("pkgname", "MyName", 0, "/usr/bin/true", FILE_PNG, result_cb, NULL);
printf("Client: shortcut_add_to_home returns: %d\n", ret);
- ret = add_to_home_livebox("pkgname", "MyName", 0, "/usr/bin/true", "/opt/share/image/what.png", 1.0f, result_cb, NULL);
+ ret = add_to_home_livebox("pkgname", "MyName", 0, "/usr/bin/true", FILE_PNG, 1.0f, result_cb, NULL);
printf("Client: shortcut_add_to_home_with_period returns: %d\n", ret);
return ECORE_CALLBACK_RENEW;
#include <Elementary.h>
#include <shortcut.h>
+/* For multi-user support */
+#include <tzplatform_config.h>
+
+#define USR_SHARE tzplatform_getenv(TZ_USER_SHARE)
+
static int result_cb(struct shortcut_icon *handle, int ret, void *data)
{
printf("Client: Return %d (%p)\n", ret, handle);
ret = shortcut_icon_request_set_info(handle, NULL, SHORTCUT_ICON_TYPE_TEXT, DEFAULT_NAME_PART, filename, NULL, NULL);
printf("TEXT set_info: %d\n", ret);
- snprintf(filename, sizeof(filename), "/opt/usr/share/live_magazine/always/out%d.png", idx);
+ snprintf(filename, sizeof(filename), "%s/live_magazine/always/out%d.png", USR_SHARE, idx);
switch (idx % 7) {
case 0: type = LIVEBOX_TYPE_1x1; break;
# *
#*/
-DBFILE="/opt/dbspace/.shortcut_service.db"
+eval $(tzplatform-get TZ_SYS_DB)
+DBFILE=$TZ_SYS_DB"/.shortcut_service.db"
APPID=(
"org.tizen.facebook"