From ea40370389a5423e54ce2ef3fbab9d7bd76a7802 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 23 Dec 2018 23:50:33 +0100 Subject: Cleanup: remove explicit constructor of DiveListBase DiveListBase had an explicit constructor that initialized the "firstExecution" member variable. The latter was a development- artifact that was never used. Remove the member and the constructor. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_divelist.cpp | 5 ----- desktop-widgets/command_divelist.h | 9 --------- 2 files changed, 14 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index 6d2eafc6d..6ab7ec099 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -331,11 +331,6 @@ static void moveDivesBetweenTrips(DivesToTrip &dives) std::reverse(dives.divesToMove.begin(), dives.divesToMove.end()); } -// When we initialize the command we don't have to roll-back any selection change -DiveListBase::DiveListBase() : firstExecution(true) -{ -} - // Turn current selection into a vector. // TODO: This could be made much more efficient if we kept a sorted list of selected dives! static std::vector getDiveSelection() diff --git a/desktop-widgets/command_divelist.h b/desktop-widgets/command_divelist.h index 8cf8986e3..8eca0bb57 100644 --- a/desktop-widgets/command_divelist.h +++ b/desktop-widgets/command_divelist.h @@ -52,8 +52,6 @@ struct DivesToTrip // flag accordingly. class DiveListBase : public Base { protected: - DiveListBase(); - // These are helper functions to add / remove dive from the C-core structures, // which set the selectionChanged flag if the added / removed dive was selected. DiveToAdd removeDive(struct dive *d, std::vector &tripsToAdd); @@ -64,13 +62,6 @@ protected: // Set the selection to a given state. Set the selectionChanged flag if anything changed. void restoreSelection(const std::vector &selection, dive *currentDive); - // On first execution, the selections before and after execution will - // be remembered. On all further executions, the selection will be reset to - // the remembered values. - // Note: Therefore, commands should manipulate the selection and send the - // corresponding signals only on first execution! - bool firstExecution; - // Commands set this flag if the selection changed on first execution. // Only then, a new the divelist will be scanned again after the command. // If this flag is set on first execution, a selectionChanged signal will -- cgit v1.2.3-70-g09d2