diff --git a/rpcs3/rpcs3qt/pkg_install_dialog.cpp b/rpcs3/rpcs3qt/pkg_install_dialog.cpp index 3ca7d6ebc9..65ff65a122 100644 --- a/rpcs3/rpcs3qt/pkg_install_dialog.cpp +++ b/rpcs3/rpcs3qt/pkg_install_dialog.cpp @@ -26,12 +26,20 @@ pkg_install_dialog::pkg_install_dialog(const QStringList& paths, game_compatibil for (const QString& path : paths) { const compat::package_info info = game_compatibility::GetPkgInfo(path, compat); + const QFileInfo file_info(path); // We have to build our complicated localized string in some annoying manner QString accumulated_info; - QString additional_info; QString tooltip; + const auto append_comma = [&accumulated_info]() + { + if (!accumulated_info.isEmpty()) + { + accumulated_info += ", "; + } + }; + if (!info.title_id.isEmpty()) { accumulated_info = info.title_id; @@ -39,10 +47,7 @@ pkg_install_dialog::pkg_install_dialog(const QStringList& paths, game_compatibil if (info.type != compat::package_type::other) { - if (!accumulated_info.isEmpty()) - { - accumulated_info += ", "; - } + append_comma(); if (info.type == compat::package_type::dlc) { @@ -55,19 +60,13 @@ pkg_install_dialog::pkg_install_dialog(const QStringList& paths, game_compatibil } else if (!info.local_cat.isEmpty()) { - if (!accumulated_info.isEmpty()) - { - accumulated_info += ", "; - } + append_comma(); accumulated_info += tr("%0", "Package type info").arg(info.local_cat); } if (!info.version.isEmpty()) { - if (!accumulated_info.isEmpty()) - { - accumulated_info += ", "; - } + append_comma(); accumulated_info += tr("v.%0", "Version info").arg(info.version); } @@ -80,12 +79,10 @@ pkg_install_dialog::pkg_install_dialog(const QStringList& paths, game_compatibil tooltip = tr("Changelog:\n\n%0", "Changelog info").arg(info.changelog); } - if (!accumulated_info.isEmpty()) - { - additional_info = tr(" (%0)", "Additional info").arg(accumulated_info); - } + append_comma(); + accumulated_info += file_info.fileName(); - const QString text = tr("%0%1", "Package text").arg(info.title).arg(additional_info); + const QString text = tr("%0 (%2)", "Package text").arg(info.title.simplified()).arg(accumulated_info); QListWidgetItem* item = new numbered_widget_item(text, m_dir_list); item->setData(Roles::FullPathRole, info.path);