4#ifndef __GUI_BACKEND_FILE_MANAGER_H__
5#define __GUI_BACKEND_FILE_MANAGER_H__
11#include "gui/backend/io/file_descriptor.h"
12#include "utils/app_settings.h"
44struct FileBrowserLocation
48 std::filesystem::path path,
50 :
label_ (std::move (label)),
path_ (std::move (path)),
54 FileBrowserLocation () =
default;
56 const char * get_icon_name ()
const
60 case FileManagerSpecialLocation::FILE_MANAGER_NONE:
62 case FileManagerSpecialLocation::FILE_MANAGER_HOME:
64 case FileManagerSpecialLocation::FILE_MANAGER_DESKTOP:
66 case FileManagerSpecialLocation::FILE_MANAGER_DRIVE:
67 return "drive-harddisk-symbolic";
91 FB_SELECTION_TYPE_COLLECTIONS,
92 FB_SELECTION_TYPE_LOCATIONS,
103 FileManager (utils::AppSettings &app_settings);
138 const std::filesystem::path &location,
139 bool skip_if_standard);
145 void save_locations ();
174 utils::AppSettings &app_settings_;
std::unique_ptr< FileBrowserLocation > selection
The current selection in the top window.
void set_selection(FileBrowserLocation &sel, bool load_files, bool save_to_settings)
Sets the current selection and optionally loads the files and saves the location to the settings.
std::vector< FileDescriptor > files
The file descriptors for the files under the current collection/location.
void load_files()
Loads the files under the current selection.
void remove_location_and_save(const std::filesystem::path &location, bool skip_if_standard)
Removes the given location (bookmark) from the saved locations and saves the settings.
std::vector< FileBrowserLocation > locations
The default and user-defined locations (bookmarks).
void add_location_and_save(const std::filesystem::path &abs_path)
Adds a new location (bookmark) to the saved locations and saves the settings.
FileManagerSpecialLocation
Special location type.
FileBrowserSelectionType
Current selection in the top window.
Locations to be used in the file browser.
FileManagerSpecialLocation special_location_
Whether this is a standard (undeletable) location.
QString label_
Human readable label.
std::filesystem::path path_
Absolute path.