summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJehun Lim <jehun.lim@samsung.com>2015-12-08 12:37:29 (GMT)
committerJehun Lim <jehun.lim@samsung.com>2015-12-08 12:37:57 (GMT)
commit1a5a0f308ea0bf0946c1c9c5085dc4905f55646d (patch)
treebac19e7b62651c93ee0fe8569970af0df59e90a6
parente1c60d3dc757368e5d34cd66857e1366520f69bb (diff)
downloadair_mediahub-1a5a0f308ea0bf0946c1c9c5085dc4905f55646d.zip
air_mediahub-1a5a0f308ea0bf0946c1c9c5085dc4905f55646d.tar.gz
air_mediahub-1a5a0f308ea0bf0946c1c9c5085dc4905f55646d.tar.bz2
datamgr: add source type for all devicesrefs/changes/60/53660/1
Change-Id: I5fc03e1239373dd7eca05d7d5b4ab2a73c6b8fb2 Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
-rw-r--r--include/data/datamgr.h3
-rw-r--r--src/data/albumdata.c16
-rw-r--r--src/data/folderdata.c16
-rw-r--r--src/data/mediadata.c12
-rw-r--r--src/layout/gallery.c2
-rw-r--r--src/layout/movie.c2
-rw-r--r--src/layout/music.c2
-rw-r--r--src/view/base.c2
-rw-r--r--src/view/detail.c3
9 files changed, 42 insertions, 16 deletions
diff --git a/include/data/datamgr.h b/include/data/datamgr.h
index 682eb77..3399381 100644
--- a/include/data/datamgr.h
+++ b/include/data/datamgr.h
@@ -34,7 +34,8 @@ enum data_type {
enum source_type {
E_SOURCE_INTERNAL = MEDIA_CONTENT_STORAGE_INTERNAL,
- E_SOURCE_EXTERNAL = MEDIA_CONTENT_STORAGE_EXTERNAL_USB
+ E_SOURCE_EXTERNAL = MEDIA_CONTENT_STORAGE_EXTERNAL_USB,
+ E_SOURCE_ALL
};
struct data_ops {
diff --git a/src/data/albumdata.c b/src/data/albumdata.c
index 8a6acc8..a2448ea 100644
--- a/src/data/albumdata.c
+++ b/src/data/albumdata.c
@@ -91,16 +91,24 @@ static bool _create_filter(struct albumdata *ad, filter_h *filter,
return false;
}
- snprintf(buf, sizeof(buf), "%s AND MEDIA_STORAGE_TYPE=%d",
- ad->media_type, ad->source_type);
+ snprintf(buf, sizeof(buf), "%s", ad->media_type);
- if (cond) {
+ if (ad->source_type != E_SOURCE_ALL) {
char s1[64];
- snprintf(s1, sizeof(s1), " AND %s", cond);
+ snprintf(s1, sizeof(s1), " AND MEDIA_STORAGE_TYPE=%d",
+ ad->source_type);
+
strncat(buf, s1, strlen(s1));
}
+ if (cond) {
+ char s2[64];
+
+ snprintf(s2, sizeof(s2), " AND %s", cond);
+ strncat(buf, s2, strlen(s2));
+ }
+
media_filter_set_condition(tmp_filter, buf,
MEDIA_CONTENT_COLLATE_DEFAULT);
diff --git a/src/data/folderdata.c b/src/data/folderdata.c
index 2335653..d956e59 100644
--- a/src/data/folderdata.c
+++ b/src/data/folderdata.c
@@ -88,16 +88,24 @@ static bool _create_filter(struct folderdata *fd, filter_h *filter,
media_filter_set_order(tmp_filter, MEDIA_CONTENT_ORDER_ASC,
FOLDER_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
} else {
- snprintf(buf, sizeof(buf), "%s AND MEDIA_STORAGE_TYPE=%d",
- fd->media_type, fd->source_type);
+ snprintf(buf, sizeof(buf), "%s", fd->media_type);
- if (cond) {
+ if (fd->source_type != E_SOURCE_ALL) {
char s1[256];
- snprintf(s1, sizeof(s1), " AND %s", cond);
+ snprintf(s1, sizeof(s1), " AND MEDIA_STORAGE_TYPE=%d",
+ fd->source_type);
+
strncat(buf, s1, strlen(s1));
}
+ if (cond) {
+ char s2[256];
+
+ snprintf(s2, sizeof(s2), " AND %s", cond);
+ strncat(buf, s2, strlen(s2));
+ }
+
media_filter_set_order(tmp_filter, MEDIA_CONTENT_ORDER_ASC,
MEDIA_TITLE,
MEDIA_CONTENT_COLLATE_DEFAULT);
diff --git a/src/data/mediadata.c b/src/data/mediadata.c
index b46a16c..39f3638 100644
--- a/src/data/mediadata.c
+++ b/src/data/mediadata.c
@@ -113,8 +113,16 @@ static bool _create_filter(struct mediadata *md, filter_h *filter)
return false;
}
- snprintf(buf, sizeof(buf), "%s AND MEDIA_STORAGE_TYPE=%d",
- md->media_type, md->source_type);
+ snprintf(buf, sizeof(buf), "%s", md->media_type);
+
+ if (md->source_type != E_SOURCE_ALL) {
+ char s[64];
+
+ snprintf(s, sizeof(s), " AND MEDIA_STORAGE_TYPE=%d",
+ md->source_type);
+
+ strncat(buf, s, strlen(s));
+ }
media_filter_set_condition(tmp_filter, buf,
MEDIA_CONTENT_COLLATE_DEFAULT);
diff --git a/src/layout/gallery.c b/src/layout/gallery.c
index 7ba53eb..1a77bac 100644
--- a/src/layout/gallery.c
+++ b/src/layout/gallery.c
@@ -224,7 +224,7 @@ static bool _create_utils(struct _priv *priv)
int i;
for (i = 0; i < E_DATA_MAX; i++) {
- dmgr = datamgr_create(i, GALLERY_MEDIA_COND, E_SOURCE_INTERNAL);
+ dmgr = datamgr_create(i, GALLERY_MEDIA_COND, E_SOURCE_ALL);
if (!dmgr) {
_ERR("failed to create datamgr");
_destroy_datamgr(priv);
diff --git a/src/layout/movie.c b/src/layout/movie.c
index 292bef6..1dbefbd 100644
--- a/src/layout/movie.c
+++ b/src/layout/movie.c
@@ -492,7 +492,7 @@ static bool _create_utils(struct _priv *priv)
int i;
for (i = 0; i < E_DATA_MAX; i++) {
- dmgr = datamgr_create(i, MOVIE_MEDIA_COND, E_SOURCE_INTERNAL);
+ dmgr = datamgr_create(i, MOVIE_MEDIA_COND, E_SOURCE_ALL);
if (!dmgr) {
_ERR("failed to create datamgr");
_destroy_datamgr(priv);
diff --git a/src/layout/music.c b/src/layout/music.c
index 6a6b8aa..060f688 100644
--- a/src/layout/music.c
+++ b/src/layout/music.c
@@ -458,7 +458,7 @@ static bool _create_utils(struct _priv *priv)
int i;
for (i = 0; i < E_DATA_MAX; i++) {
- dmgr = datamgr_create(i, MUSIC_MEDIA_COND, E_SOURCE_INTERNAL);
+ dmgr = datamgr_create(i, MUSIC_MEDIA_COND, E_SOURCE_ALL);
if (!dmgr) {
_ERR("failed to create datamgr");
_destroy_datamgr(priv);
diff --git a/src/view/base.c b/src/view/base.c
index 965bb98..38db48c 100644
--- a/src/view/base.c
+++ b/src/view/base.c
@@ -102,11 +102,13 @@ const char *view_mode_music[] = {
};
const char *source[] = {
+ "ALL",
"TV",
"USB",
};
static int source_type[] = {
+ E_SOURCE_ALL,
E_SOURCE_INTERNAL,
E_SOURCE_EXTERNAL
};
diff --git a/src/view/detail.c b/src/view/detail.c
index 62547db..851450f 100644
--- a/src/view/detail.c
+++ b/src/view/detail.c
@@ -985,8 +985,7 @@ static Evas_Object *_create(Evas_Object *win, void *data)
EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, base);
- dmgr = datamgr_create(E_DATA_ALBUM, MUSIC_MEDIA_COND,
- E_SOURCE_INTERNAL);
+ dmgr = datamgr_create(E_DATA_ALBUM, MUSIC_MEDIA_COND, E_SOURCE_ALL);
if (!dmgr) {
_ERR("failed to create datamgr");
free(priv);