summaryrefslogtreecommitdiffstats
path: root/editor/import_dock.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-03-12 01:06:45 +0100
committerkobewi <kobewi4e@gmail.com>2022-03-12 01:14:03 +0100
commit42078dec9f592243209f845766409d01c12ac525 (patch)
treed73198d40081021ae8ab945d58b4482378869c7b /editor/import_dock.cpp
parentd5076439e44e6eab5732e1d2fc0f30bb6f34e5f9 (diff)
downloadredot-engine-42078dec9f592243209f845766409d01c12ac525.tar.gz
Allow negative indexes in ItemList and PopupMenu
Diffstat (limited to 'editor/import_dock.cpp')
-rw-r--r--editor/import_dock.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp
index 72cc33048c..9f1daac69f 100644
--- a/editor/import_dock.cpp
+++ b/editor/import_dock.cpp
@@ -128,7 +128,7 @@ void ImportDock::set_edit_path(const String &p_path) {
for (const Pair<String, String> &E : importer_names) {
import_as->add_item(E.first);
- import_as->set_item_metadata(import_as->get_item_count() - 1, E.second);
+ import_as->set_item_metadata(-1, E.second);
if (E.second == importer_name) {
import_as->select(import_as->get_item_count() - 1);
}
@@ -149,7 +149,7 @@ void ImportDock::set_edit_path(const String &p_path) {
void ImportDock::_add_keep_import_option(const String &p_importer_name) {
import_as->add_separator();
import_as->add_item(TTR("Keep File (No Import)"));
- import_as->set_item_metadata(import_as->get_item_count() - 1, "keep");
+ import_as->set_item_metadata(-1, "keep");
if (p_importer_name == "keep") {
import_as->select(import_as->get_item_count() - 1);
}
@@ -286,7 +286,7 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) {
for (const Pair<String, String> &E : importer_names) {
import_as->add_item(E.first);
- import_as->set_item_metadata(import_as->get_item_count() - 1, E.second);
+ import_as->set_item_metadata(-1, E.second);
if (E.second == params->importer->get_importer_name()) {
import_as->select(import_as->get_item_count() - 1);
}