mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-05-04 08:11:54 +00:00
refactor(cleanup): do not allow empty profiles/games
This commit is contained in:
parent
ec37172b83
commit
e053d3dcab
1 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,7 @@ namespace lsfgvk::ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE void addActiveIn(const QString& name) {
|
Q_INVOKABLE void addActiveIn(const QString& name) {
|
||||||
|
if (name.trimmed().isEmpty()) return;
|
||||||
VALIDATE_AND_GET_PROFILE()
|
VALIDATE_AND_GET_PROFILE()
|
||||||
auto& active_in = conf.active_in;
|
auto& active_in = conf.active_in;
|
||||||
active_in.push_back(name.toStdString());
|
active_in.push_back(name.toStdString());
|
||||||
|
|
@ -188,6 +189,8 @@ namespace lsfgvk::ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE void createProfile(const QString& name) {
|
Q_INVOKABLE void createProfile(const QString& name) {
|
||||||
|
if (name.trimmed().isEmpty()) return;
|
||||||
|
|
||||||
ls::GameConf conf;
|
ls::GameConf conf;
|
||||||
conf.name = name.toStdString();
|
conf.name = name.toStdString();
|
||||||
this->m_profiles.push_back(std::move(conf));
|
this->m_profiles.push_back(std::move(conf));
|
||||||
|
|
@ -200,6 +203,8 @@ namespace lsfgvk::ui {
|
||||||
MARK_DIRTY()
|
MARK_DIRTY()
|
||||||
}
|
}
|
||||||
Q_INVOKABLE void renameProfile(const QString& name) {
|
Q_INVOKABLE void renameProfile(const QString& name) {
|
||||||
|
if (name.trimmed().isEmpty()) return;
|
||||||
|
|
||||||
VALIDATE_AND_GET_PROFILE()
|
VALIDATE_AND_GET_PROFILE()
|
||||||
conf.name = name.toStdString();
|
conf.name = name.toStdString();
|
||||||
auto& model = this->m_profile_list_model;
|
auto& model = this->m_profile_list_model;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue