diff options
| author | TheBloke <devnull@localhost> | 2014-07-13 15:45:19 +0100 |
|---|---|---|
| committer | TheBloke <devnull@localhost> | 2014-07-13 15:45:19 +0100 |
| commit | d0b75e8b25012c63a20ee7996654a43b280ab8cd (patch) | |
| tree | 56654f28ec2996909e88254dd892a1568a79053e /src | |
| parent | 4fc441b24910dfa2cf76bd6095a56a99792174e3 (diff) | |
savegameList: more minor changes
- Context Menu - can do same job with fewer variables and assignments
- deleteSaveGame_clicked - const reference, not new value, in foreach loop
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1baf60d4..aed95616 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3890,7 +3890,7 @@ void MainWindow::deleteSavegame_clicked() QRegExp saveSuffix(".ess$"); QStringList deleteFiles; - foreach (QModelIndex idx, selectedIndexes) { + foreach (const QModelIndex &idx, selectedIndexes) { QString name = idx.data().toString(); SaveGame *save = new SaveGame(this, idx.data(Qt::UserRole).toString()); @@ -4007,15 +4007,11 @@ void MainWindow::fixMods_clicked() void MainWindow::on_savegameList_customContextMenuRequested(const QPoint &pos) { QItemSelectionModel *selection = ui->savegameList->selectionModel(); - QModelIndexList selectedIndexes = selection->selectedIndexes(); - bool multipleSelected = false; - int selectedCount = selectedIndexes.count(); - - if ( !selection->hasSelection()) { + if (!selection->hasSelection()) return; - } else if (selectedCount > 1) - multipleSelected = true; + + bool multipleSelected = (selection->selectedIndexes().count() > 1); QMenu menu; |
