Add define for trash folder checking 76/240376/1
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 6 Aug 2020 01:59:09 +0000 (10:59 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 6 Aug 2020 01:59:09 +0000 (10:59 +0900)
Change-Id: Ibce480417a314bbc774447e64f3f7007b88ffd79
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/scanner-v2/media-scanner-scan-v2.c

index 8104cee..fe271fe 100644 (file)
 
 #define DIR_SCAN_NON_SCAN              0
 #define DIR_SCAN_RECURSIVE             1
-#define DIR_SCAN_NON_RECURSIVE 2
+#define DIR_SCAN_NON_RECURSIVE 2
+
+#define RECYCLE_DIR_NAME       "$RECYCLE.BIN"
+
 
 GAsyncQueue *storage_queue2;
 static GAsyncQueue *scan_queue2;
@@ -239,8 +242,6 @@ static int __msc_dir_scan_for_folder(sqlite3 *handle, const char *storage_id, ch
        int scan_count = 0;
        int sleep_count = 0;
 
-       const char *trash = "$RECYCLE.BIN";
-
 
        MS_DBG_SWARN("storage id [%s] start path [%s]", storage_id, start_path);
 
@@ -382,7 +383,7 @@ static int __msc_dir_scan_for_folder(sqlite3 *handle, const char *storage_id, ch
                                        continue;
                                }
 
-                               if (strcmp(d->d_name, trash) == 0) {
+                               if (strcmp(d->d_name, RECYCLE_DIR_NAME) == 0) {
                                        MS_DBG_ERR("trash directory");
                                        bpos += d->d_reclen;
                                        continue;
@@ -514,8 +515,6 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
        int scan_count = 0;
        int sleep_count = 0;
 
-       const char *trash = "$RECYCLE.BIN";
-
        bool is_missing = false;
        ms_dir_scan_status_e scan_status = MS_DIR_SCAN_NONE;
 
@@ -646,7 +645,7 @@ static int __msc_dir_scan_for_storage(sqlite3 *handle, const char *storage_id, c
                                        continue;
                                }
 
-                               if (strcmp(d->d_name, trash) == 0) {
+                               if (strcmp(d->d_name, RECYCLE_DIR_NAME) == 0) {
                                        MS_DBG_ERR("trash directory");
                                        bpos += d->d_reclen;
                                        continue;