diff --git a/mainwindow.cpp b/mainwindow.cpp index 3d50f52..bd6de83 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -10,7 +10,6 @@ #include #include #include -#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { @@ -132,15 +131,13 @@ void MainWindow::loadData(const QString &modDir) { } remainingMods.sort(Qt::CaseInsensitive); - // Add remaining mods that were not in the order.json to the beginning of the list - finalModList = remainingMods + finalModList; + // Add remaining mods that were not in the order.json + finalModList.append(remainingMods); // Add the final ordered mods to the list widget - for (int i = 0; i < finalModList.size(); ++i) { - QString modName = finalModList[i]; + foreach (QString modName, finalModList) { QString tooltipText = modTooltips.value(modName); - bool isNew = remainingMods.contains(modName); - addListItem(modName, tooltipText, -1, isNew); + addListItem(modName, tooltipText); } initialOrder = QStringList(); @@ -149,22 +146,9 @@ void MainWindow::loadData(const QString &modDir) { } } -void MainWindow::addListItem(const QString &modName, const QString &tooltipText, int position, bool isNew) { +void MainWindow::addListItem(const QString &modName, const QString &tooltipText, int position) { QListWidgetItem *listItem = new QListWidgetItem(modName); listItem->setToolTip(tooltipText); - - // Set background color for new items - if (isNew) { - listItem->setBackground(QBrush(QColor(255, 255, 200))); // Light yellow - } - - // Set position indicator - if (position == -1) { - position = ui->listWidget->count(); - } - QString itemText = QString("%1. %2").arg(position + 1).arg(modName); - listItem->setText(itemText); - if (position == -1) { ui->listWidget->addItem(listItem); } else { diff --git a/mainwindow.h b/mainwindow.h index cee8c85..c825dca 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -31,7 +31,7 @@ private: void loadConfig(); bool checkModsDirectory(); void loadData(const QString &modDir); - void addListItem(const QString &modName, const QString &tooltipText, int position = -1, bool isNew = false); + void addListItem(const QString &modName, const QString &tooltipText, int position = -1); Ui::MainWindow *ui; QListWidget *listWidget;