diff --git a/vkconfig/widget_setting_filesystem.cpp b/vkconfig/widget_setting_filesystem.cpp index 0c6d465c7f..1f4c093379 100644 --- a/vkconfig/widget_setting_filesystem.cpp +++ b/vkconfig/widget_setting_filesystem.cpp @@ -103,6 +103,7 @@ void WidgetSettingFilesystem::LoadFile(const std::string& path) { file_setting_data.profile_names = GetProfileNames(path); SettingDataString* enum_setting_data = FindSetting(this->data_set, "profile_name"); + enum_setting_data->value.clear(); if (!file_setting_data.profile_names.empty() && enum_setting_data != nullptr) { enum_setting_data->value = file_setting_data.profile_names[0]; } @@ -135,12 +136,6 @@ void WidgetSettingFilesystem::browseButtonClicked() { if (!file.empty()) { file = ConvertNativeSeparators(file); - LoadFile(file); - - if (VKC_ENV == VKC_ENV_WIN32) { - file = ConvertSeparators(file, "/", GetNativeSeparator()); - } - this->data().value = file; field->setText(this->data().value.c_str()); @@ -151,6 +146,15 @@ void WidgetSettingFilesystem::browseButtonClicked() { void WidgetSettingFilesystem::textFieldChanged(const QString& value) { std::string file = value.toStdString(); + + if (!file.empty()) { + LoadFile(file); + + if (VKC_ENV == VKC_ENV_WIN32) { + file = ConvertSeparators(file, "/", GetNativeSeparator()); + } + } + this->data().value = file; this->field->setToolTip(this->field->text());