diff options
Diffstat (limited to 'apps/plugins/properties.c')
-rw-r--r-- | apps/plugins/properties.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index 27805154b3..05d05a746b 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | PLUGIN_HEADER | 21 | PLUGIN_HEADER |
22 | 22 | ||
23 | static struct plugin_api* rb; | 23 | static const struct plugin_api* rb; |
24 | 24 | ||
25 | MEM_FUNCTION_WRAPPERS(rb); | 25 | MEM_FUNCTION_WRAPPERS(rb); |
26 | 26 | ||
@@ -252,21 +252,23 @@ char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len) | |||
252 | return buffer; | 252 | return buffer; |
253 | } | 253 | } |
254 | 254 | ||
255 | enum plugin_status plugin_start(struct plugin_api* api, void* file) | 255 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) |
256 | { | 256 | { |
257 | rb = api; | 257 | rb = api; |
258 | struct gui_synclist properties_lists; | 258 | struct gui_synclist properties_lists; |
259 | int button; | 259 | int button; |
260 | bool prev_show_statusbar; | 260 | bool prev_show_statusbar; |
261 | bool quit = false; | 261 | bool quit = false; |
262 | char file[MAX_PATH]; | ||
263 | rb->strcpy(file, (const char *) parameter); | ||
262 | 264 | ||
263 | /* determine if it's a file or a directory */ | 265 | /* determine if it's a file or a directory */ |
264 | bool found = false; | 266 | bool found = false; |
265 | DIR* dir; | 267 | DIR* dir; |
266 | struct dirent* entry; | 268 | struct dirent* entry; |
267 | char* ptr = rb->strrchr((char*)file, '/') + 1; | 269 | char* ptr = rb->strrchr(file, '/') + 1; |
268 | int dirlen = (ptr - (char*)file); | 270 | int dirlen = (ptr - file); |
269 | rb->strncpy(str_dirname, (char*)file, dirlen); | 271 | rb->strncpy(str_dirname, file, dirlen); |
270 | str_dirname[dirlen] = 0; | 272 | str_dirname[dirlen] = 0; |
271 | 273 | ||
272 | dir = rb->opendir(str_dirname); | 274 | dir = rb->opendir(str_dirname); |
@@ -288,13 +290,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
288 | if(!found) | 290 | if(!found) |
289 | { | 291 | { |
290 | /* weird: we couldn't find the entry. This Should Never Happen (TM) */ | 292 | /* weird: we couldn't find the entry. This Should Never Happen (TM) */ |
291 | rb->splash(0, "File/Dir not found: %s", (char*)file); | 293 | rb->splash(0, "File/Dir not found: %s", file); |
292 | rb->action_userabort(TIMEOUT_BLOCK); | 294 | rb->action_userabort(TIMEOUT_BLOCK); |
293 | return PLUGIN_OK; | 295 | return PLUGIN_OK; |
294 | } | 296 | } |
295 | 297 | ||
296 | /* get the info depending on its_a_dir */ | 298 | /* get the info depending on its_a_dir */ |
297 | if(!(its_a_dir ? dir_properties((char*)file):file_properties((char*)file))) | 299 | if(!(its_a_dir ? dir_properties(file) : file_properties(file))) |
298 | { | 300 | { |
299 | /* something went wrong (to do: tell user what it was (nesting,...) */ | 301 | /* something went wrong (to do: tell user what it was (nesting,...) */ |
300 | rb->splash(0, "Failed to gather information"); | 302 | rb->splash(0, "Failed to gather information"); |