diff --git a/src/duckstation-qt/controllerbindingwidgets.cpp b/src/duckstation-qt/controllerbindingwidgets.cpp index 0087601fd..2fa55744b 100644 --- a/src/duckstation-qt/controllerbindingwidgets.cpp +++ b/src/duckstation-qt/controllerbindingwidgets.cpp @@ -361,7 +361,8 @@ void ControllerMacroEditWidget::modFrequency(s32 delta) void ControllerMacroEditWidget::updateFrequency() { m_bwidget->getDialog()->setIntValue(m_bwidget->getConfigSection().c_str(), - fmt::format("Macro{}Frequency", m_index).c_str(), static_cast(m_frequency)); + fmt::format("Macro{}Frequency", m_index + 1u).c_str(), + static_cast(m_frequency)); updateFrequencyText(); } diff --git a/src/duckstation-qt/controllersettingsdialog.cpp b/src/duckstation-qt/controllersettingsdialog.cpp index 3ccc0bf0c..5d4e862d5 100644 --- a/src/duckstation-qt/controllersettingsdialog.cpp +++ b/src/duckstation-qt/controllersettingsdialog.cpp @@ -248,7 +248,7 @@ bool ControllerSettingsDialog::getBoolValue(const char* section, const char* key return Host::GetBaseBoolSettingValue(section, key, default_value); } -bool ControllerSettingsDialog::getIntValue(const char* section, const char* key, s32 default_value) const +s32 ControllerSettingsDialog::getIntValue(const char* section, const char* key, s32 default_value) const { if (m_profile_interface) return m_profile_interface->GetIntValue(section, key, default_value); diff --git a/src/duckstation-qt/controllersettingsdialog.h b/src/duckstation-qt/controllersettingsdialog.h index 1269de9a8..1fcdaa3f9 100644 --- a/src/duckstation-qt/controllersettingsdialog.h +++ b/src/duckstation-qt/controllersettingsdialog.h @@ -50,7 +50,7 @@ public: // Helper functions for updating setting values globally or in the profile. bool getBoolValue(const char* section, const char* key, bool default_value) const; - bool getIntValue(const char* section, const char* key, s32 default_value) const; + s32 getIntValue(const char* section, const char* key, s32 default_value) const; std::string getStringValue(const char* section, const char* key, const char* default_value) const; void setBoolValue(const char* section, const char* key, bool value); void setIntValue(const char* section, const char* key, s32 value); diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 2123e6765..bf27921a7 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -420,6 +420,7 @@ void MainWindow::destroyDisplayWidget(bool show_game_list) { m_game_list_widget->setVisible(true); setCentralWidget(m_game_list_widget); + m_game_list_widget->resizeTableViewColumnsToFit(); } } else @@ -427,7 +428,10 @@ void MainWindow::destroyDisplayWidget(bool show_game_list) AssertMsg(m_ui.mainContainer->indexOf(m_display_widget) == 1, "Display widget in stack"); m_ui.mainContainer->removeWidget(m_display_widget); if (show_game_list) + { m_ui.mainContainer->setCurrentIndex(0); + m_game_list_widget->resizeTableViewColumnsToFit(); + } } } @@ -1187,6 +1191,7 @@ void MainWindow::onGameListRefreshProgress(const QString& status, int current, i void MainWindow::onGameListRefreshComplete() { + m_ui.statusBar->clearMessage(); clearProgressBar(); } @@ -1650,7 +1655,7 @@ void MainWindow::updateWindowState(bool force_visible) void MainWindow::setProgressBar(int current, int total) { - const int value = (current * 100) / total; + const int value = (total != 0) ? ((current * 100) / total) : 0; if (m_status_progress_widget->value() != value) m_status_progress_widget->setValue(value); diff --git a/src/frontend-common/game_list.cpp b/src/frontend-common/game_list.cpp index ef1d7bd60..f217bf596 100644 --- a/src/frontend-common/game_list.cpp +++ b/src/frontend-common/game_list.cpp @@ -425,7 +425,6 @@ void GameList::ScanDirectory(const char* path, bool recursive, bool only_cache, { Log_InfoPrintf("Scanning %s%s", path, recursive ? " (recursively)" : ""); - progress->PushState(); progress->SetFormattedStatusText("Scanning directory '%s'%s...", path, recursive ? " (recursively)" : ""); FileSystem::FindResultsArray files; @@ -433,11 +432,14 @@ void GameList::ScanDirectory(const char* path, bool recursive, bool only_cache, recursive ? (FILESYSTEM_FIND_FILES | FILESYSTEM_FIND_HIDDEN_FILES | FILESYSTEM_FIND_RECURSIVE) : (FILESYSTEM_FIND_FILES | FILESYSTEM_FIND_HIDDEN_FILES), &files); + if (files.empty()) + return; - u32 files_scanned = 0; + progress->PushState(); progress->SetProgressRange(static_cast(files.size())); progress->SetProgressValue(0); + u32 files_scanned = 0; for (FILESYSTEM_FIND_DATA& ffd : files) { files_scanned++; diff --git a/src/frontend-common/input_manager.cpp b/src/frontend-common/input_manager.cpp index 2fcbc2e7d..88bed635f 100644 --- a/src/frontend-common/input_manager.cpp +++ b/src/frontend-common/input_manager.cpp @@ -1144,7 +1144,7 @@ void InputManager::LoadMacroButtonConfig(SettingsInterface& si, const std::strin { if (button == cinfo->bindings[j].name) { - binding = &cinfo->bindings[i]; + binding = &cinfo->bindings[j]; break; } }