mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
qt/main: Avoid sign conversions in UpdateRecentFiles()
This was intermixing signed and unsigned values when they could all just be signed.
This commit is contained in:
parent
cf983888cc
commit
96b6ad11c1
1 changed files with 6 additions and 4 deletions
|
@ -81,6 +81,8 @@ static void ShowCalloutMessage(const QString& message, CalloutFlag flag) {
|
||||||
|
|
||||||
void GMainWindow::ShowCallouts() {}
|
void GMainWindow::ShowCallouts() {}
|
||||||
|
|
||||||
|
const int GMainWindow::max_recent_files_item;
|
||||||
|
|
||||||
GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
|
GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
|
||||||
|
|
||||||
debug_context = Tegra::DebugContext::Construct();
|
debug_context = Tegra::DebugContext::Construct();
|
||||||
|
@ -579,11 +581,11 @@ void GMainWindow::StoreRecentFile(const QString& filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::UpdateRecentFiles() {
|
void GMainWindow::UpdateRecentFiles() {
|
||||||
unsigned int num_recent_files =
|
const int num_recent_files =
|
||||||
std::min(UISettings::values.recent_files.size(), static_cast<int>(max_recent_files_item));
|
std::min(UISettings::values.recent_files.size(), max_recent_files_item);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < num_recent_files; i++) {
|
for (int i = 0; i < num_recent_files; i++) {
|
||||||
QString text = QString("&%1. %2").arg(i + 1).arg(
|
const QString text = QString("&%1. %2").arg(i + 1).arg(
|
||||||
QFileInfo(UISettings::values.recent_files[i]).fileName());
|
QFileInfo(UISettings::values.recent_files[i]).fileName());
|
||||||
actions_recent_files[i]->setText(text);
|
actions_recent_files[i]->setText(text);
|
||||||
actions_recent_files[i]->setData(UISettings::values.recent_files[i]);
|
actions_recent_files[i]->setData(UISettings::values.recent_files[i]);
|
||||||
|
|
Loading…
Reference in a new issue