Package: qgis / 2.4.0-1

0001-Only-add-feature-once-when-python-init-function-is-s.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From bd5846b5893a488c6dadfc2b160ccf0400add513 Mon Sep 17 00:00:00 2001
From: Matthias Kuhn <matthias.kuhn@gmx.ch>
Date: Tue, 22 Jul 2014 23:08:30 +0200
Subject: =?UTF-8?q?Only=20add=20feature=20once=20when=20python=20init=20func?=
 =?UTF-8?q?tion=20is=20set=20on=20attribute=20form=0AFix=20#10862?=
Origin: https://github.com/qgis/QGIS/commit/bd5846b5893a488c6dadfc2b160ccf0400add513
Bug: http://hub.qgis.org/issues/10862


--- a/src/gui/qgsattributeformlegacyinterface.cpp
+++ b/src/gui/qgsattributeformlegacyinterface.cpp
@@ -46,6 +46,9 @@ void QgsAttributeFormLegacyInterface::fe
   QDialogButtonBox* buttonBox = form()->findChild<QDialogButtonBox*>();
   if ( buttonBox )
   {
+    // If the init function did not call disconnect, we do it here before reconnecting
+    // If it did call disconnect, then the call will just do nothing
+    QObject::disconnect( buttonBox, SIGNAL( accepted() ), form(), SLOT( accept() ) );
     QObject::connect( buttonBox, SIGNAL( accepted() ), form(), SLOT( accept() ) );
   }