Skip to content

Commit 0c1792a

Browse files
committedSep 14, 2016
fix windows build (tests & bindings)
1 parent 7e220d7 commit 0c1792a

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed
 

‎python/core/qgsoptionalexpression.sip

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,55 @@
1515
***************************************************************************/
1616

1717
/**
18-
* \ingroup core
18+
* An expression with an additional enabled flag.
1919
*
20-
* QgsOptionalExpression is a container for an expression with an additional enabled/disabled flag.
20+
* This can be used for configuration options where an expression can be enabled
21+
* or diabled but when disabled it shouldn't lose it's information for the case
22+
* it gets re-enabled later on and a user shouldn't be force to redo the configuration.
2123
*
2224
* @note Added in QGIS 2.18
2325
*/
26+
2427
class QgsOptionalExpression
2528
{
2629
%TypeHeaderCode
2730
#include <qgsoptionalexpression.h>
2831
%End
2932
public:
3033
/**
31-
* A QgsOptionalExpression is disabled by default if default constructed.
34+
* Construct a default optional expression.
35+
* It will be disabled and with an empty expression.
3236
*/
3337
QgsOptionalExpression();
3438

3539
/**
36-
* A QgsOptionalExpression is enabled by default if constructed with an expression.
40+
* Construct an optional expression with the provided expression.
41+
* It will be enabled.
3742
*/
38-
QgsOptionalExpression( const QgsExpression& data );
43+
QgsOptionalExpression( const QgsExpression& expression );
3944

4045
/**
41-
* A QgsOptionalExptression constructed with enabled status and data
46+
* Construct an optional expression with the provided expression and enabled state.
4247
*/
43-
QgsOptionalExpression( const QgsExpression& data, bool enabled );
48+
QgsOptionalExpression( const QgsExpression& expression, bool enabled );
4449

4550
/**
46-
* Compare this QgsOptionalExptression to another one.
51+
* Compare this QgsOptionalExpression to another one.
4752
*
4853
* This will compare the enabled flag and call the == operator
4954
* of the contained class.
5055
*
5156
* @note Added in QGIS 2.18
5257
*/
53-
bool operator== ( const QgsOptionalExpression& other ) const;
54-
operator bool () const;
58+
int operator== ( const QgsOptionalExpression& other ) const;
59+
%MethodCode
60+
sipRes = *sipCpp == *a0;
61+
%End
62+
63+
int __bool__() const;
64+
%MethodCode
65+
sipRes = sipCpp->enabled();
66+
%End
5567

5668
/**
5769
* Check if this optional is enabled
@@ -89,12 +101,12 @@ class QgsOptionalExpression
89101
*
90102
* @note Added in QGIS 2.18
91103
*/
92-
void writeXml(QDomElement& parent );
104+
void writeXml( QDomElement& element );
93105

94106
/**
95107
* Read the optional expression from the provided QDomElement.
96108
*
97109
* @note Added in QGIS 2.18
98110
*/
99-
void readXml(const QDomElement& parent );
111+
void readXml( const QDomElement& element );
100112
};

‎src/core/qgsoptionalexpression.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
qgsoptionalexpression - %{Cpp:License:ClassName}
2+
qgsoptionalexpression.h - QgsOptionalExpression
33
44
---------------------
55
begin : 8.9.2016
@@ -26,7 +26,7 @@
2626
*
2727
* This can be used for configuration options where an expression can be enabled
2828
* or diabled but when disabled it shouldn't lose it's information for the case
29-
* it gets re-enabled later on and a user shoulnd't be force to redo the configuration.
29+
* it gets re-enabled later on and a user shouldn't be force to redo the configuration.
3030
*
3131
* @note Added in QGIS 2.18
3232
*/
@@ -69,4 +69,8 @@ class CORE_EXPORT QgsOptionalExpression : public QgsOptional<QgsExpression>
6969
void readXml( const QDomElement& element );
7070
};
7171

72+
#if defined(Q_OS_WIN)
73+
template CORE_EXPORT QgsOptional<QgsExpression>;
74+
#endif
75+
7276
#endif // QGSOPTIONALEXPRESSION_H

0 commit comments

Comments
 (0)
Please sign in to comment.