diff --git a/src/MergeActivityWizard.cpp b/src/MergeActivityWizard.cpp index bb79aeb30..0c74ae14d 100644 --- a/src/MergeActivityWizard.cpp +++ b/src/MergeActivityWizard.cpp @@ -1165,9 +1165,8 @@ MergeConfirm::MergeConfirm(MergeActivityWizard *parent) : QWizardPage(parent), w QLabel *label = new QLabel(tr("Press Finish to update the current ride with " " the combined data.\n\n" - "The changes will not be saved until you save them " - " so you can check and revert or save.\n\n" - "If you continue the ride will be updated, if you " + "The changes will be saved and cannot be undone.\n\n" + "If you press continue the ride will be saved, if you " "do not want to continue either go back and change " "the settings or press cancel to abort.")); label->setWordWrap(true); @@ -1179,9 +1178,10 @@ MergeConfirm::MergeConfirm(MergeActivityWizard *parent) : QWizardPage(parent), w bool MergeConfirm::validatePage() { - // We are done -- update BUT DOESNT SAVE - // user can now check ! + // We are done -- save and mark done wizard->current->setRide(wizard->combined); - wizard->context->notifyRideDirty(); + wizard->context->mainWindow->saveSilent(wizard->context, wizard->current); + wizard->current->setDirty(false); // lose changes + return true; } diff --git a/src/RideItem.cpp b/src/RideItem.cpp index 652ad1b83..7bd6779c2 100644 --- a/src/RideItem.cpp +++ b/src/RideItem.cpp @@ -72,9 +72,24 @@ RideItem::setRide(RideFile *overwrite) { RideFile *old = ride_; ride_ = overwrite; // overwrite + + // connect up to new one + connect(ride_, SIGNAL(modified()), this, SLOT(modified())); + connect(ride_, SIGNAL(saved()), this, SLOT(saved())); + connect(ride_, SIGNAL(reverted()), this, SLOT(reverted())); + + // don't bother with the old one any more + disconnect(old); + + // update status setDirty(true); notifyRideDataChanged(); - delete old; // now wipe it once referrers had chance to change + + //XXX SORRY ! memory leak XXX + //XXX delete old; // now wipe it once referrers had chance to change + //XXX this is only used by MergeActivityWizard and causes issues + //XXX because the data is accessed in separate threads (Wizard is a dialog) + //XXX because it is such an edge case (Merge) we will leave it for now } void