Qt/patches: Fix configurable value dropdown visibility

This commit is contained in:
Megamouse 2025-07-13 13:20:50 +02:00
commit 3926889c97
2 changed files with 5 additions and 5 deletions

View file

@ -549,7 +549,7 @@ void patch_manager_dialog::filter_patches(const QString& term)
m_expand_current_match = false; m_expand_current_match = false;
} }
void patch_manager_dialog::update_patch_info(const patch_manager_dialog::gui_patch_info& info) const void patch_manager_dialog::update_patch_info(const patch_manager_dialog::gui_patch_info& info, bool force_update) const
{ {
ui->label_hash->setText(info.hash); ui->label_hash->setText(info.hash);
ui->label_author->setText(info.author); ui->label_author->setText(info.author);
@ -577,7 +577,7 @@ void patch_manager_dialog::update_patch_info(const patch_manager_dialog::gui_pat
return; return;
} }
if (key == info.config_value_key) if (!force_update && key == info.config_value_key)
{ {
// Don't update widget if the config key did not change // Don't update widget if the config key did not change
return; return;
@ -641,7 +641,7 @@ void patch_manager_dialog::handle_item_selected(QTreeWidgetItem* current, QTreeW
if (!current) if (!current)
{ {
// Clear patch info if no item is selected // Clear patch info if no item is selected
update_patch_info({}); update_patch_info({}, true);
return; return;
} }
@ -719,7 +719,7 @@ void patch_manager_dialog::handle_item_selected(QTreeWidgetItem* current, QTreeW
} }
} }
update_patch_info(info); update_patch_info(info, current != previous);
const QString key = ui->configurable_selector->currentIndex() < 0 ? "" : ui->configurable_selector->currentData().toString(); const QString key = ui->configurable_selector->currentIndex() < 0 ? "" : ui->configurable_selector->currentData().toString();
current->setData(0, config_key_role, key); current->setData(0, config_key_role, key);

View file

@ -58,7 +58,7 @@ private:
void load_patches(bool show_error); void load_patches(bool show_error);
void populate_tree(); void populate_tree();
void save_config() const; void save_config() const;
void update_patch_info(const gui_patch_info& info) const; void update_patch_info(const gui_patch_info& info, bool force_update) const;
static bool is_valid_file(const QMimeData& md, QStringList* drop_paths = nullptr); static bool is_valid_file(const QMimeData& md, QStringList* drop_paths = nullptr);
void download_update(bool automatic, bool auto_accept); void download_update(bool automatic, bool auto_accept);
bool handle_json(const QByteArray& data); bool handle_json(const QByteArray& data);