4#ifndef __GUI_BACKEND_FILE_MANAGER_H__
5#define __GUI_BACKEND_FILE_MANAGER_H__
12#include "gui/backend/io/file_descriptor.h"
44struct FileBrowserLocation
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,
144 void save_locations ();
std::unique_ptr< FileBrowserLocation > selection
The current selection in the top window.
void remove_location_and_save(const fs::path &location, bool skip_if_standard)
Removes the given location (bookmark) from the saved locations and saves the settings.
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 add_location_and_save(const fs::path &abs_path)
Adds a new location (bookmark) to the saved locations and saves the settings.
std::vector< FileBrowserLocation > locations
The default and user-defined locations (bookmarks).
FileManagerSpecialLocation
Special location type.
FileBrowserSelectionType
Current selection in the top window.
Locations to be used in the file browser.
fs::path path_
Absolute path.
FileManagerSpecialLocation special_location_
Whether this is a standard (undeletable) location.
QString label_
Human readable label.