mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile: fix undo/redo
The signals of the undo-stack can only be connected after it was initialized. One of those cases where I would have preferred a crash over a warning message. The mobile version is extremely noisy! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
83fa38b3b4
commit
916c88ded9
1 changed files with 4 additions and 4 deletions
|
@ -321,10 +321,6 @@ QMLManager::QMLManager() :
|
|||
if (verbose)
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &QMLManager::divesChanged);
|
||||
|
||||
// get updates to the undo/redo texts
|
||||
connect(Command::getUndoStack(), &QUndoStack::undoTextChanged, this, &QMLManager::undoTextChanged);
|
||||
connect(Command::getUndoStack(), &QUndoStack::redoTextChanged, this, &QMLManager::redoTextChanged);
|
||||
|
||||
// now that everything is setup, connect the application changed signal
|
||||
connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged);
|
||||
|
||||
|
@ -334,6 +330,10 @@ QMLManager::QMLManager() :
|
|||
// setup Command infrastructure
|
||||
Command::init();
|
||||
undoAction = Command::undoAction(this);
|
||||
|
||||
// get updates to the undo/redo texts
|
||||
connect(Command::getUndoStack(), &QUndoStack::undoTextChanged, this, &QMLManager::undoTextChanged);
|
||||
connect(Command::getUndoStack(), &QUndoStack::redoTextChanged, this, &QMLManager::redoTextChanged);
|
||||
}
|
||||
|
||||
void QMLManager::applicationStateChanged(Qt::ApplicationState state)
|
||||
|
|
Loading…
Add table
Reference in a new issue