diff --git a/include/project.h b/include/project.h index b8620fc4..470a0d12 100644 --- a/include/project.h +++ b/include/project.h @@ -180,7 +180,7 @@ public: QString getScriptDefaultString(bool usePoryScript, QString mapName) const; QString getMapScriptsFilePath(const QString &mapName) const; QStringList getEventScriptsFilePaths() const; - QCompleter *getEventScriptLabelCompleter(const QStringList &additionalCompletions) const; + QCompleter *getEventScriptLabelCompleter(QStringList additionalCompletions) const; bool loadMapBorder(Map *map); diff --git a/src/core/map.cpp b/src/core/map.cpp index 3d839ecc..202d797b 100644 --- a/src/core/map.cpp +++ b/src/core/map.cpp @@ -427,8 +427,8 @@ QStringList Map::eventScriptLabels(const QString &event_group_type) const { scriptLabels << event->get("script_label"); } + scriptLabels.removeAll(""); scriptLabels.removeDuplicates(); - scriptLabels.removeAll(QString()); if (scriptLabels.contains("0x0")) scriptLabels.move(scriptLabels.indexOf("0x0"), scriptLabels.count() - 1); if (scriptLabels.contains("NULL")) diff --git a/src/project.cpp b/src/project.cpp index 87590616..6cdb7008 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -2386,8 +2386,10 @@ QStringList Project::getEventScriptsFilePaths() const { return filePaths; } -QCompleter *Project::getEventScriptLabelCompleter(const QStringList &additionalCompletions) const { - eventScriptLabelModel->setStringList(eventScriptLabels + additionalCompletions); +QCompleter *Project::getEventScriptLabelCompleter(QStringList additionalCompletions) const { + additionalCompletions += eventScriptLabels; + additionalCompletions.removeDuplicates(); + eventScriptLabelModel->setStringList(additionalCompletions); return eventScriptLabelCompleter; }