Skip to content
Permalink
Browse files

Only apply f4d38d4 to Qt>=5.9 (followup f4d38d4; check cdash for

test results)
  • Loading branch information
jef-n committed May 4, 2018
1 parent 9836dc2 commit 398fb1a7f61d73269d04b388ad1627dfa26010d1
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/core/qgsvectorlayer.cpp
@@ -32,7 +32,9 @@
#include <QDomNode>
#include <QVector>
#include <QStringBuilder>
#if QT_VERSION >= 0x050900
#include <QUndoCommand>
#endif

#include "qgssettings.h"
#include "qgsvectorlayer.h"
@@ -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();

0 comments on commit 398fb1a

Please sign in to comment.
You can’t perform that action at this time.