diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /editor/filesystem_dock.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'editor/filesystem_dock.h')
-rw-r--r-- | editor/filesystem_dock.h | 72 |
1 files changed, 31 insertions, 41 deletions
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 916321d8fd..1a4b5ae977 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -29,36 +29,36 @@ #ifndef FILESYSTEM_DOCK_H #define FILESYSTEM_DOCK_H -#include "scene/main/timer.h" +#include "scene/gui/box_container.h" #include "scene/gui/control.h" -#include "scene/gui/tree.h" +#include "scene/gui/item_list.h" #include "scene/gui/label.h" -#include "scene/gui/tool_button.h" -#include "scene/gui/option_button.h" -#include "scene/gui/box_container.h" #include "scene/gui/menu_button.h" -#include "scene/gui/item_list.h" +#include "scene/gui/option_button.h" #include "scene/gui/progress_bar.h" #include "scene/gui/split_container.h" +#include "scene/gui/tool_button.h" +#include "scene/gui/tree.h" +#include "scene/main/timer.h" #include "os/dir_access.h" #include "os/thread.h" -#include "editor_file_system.h" -#include "editor_dir_dialog.h" #include "dependency_editor.h" +#include "editor_dir_dialog.h" +#include "editor_file_system.h" class EditorNode; - class FileSystemDock : public VBoxContainer { - GDCLASS( FileSystemDock, VBoxContainer ); + GDCLASS(FileSystemDock, VBoxContainer); public: enum DisplayMode { DISPLAY_THUMBNAILS, DISPLAY_LIST }; + private: enum FileMenu { FILE_OPEN, @@ -78,7 +78,6 @@ private: FOLDER_COLLAPSE_ALL }; - VBoxContainer *scanning_vb; ProgressBar *scanning_progress; VSplitContainer *split_box; @@ -114,7 +113,6 @@ private: Vector<String> move_dirs; Vector<String> move_files; - Vector<String> history; int history_pos; @@ -123,26 +121,23 @@ private: bool initialized; bool updating_tree; - Tree * tree; //directories + Tree *tree; //directories ItemList *files; - void _file_multi_selected(int p_index, bool p_selected); void _file_selected(); - void _go_to_tree(); - void _go_to_dir(const String& p_dir); + void _go_to_dir(const String &p_dir); void _select_file(int p_idx); - bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir); - void _thumbnail_done(const String& p_path,const Ref<Texture>& p_preview, const Variant& p_udata); - void _find_inside_move_files(EditorFileSystemDirectory *efsd,Vector<String>& files); - void _find_remaps(EditorFileSystemDirectory *efsd,Map<String,String> &renames,List<String>& to_remaps); - - void _rename_operation(const String& p_to_path); - void _move_operation(const String& p_to_path); + bool _create_tree(TreeItem *p_parent, EditorFileSystemDirectory *p_dir); + void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata); + void _find_inside_move_files(EditorFileSystemDirectory *efsd, Vector<String> &files); + void _find_remaps(EditorFileSystemDirectory *efsd, Map<String, String> &renames, List<String> &to_remaps); + void _rename_operation(const String &p_to_path); + void _move_operation(const String &p_to_path); void _file_option(int p_option); void _folder_option(int p_option); @@ -154,21 +149,17 @@ private: void _bw_history(); void _push_to_history(); - void _dir_selected(); void _update_tree(); void _rescan(); void _set_scanning_mode(); - void _favorites_pressed(); void _open_pressed(); - void _dir_rmb_pressed(const Vector2& local_mouse_pos); - void _search_changed(const String& p_text); - - - void _files_list_rmb_select(int p_item,const Vector2& p_pos); + void _dir_rmb_pressed(const Vector2 &local_mouse_pos); + void _search_changed(const String &p_text); + void _files_list_rmb_select(int p_item, const Vector2 &p_pos); struct FileInfo { String name; @@ -177,41 +168,40 @@ private: int import_status; //0 not imported, 1 - ok, 2- must reimport, 3- broken Vector<String> sources; - bool operator<(const FileInfo& fi) const { + bool operator<(const FileInfo &fi) const { return name < fi.name; } }; - void _search(EditorFileSystemDirectory *p_path, List<FileInfo>* matches, int p_max_items); + void _search(EditorFileSystemDirectory *p_path, List<FileInfo> *matches, int p_max_items); - Variant get_drag_data_fw(const Point2& p_point,Control* p_from); - bool can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const; - void drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from); + Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); + bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; + void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); - void _preview_invalidated(const String& p_path); + void _preview_invalidated(const String &p_path); protected: void _notification(int p_what); static void _bind_methods(); -public: +public: String get_selected_path() const; String get_current_path() const; - void navigate_to_path(const String& p_path); + void navigate_to_path(const String &p_path); void focus_on_filter(); - void fix_dependencies(const String& p_for_file); + void fix_dependencies(const String &p_for_file); void set_display_mode(int p_mode); int get_split_offset() { return split_box->get_split_offset(); } void set_split_offset(int p_offset) { split_box->set_split_offset(p_offset); } - void select_file(const String& p_file); + void select_file(const String &p_file); FileSystemDock(EditorNode *p_editor); ~FileSystemDock(); }; - #endif // SCENES_DOCK_H |