cleanup: remove MainTab::modified

This field was not set to true since introducing undo of
dive fields.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-26 22:49:38 +01:00 committed by Dirk Hohndel
parent 1eb8f7cbaa
commit 0306109e95
2 changed files with 1 additions and 5 deletions

View file

@ -50,7 +50,6 @@ struct Completers {
MainTab::MainTab(QWidget *parent) : QTabWidget(parent), MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
editMode(NONE), editMode(NONE),
modified(false),
lastSelectedDive(true), lastSelectedDive(true),
lastTabSelectedDive(0), lastTabSelectedDive(0),
lastTabSelectedDiveTrip(0), lastTabSelectedDiveTrip(0),
@ -211,7 +210,6 @@ void MainTab::enableEdition(EditMode newEditMode)
{ {
if (((newEditMode == DIVE || newEditMode == NONE) && current_dive == NULL) || editMode != NONE) if (((newEditMode == DIVE || newEditMode == NONE) && current_dive == NULL) || editMode != NONE)
return; return;
modified = false;
if ((newEditMode == DIVE || newEditMode == NONE) && if ((newEditMode == DIVE || newEditMode == NONE) &&
current_dive->dc.model && current_dive->dc.model &&
strcmp(current_dive->dc.model, "manually added dive") == 0) { strcmp(current_dive->dc.model, "manually added dive") == 0) {
@ -592,8 +590,7 @@ void MainTab::rejectChanges()
EditMode lastMode = editMode; EditMode lastMode = editMode;
if (lastMode != NONE && current_dive && if (lastMode != NONE && current_dive &&
(modified || (!cylinders_equal(current_dive, &displayed_dive) ||
!cylinders_equal(current_dive, &displayed_dive) ||
!weightsystems_equal(current_dive, &displayed_dive))) { !weightsystems_equal(current_dive, &displayed_dive))) {
if (QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(tr("Discard the changes?"), if (QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(tr("Discard the changes?"),
tr("You are about to discard your changes.")), tr("You are about to discard your changes.")),

View file

@ -80,7 +80,6 @@ private:
BuddyCompletionModel buddyModel; BuddyCompletionModel buddyModel;
DiveMasterCompletionModel diveMasterModel; DiveMasterCompletionModel diveMasterModel;
TagCompletionModel tagModel; TagCompletionModel tagModel;
bool modified;
bool lastSelectedDive; bool lastSelectedDive;
int lastTabSelectedDive; int lastTabSelectedDive;
int lastTabSelectedDiveTrip; int lastTabSelectedDiveTrip;