mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix Merge Wizard Saving Bug
.. RideItem() is horrible .. but it kinda works so just work around it
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user