Index: apps/plugins/disktidy.c =================================================================== --- apps/plugins/disktidy.c (revision 16276) +++ apps/plugins/disktidy.c (working copy) @@ -35,7 +35,8 @@ { TIDY_MAC = 0, TIDY_WIN = 1, - TIDY_BOTH = 2, + TIDY_NIX = 2, + TIDY_ALL = 3, }; /* variable button definitions */ @@ -222,7 +223,7 @@ /* check if we are in root directory "/" */ if (rb->strcmp(name, "/") == 0) { - if ((system == TIDY_MAC) || (system == TIDY_BOTH)) + if ((system == TIDY_MAC) || (system == TIDY_ALL)) { /* mac directories */ if (rb->strcmp(entry->d_name, ".Trashes") == 0) @@ -235,7 +236,7 @@ if (del == 0) { - if ((system == TIDY_WIN) || (system == TIDY_BOTH)) + if ((system == TIDY_WIN) || (system == TIDY_ALL)) { /* windows directories */ if (rb->strcmp(entry->d_name, "Recycled") == 0 \ @@ -261,7 +262,7 @@ /* file */ del = 0; - if ((system == TIDY_MAC) || (system == TIDY_BOTH)) + if ((system == TIDY_MAC) || (system == TIDY_ALL)) { /* remove mac files */ if ((rb->strcmp(entry->d_name, ".DS_Store") == 0) || \ @@ -281,7 +282,7 @@ if (del == 0) { - if ((system == TIDY_WIN) || (system == TIDY_BOTH)) + if ((system == TIDY_WIN) || (system == TIDY_ALL)) { /* remove windows files*/ if ((rb->strcmp(entry->d_name, "Thumbs.db") == 0)) @@ -298,6 +299,25 @@ } } } + + if (del == 0) + { + if ((system == TIDY_NIX) || (system == TIDY_ALL)) + { + /* remove linux files*/ + if ((rb->strcmp(entry->d_name, ".dolphinview") == 0)) { + *removed +=1; /* increment removed files counter */ + + /* get absolute path */ + char fullname[MAX_PATH]; + tidy_get_absolute_path(entry, fullname, name); + + /* delete file */ + rb->remove(fullname); + del = 1; + } + } + } } } rb->closedir(dir); @@ -342,17 +362,18 @@ int tidy_lcd_menu(void) { - int selection, ret = 2; + int selection, ret = 3; bool menu_quit = false; MENUITEM_STRINGLIST(menu,"Disktidy Menu",NULL,"Start Cleaning", "Files to Clean","Quit"); - static const struct opt_items system_option[3] = + static const struct opt_items system_option[] = { { "Mac", -1 }, { "Windows", -1 }, - { "Both", -1 } + { "Linux", -1}, + { "All", -1 } }; while (!menu_quit) @@ -380,7 +401,7 @@ /* this is the plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { - enum tidy_system system = TIDY_BOTH; + enum tidy_system system = TIDY_ALL; enum tidy_return status; (void)parameter; @@ -396,12 +417,15 @@ system = TIDY_WIN; break; case 2: - system = TIDY_BOTH; + system = TIDY_NIX; break; + case 3: + system = TIDY_ALL; + break; case 99: return PLUGIN_OK; default: - system = TIDY_BOTH; + system = TIDY_ALL; } while (true)