Skip to content

Commit

Permalink
Only apply f4d38d4 to Qt>=5.9 (followup f4d38d4; check cdash for
Browse files Browse the repository at this point in the history
test results)
  • Loading branch information
jef-n committed May 4, 2018
1 parent 9836dc2 commit 398fb1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -32,7 +32,9 @@
#include <QDomNode>
#include <QVector>
#include <QStringBuilder>
#if QT_VERSION >= 0x050900
#include <QUndoCommand>
#endif

#include "qgssettings.h"
#include "qgsvectorlayer.h"
Expand Down Expand Up @@ -3097,15 +3099,15 @@ void QgsVectorLayer::destroyEditCommand()
undoStack()->endMacro();
undoStack()->undo();

#if QT_VERSION >= 0x050900 // setObsolete is new in Qt 5.9
// it's not directly possible to pop the last command off the stack (the destroyed one)
// and delete, so we add a dummy obsolete command to force this to occur.
// Pushing the new command deletes the destroyed one, and since the new
// command is obsolete it's automatically deleted by the undo stack.
std::unique_ptr< QUndoCommand > command = qgis::make_unique< QUndoCommand >();
#if QT_VERSION >= 0x050900
command->setObsolete( true );
#endif
undoStack()->push( command.release() );
#endif

mEditCommandActive = false;
mDeletedFids.clear();
Expand Down

0 comments on commit 398fb1a

Please sign in to comment.