summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-15 20:37:10 +0200
committerTannin <devnull@localhost>2014-07-15 20:37:10 +0200
commit80b10107d9deeaf8b1aa9d306ea506aafcb99bd1 (patch)
tree3db705018950f19c2e71c0ef42d94172d1522b78 /src/mainwindow.cpp
parent1707941f6ec256e1bc48edec01ea41be9526fb81 (diff)
- Disabled compilation of loot_cli as the current loot version can't be compiled or linked against with vs 2010
- bugfix: some incompatibilities with non-skyrim games - bugfix: incorrect handling of plurals in translateable strings
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d6cef2dc..5d4c4cca 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3887,23 +3887,18 @@ void MainWindow::deleteSavegame_clicked()
QModelIndexList selectedIndexes = ui->savegameList->selectionModel()->selectedIndexes();
QString savesMsgLabel;
- QRegExp saveSuffix(".ess$");
QStringList deleteFiles;
foreach (const QModelIndex &idx, selectedIndexes) {
QString name = idx.data().toString();
SaveGame *save = new SaveGame(this, idx.data(Qt::UserRole).toString());
- savesMsgLabel += "<li>" + name.replace(saveSuffix, "") + "</li>";
+ savesMsgLabel += "<li>" + QFileInfo(name).completeBaseName() + "</li>";
deleteFiles << save->saveFiles();
}
- bool multipleRows = (selectedIndexes.count() > 1);
-
- if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %1save%2?<br><ul>%3</ul><br>Removed saves will be sent to the Recycle Bin.")
- .arg((multipleRows) ? QString::number(selectedIndexes.count()) + " " : "")
- .arg((multipleRows) ? "s" : "")
+ if (QMessageBox::question(this, tr("Confirm"), tr("Are you sure you want to remove the following %n save(s)?<br><ul>%1</ul><br>Removed saves will be sent to the Recycle Bin.", "", selectedIndexes.count())
.arg(savesMsgLabel),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
shellDelete(deleteFiles, true); // recycle bin delete.
@@ -4012,14 +4007,12 @@ void MainWindow::on_savegameList_customContextMenuRequested(const QPoint &pos)
if (!selection->hasSelection())
return;
- bool multipleSelected = (selection->selectedIndexes().count() > 1);
-
QMenu menu;
- if (!multipleSelected)
+ if (!(selection->selectedIndexes().count() > 1))
menu.addAction(tr("Fix Mods..."), this, SLOT(fixMods_clicked()));
- QString deleteMenuLabel = tr("Delete save%1").arg((multipleSelected) ? "s" : "");
+ QString deleteMenuLabel = tr("Delete %n save(s)", "", selection->selectedIndexes().count());
menu.addAction(deleteMenuLabel, this, SLOT(deleteSavegame_clicked()));
@@ -4212,7 +4205,7 @@ void MainWindow::installTranslator(const QString &name)
QTranslator *translator = new QTranslator(this);
QString fileName = name + "_" + m_CurrentLanguage;
if (!translator->load(fileName, qApp->applicationDirPath() + "/translations")) {
- if (m_CurrentLanguage != "en-US") {
+ if (m_CurrentLanguage != "en_US") {
qWarning("localization file %s not found", qPrintable(fileName));
} // we don't actually expect localization files for english
}