/* Get all contents(including local and cloud) for albums list */
g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH);
filter.sort_type = MEDIA_CONTENT_ORDER_ASC;
- g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH);
+ if (ad->maininfo.reorder) {
+ g_strlcpy(filter.sort_keyword, FOLDER_ORDER, KEYWORD_LENGTH);
+ } else {
+ g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH);
+ }
filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE;
filter.offset = GL_GET_ALL_RECORDS;
filter.count = GL_GET_ALL_RECORDS;
gl_sdbg("folder id: %s.", f_data->uuid);
/**
- * There are Phone and web filters in libmedia-info,
- * but the are seperated, if we want to get phone and web photos
- * only we can use is WMINFO_CLUSTER_TYPE_ALL,
- * and add condition checking to skip MMC albums.
- *
- * To skip MMC albums if MMC already unmounted,
- * in case of delay updating in DB.
- */
+ * There are Phone and web filters in libmedia-info,
+ * but the are seperated, if we want to get phone and web photos
+ * only we can use is WMINFO_CLUSTER_TYPE_ALL,
+ * and add condition checking to skip MMC albums.
+ *
+ * To skip MMC albums if MMC already unmounted,
+ * in case of delay updating in DB.
+ */
if ((ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED_MOVING ||
- ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED) &&
- f_data->type == GL_STORE_T_MMC) {
+ ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED) &&
+ f_data->type == GL_STORE_T_MMC) {
gl_dbgW("MMC was unmounted, skip MMC album!");
_gl_data_type_free_glitem((void **) &f_data);
continue;
}
if (f_data->type == GL_STORE_T_PHONE ||
- f_data->type == GL_STORE_T_MMC) {
+ f_data->type == GL_STORE_T_MMC) {
if (f_data->count == 0) {
if (!g_strcmp0(f_data->uuid, new_mc_id)) {
/* append the newly created cluster to list */
}
all_item_cnt += f_data->count;
if (f_data->type == GL_STORE_T_PHONE ||
- f_data->type == GL_STORE_T_MMC) {
+ f_data->type == GL_STORE_T_MMC) {
phone_cnt++;
}
}
gcluster->cluster = f_data;
length += f_data->count;
-
- if (_gl_data_is_camera_album(f_data)) {
- /**
- * Default album: Camera
- * Now Camera Shot is located in Phone/MMC.
- * If user can determine the location of default album,
- * here we should get the path and check it's in Phone or MMC.
- */
- if (default_album) {
- /* album 'Camera' is in phone, set it before MMC album 'Camera' */
- char *phone_root_path =
- _gl_get_root_directory_path(STORAGE_TYPE_INTERNAL);
- if (phone_root_path
- && _gl_data_check_root_type(f_data->path,
- phone_root_path)) {
+ if (ad->maininfo.reorder) {
+ ad->albuminfo.elist->clist =
+ eina_list_append(ad->albuminfo.elist->clist, gcluster);
+ } else {
+ if (_gl_data_is_camera_album(f_data)) {
+ /**
+ * Default album: Camera
+ * Now Camera Shot is located in Phone/MMC.
+ * If user can determine the location of default album,
+ * here we should get the path and check it's in Phone or MMC.
+ */
+ if (default_album) {
+ /* album 'Camera' is in phone, set it before MMC album 'Camera' */
+ char *phone_root_path =
+ _gl_get_root_directory_path(STORAGE_TYPE_INTERNAL);
+ if (phone_root_path
+ && _gl_data_check_root_type(f_data->path,
+ phone_root_path)) {
+ ad->albuminfo.elist->clist =
+ eina_list_prepend(ad->albuminfo.elist->clist,
+ gcluster);
+ } else {
+ ad->albuminfo.elist->clist =
+ eina_list_append_relative(ad->albuminfo.elist->
+ clist, gcluster,
+ default_album);
+ default_album = gcluster;
+ }
+ GL_FREEIF(phone_root_path);
+ } else {
ad->albuminfo.elist->clist =
- eina_list_prepend(ad->albuminfo.elist->clist,
- gcluster);
+ eina_list_prepend(ad->albuminfo.elist->clist,
+ gcluster);
+ }
+ } else
+ if (_gl_data_is_default_album(GL_STR_ALBUM_DOWNLOADS, f_data)
+ || _gl_data_is_screenshot_album(GL_STR_ALBUM_SCREENSHOTS,
+ f_data)) {
+ if (default_album)
+ ad->albuminfo.elist->clist =
+ eina_list_append_relative(ad->albuminfo.elist->clist,
+ gcluster, default_album);
+ else
+ ad->albuminfo.elist->clist =
+ eina_list_prepend(ad->albuminfo.elist->clist,
+ gcluster);
} else {
ad->albuminfo.elist->clist =
- eina_list_append_relative(ad->albuminfo.elist->
- clist, gcluster,
- default_album);
- default_album = gcluster;
+ eina_list_append(ad->albuminfo.elist->clist, gcluster);
}
- GL_FREEIF(phone_root_path);
- } else {
- default_album = gcluster;
- ad->albuminfo.elist->clist =
- eina_list_prepend(ad->albuminfo.elist->clist,
- gcluster);
- }
- } else
- if (_gl_data_is_default_album(GL_STR_ALBUM_DOWNLOADS, f_data)
- || _gl_data_is_screenshot_album(GL_STR_ALBUM_SCREENSHOTS,
- f_data)) {
- if (default_album)
- ad->albuminfo.elist->clist =
- eina_list_append_relative(ad->albuminfo.elist->clist,
- gcluster, default_album);
- else
- ad->albuminfo.elist->clist =
- eina_list_prepend(ad->albuminfo.elist->clist,
- gcluster);
- } else {
- ad->albuminfo.elist->clist =
- eina_list_append(ad->albuminfo.elist->clist, gcluster);
}
/* Default album 'Camera shots' showed in edit view */
edit_album_cnt++;
if (sel_id_list) {
b_selected = _gl_data_util_check_selected_str_id(&sel_id_list,
- f_data->uuid);
+ f_data->uuid);
if (b_selected) {
b_selected = false;
/* Set checkbox state */
/* Append gcluster to selected list */
_gl_data_albums_selected_list_append(ad, gcluster);
}
-
- if (default_album) {
+ if (ad->maininfo.reorder) {
ad->albuminfo.elist->clist =
- eina_list_append_relative(ad->albuminfo.elist->clist,
- gcluster, default_album);
+ eina_list_prepend(ad->albuminfo.elist->clist, gcluster);
} else {
- ad->albuminfo.elist->clist =
- eina_list_prepend(ad->albuminfo.elist->clist, gcluster);
+ if (default_album) {
+ ad->albuminfo.elist->clist =
+ eina_list_append_relative(ad->albuminfo.elist->clist,
+ gcluster, default_album);
+ } else {
+ ad->albuminfo.elist->clist =
+ eina_list_prepend(ad->albuminfo.elist->clist, gcluster);
+ }
+ default_album = gcluster;
}
- default_album = gcluster;
}
if (all_item_cnt) {