change download directory path. 17/61217/1 accepted/tizen/ivi/20160307.105045 accepted/tizen/mobile/20160307.104957 accepted/tizen/tv/20160307.105009 accepted/tizen/wearable/20160307.105028 submit/tizen/20160307.022616
authorHyihong Chae <hh.chae@samsung.com>
Sun, 6 Mar 2016 23:30:49 +0000 (08:30 +0900)
committerHyihong Chae <hh.chae@samsung.com>
Sun, 6 Mar 2016 23:30:49 +0000 (08:30 +0900)
Change-Id: I4e359895e8591318bc4ea22642d8b01bef8144f0
Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
packaging/capi-network-mtp.spec
test/CMakeLists.txt
test/mtp_unit_test.c

index aea3b03..6925585 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-network-mtp
 Summary:    A MTP library in Native API
-Version:    1.3.8
+Version:    1.3.9
 Release:    1
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
@@ -13,6 +13,7 @@ BuildRequires:  pkgconfig(gobject-2.0)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(sqlite3)
+Buildrequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  python
 Buildrequires:  python-xml
 
index 474d37d..a8a99ae 100755 (executable)
@@ -1,7 +1,7 @@
 SET(fw_test "${fw_name}-test")
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED dlog glib-2.0)
+pkg_check_modules(${fw_test} REQUIRED dlog glib-2.0 libtzplatform-config)
 FOREACH(flag ${${fw_test}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
     MESSAGE(${flag})
index 79e6c4b..68b6f2d 100755 (executable)
@@ -4,6 +4,7 @@
 #include <unistd.h>
 #include <glib.h>
 #include <sys/time.h>
+#include <tzplatform_config.h>
 
 #include <mtp.h>
 #include <mtp_internal.h>
@@ -18,6 +19,8 @@
 #define BEGIN() TC_PRT("BEGIN >>>>");
 #define END() TC_PRT("END <<<<");
 
+#define DOWNLOAD_DIR tzplatform_getenv(TZ_USER_DOWNLOADS)
+
 static mtp_device_h mtp_device;
 static mtp_storage_h mtp_storage = 0;
 static mtp_object_h mtp_object = 0;
@@ -350,7 +353,8 @@ int manager_test_get_object(void)
                return -1;
        }
 
-       snprintf(filepath, 100, "/opt/usr/media/Downloads/JpegObject_%d.jpg", input_int);
+       snprintf(filepath, 100, "%s/JpegObject_%d.jpg", DOWNLOAD_DIR, input_int);
+       TC_PRT("filepath[%s]", filepath);
 
        ret = mtp_get_object(mtp_device, input_int, filepath);
        TC_PRT("ret[%d]: input id[%d]", ret, input_int);
@@ -399,7 +403,8 @@ int manager_test_get_thumbnail(void)
                return -1;
        }
 
-       snprintf(filepath, 100, "/opt/usr/media/Downloads/%s_%d.jpg", input_str, input_int);
+       snprintf(filepath, 100, "%s/%s_%d.jpg", DOWNLOAD_DIR, input_str, input_int);
+       TC_PRT("filepath[%s]", filepath);
 
        ret = mtp_get_thumbnail(mtp_device, input_int, filepath);
        TC_PRT("ret[%d]: input jpeg id[%d], input file path[%s]", ret, input_int, filepath);