Refactored a lot of stuff.
Added property lists. Renamed FileAdapter to FileSystemAdapter. And more smaller stuff.
This commit is contained in:
@@ -39,6 +39,18 @@ static func new_item_sorted(tree : Tree, parent : TreeItem, key : String, meta_c
|
||||
new_itm.set_metadata(meta_column, key)
|
||||
return new_itm
|
||||
|
||||
static func find_tree_item_with_meta(root : TreeItem, value, column := 0) -> TreeItem:
|
||||
if root == null:
|
||||
return null
|
||||
elif root.get_metadata(column) == value:
|
||||
return root
|
||||
else:
|
||||
var itm := find_tree_item_with_meta(root.get_next(), value, column)
|
||||
if itm != null:
|
||||
return itm
|
||||
itm = find_tree_item_with_meta(root.get_children(), value, column)
|
||||
return itm
|
||||
|
||||
static func copy_size(target : Control, source : Control) -> void:
|
||||
target.rect_min_size = source.rect_min_size
|
||||
target.rect_size = source.rect_size
|
||||
|
||||
@@ -16,7 +16,7 @@ static func get_recent_places() -> Array:
|
||||
return GDBSettings.get_value(GDBConstants.SETTING_RECENT_PLACES, [])
|
||||
|
||||
static func add_recent_place(place) -> void:
|
||||
if place is UIB_FileAdapter.FileEntry:
|
||||
if place is UIB_FilesystemAdapter.FileEntry:
|
||||
add_recent_place(place._get_path())
|
||||
return
|
||||
|
||||
@@ -32,14 +32,14 @@ static func get_favourite_places() -> Array:
|
||||
return GDBSettings.get_value(GDBConstants.SETTING_FAVOURITE_PLACES, [])
|
||||
|
||||
static func is_favourite_place(place) -> bool:
|
||||
if place is UIB_FileAdapter.FileEntry:
|
||||
if place is UIB_FilesystemAdapter.FileEntry:
|
||||
return is_favourite_place(place._get_path())
|
||||
|
||||
assert(place is String)
|
||||
return GDBSettings.array_has_value(GDBConstants.SETTING_FAVOURITE_PLACES, place)
|
||||
|
||||
static func add_favourite_place(place) -> void:
|
||||
if place is UIB_FileAdapter.FileEntry:
|
||||
if place is UIB_FilesystemAdapter.FileEntry:
|
||||
add_favourite_place(place._get_path())
|
||||
return
|
||||
|
||||
@@ -52,7 +52,7 @@ static func add_favourite_place(place) -> void:
|
||||
__get_state().emit_signal("favourite_places_changed")
|
||||
|
||||
static func remove_favourite_place(place) -> void:
|
||||
if place is UIB_FileAdapter.FileEntry:
|
||||
if place is UIB_FilesystemAdapter.FileEntry:
|
||||
remove_favourite_place(place._get_path())
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user