rename first before db
authorJisung Ahn <jcastle.ahn@samsung.com>
Thu, 31 Jan 2013 06:19:14 +0000 (15:19 +0900)
committerJisung Ahn <jcastle.ahn@samsung.com>
Thu, 31 Jan 2013 06:23:25 +0000 (15:23 +0900)
Change-Id: I247da4b41d31d2a35ea946949be0a1a6b94e01ed

main/src/view/ivug-main-view-menu.cpp

index e38600a..e6dbb5e 100755 (executable)
@@ -1028,14 +1028,19 @@ static bool _rename(Media_Data *mdata, const char *str)
                snprintf(new_fullpath, sizeof(new_fullpath),"%s/%s", old_dir, str);
        }
 
+       bool ret = ivug_rename_file(old_fullpath, new_fullpath);
+       if(ret == false)
+       {
+               MSG_MAIN_ERROR("ivug_rename_file to %s failed", new_fullpath);
+               return false;
+       }
+
        if(ivug_db_rename(mdata->m_handle, new_fullpath) == false)
        {
                MSG_MAIN_ERROR("ivug_db_rename to %s failed", new_fullpath);
                return false;
        }
 
-       ivug_rename_file(old_fullpath, new_fullpath);
-
        ivug_db_destroy_file_handle(mdata->m_handle);
        mdata->m_handle = ivug_db_get_file_handle_from_media_id(mdata->mediaID);