From 0306109e952c46d182f78e14a0259f56cce87928 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 26 Feb 2020 22:49:38 +0100 Subject: cleanup: remove MainTab::modified This field was not set to true since introducing undo of dive fields. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 5 +---- desktop-widgets/tab-widgets/maintab.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'desktop-widgets/tab-widgets') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 01e630104..006603388 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -50,7 +50,6 @@ struct Completers { MainTab::MainTab(QWidget *parent) : QTabWidget(parent), editMode(NONE), - modified(false), lastSelectedDive(true), lastTabSelectedDive(0), lastTabSelectedDiveTrip(0), @@ -211,7 +210,6 @@ void MainTab::enableEdition(EditMode newEditMode) { if (((newEditMode == DIVE || newEditMode == NONE) && current_dive == NULL) || editMode != NONE) return; - modified = false; if ((newEditMode == DIVE || newEditMode == NONE) && current_dive->dc.model && strcmp(current_dive->dc.model, "manually added dive") == 0) { @@ -592,8 +590,7 @@ void MainTab::rejectChanges() EditMode lastMode = editMode; if (lastMode != NONE && current_dive && - (modified || - !cylinders_equal(current_dive, &displayed_dive) || + (!cylinders_equal(current_dive, &displayed_dive) || !weightsystems_equal(current_dive, &displayed_dive))) { if (QMessageBox::warning(MainWindow::instance(), TITLE_OR_TEXT(tr("Discard the changes?"), tr("You are about to discard your changes.")), diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index f1caf8ed1..6411f6b3a 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -80,7 +80,6 @@ private: BuddyCompletionModel buddyModel; DiveMasterCompletionModel diveMasterModel; TagCompletionModel tagModel; - bool modified; bool lastSelectedDive; int lastTabSelectedDive; int lastTabSelectedDiveTrip; -- cgit v1.2.3-70-g09d2