diff options
Diffstat (limited to 'desktop-widgets/command_divelist.h')
-rw-r--r-- | desktop-widgets/command_divelist.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/desktop-widgets/command_divelist.h b/desktop-widgets/command_divelist.h index 01dd4db77..650a64ba4 100644 --- a/desktop-widgets/command_divelist.h +++ b/desktop-widgets/command_divelist.h @@ -182,13 +182,17 @@ private: // For redo // For each dive to split, we remove one from and put two dives into the backend - dive *diveToSplit; - DiveToAdd splitDives[2]; + // Note: we use a vector even though we split only a single dive, so + // that we can reuse the multi-dive functions of the other commands. + std::vector<dive *> diveToSplit; + std::vector<DiveToAdd> splitDives; // For undo // For each dive to unsplit, we remove two dives from and add one into the backend - DiveToAdd unsplitDive; - dive *divesToUnsplit[2]; + // Note: we use a vector even though we unsplit only a single dive, so + // that we can reuse the multi-dive functions of the other commands. + std::vector<DiveToAdd> unsplitDive; + std::vector<dive *> divesToUnsplit; }; class MergeDives : public DiveListBase { @@ -201,13 +205,17 @@ private: // For redo // Add one and remove a batch of dives - DiveToAdd mergedDive; - std::vector<dive *> divesToMerge; + // Note: we use a vector even though we add only a single dive, so + // that we can reuse the multi-dive functions of the other commands. + std::vector<DiveToAdd> mergedDive; + std::vector<dive *> divesToMerge; // For undo // Remove one and add a batch of dives - dive *diveToUnmerge; - std::vector<DiveToAdd> unmergedDives; + // Note: we use a vector even though we remove only a single dive, so + // that we can reuse the multi-dive functions of the other commands. + std::vector<dive *> diveToUnmerge; + std::vector<DiveToAdd> unmergedDives; // For undo and redo QVector<QPair<dive *, int>> divesToRenumber; |