summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/imageviewer/imageviewer.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index 77286bd37d..3ae4220721 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -136,15 +136,24 @@ static enum image_type image_type = IMAGE_UNKNOWN;
136/************************* Implementation ***************************/ 136/************************* Implementation ***************************/
137 137
138/* Read directory contents for scrolling. */ 138/* Read directory contents for scrolling. */
139static void get_pic_list(void) 139static void get_pic_list(bool single_file)
140{ 140{
141 file_pt = (char **) buf;
142
143 if (single_file)
144 {
145 file_pt[0] = np_file;
146 buf_size -= sizeof(file_pt);
147 entries = 1;
148 curfile = 0;
149 return;
150 }
151
141 struct tree_context *tree = rb->tree_get_context(); 152 struct tree_context *tree = rb->tree_get_context();
142 struct entry *dircache = rb->tree_get_entries(tree); 153 struct entry *dircache = rb->tree_get_entries(tree);
143 int i; 154 int i;
144 char *pname; 155 char *pname;
145 156
146 file_pt = (char **) buf;
147
148 /* Remove path and leave only the name.*/ 157 /* Remove path and leave only the name.*/
149 pname = rb->strrchr(np_file,'/'); 158 pname = rb->strrchr(np_file,'/');
150 pname++; 159 pname++;
@@ -1093,7 +1102,6 @@ enum plugin_status plugin_start(const void* parameter)
1093 return PLUGIN_ERROR; 1102 return PLUGIN_ERROR;
1094 } 1103 }
1095 1104
1096 entries = 1;
1097 is_album_art = true; 1105 is_album_art = true;
1098 } 1106 }
1099 else 1107 else
@@ -1112,11 +1120,7 @@ enum plugin_status plugin_start(const void* parameter)
1112 decoder_buf = rb->plugin_get_buffer(&decoder_buf_size); 1120 decoder_buf = rb->plugin_get_buffer(&decoder_buf_size);
1113 buf = rb->plugin_get_audio_buffer(&buf_size); 1121 buf = rb->plugin_get_audio_buffer(&buf_size);
1114#endif 1122#endif
1115 1123 get_pic_list(is_album_art);
1116 if(!is_album_art)
1117 {
1118 get_pic_list();
1119 }
1120 1124
1121#ifdef USEGSLIB 1125#ifdef USEGSLIB
1122 if (!grey_init(buf, buf_size, GREY_ON_COP, 1126 if (!grey_init(buf, buf_size, GREY_ON_COP,