feat: architectural improvements for Apps and System Configuration virtual folders in Files

This commit is contained in:
2026-04-30 16:51:08 +02:00
parent b4be0fcc0f
commit f66c9bf1f7
15 changed files with 231 additions and 206 deletions
@@ -21,20 +21,19 @@ enum FileManagerEntryType : int {
FM_ENTRY_APPS_ROOT = 5,
FM_ENTRY_VIRTUAL_APP = 6,
FM_ENTRY_SPECIAL_DIR = 7,
FM_ENTRY_SYSTEM_TOOLS_ROOT = 8,
FM_ENTRY_SYSTEM_CONFIGURATION_ROOT = 8,
};
enum FileManagerVirtualViewKind : uint8_t {
FM_VIRTUAL_VIEW_NONE = 0,
FM_VIRTUAL_VIEW_APPS,
FM_VIRTUAL_VIEW_SYSTEM_TOOLS,
FM_VIRTUAL_VIEW_SYSTEM_CONFIGURATION,
};
enum FileManagerVirtualEntryKind : uint8_t {
FM_VIRTUAL_ENTRY_NONE = 0,
FM_VIRTUAL_ENTRY_EXTERNAL_APP,
FM_VIRTUAL_ENTRY_BUILTIN,
FM_VIRTUAL_ENTRY_SHARED_APPLET,
FM_VIRTUAL_ENTRY_SYSTEM_CONFIGURATION_APPLET,
};
struct FileManagerLocation {
@@ -45,8 +44,7 @@ struct FileManagerLocation {
struct FileManagerVirtualEntry {
FileManagerVirtualEntryKind kind;
int external_app_index;
DesktopBuiltinId builtin_id;
char shared_applet_path[128];
DesktopAppletEntry applet;
SvgIcon icon_lg;
SvgIcon icon_sm;
};
@@ -147,7 +145,7 @@ inline bool filemanager_is_computer_view(const FileManagerState* fm) {
inline const char* filemanager_virtual_view_label(FileManagerVirtualViewKind view) {
switch (view) {
case FM_VIRTUAL_VIEW_APPS: return "Apps";
case FM_VIRTUAL_VIEW_SYSTEM_TOOLS: return "System Configuration";
case FM_VIRTUAL_VIEW_SYSTEM_CONFIGURATION: return "System Configuration";
default: return "Computer";
}
}
@@ -173,7 +171,7 @@ void filemanager_read_dir(FileManagerState* fm);
void filemanager_free_app_icons(FileManagerState* fm);
void filemanager_read_virtual_view(FileManagerState* fm, FileManagerVirtualViewKind view);
void filemanager_read_apps(FileManagerState* fm);
void filemanager_read_system_tools(FileManagerState* fm);
void filemanager_read_system_configuration(FileManagerState* fm);
bool filemanager_delete_recursive(const char* path);
bool filemanager_copy_file(const char* src, const char* dst);