Skip to content

Commit

Permalink
Once again fix QgsFeatureRequest::OrderBy on windows (followup b0bb873,…
Browse files Browse the repository at this point in the history
… 1d5d92e, 8f29f28 and 3c843a8)
  • Loading branch information
jef-n committed May 19, 2017
1 parent 59d97be commit 258c872
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
15 changes: 14 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -55,6 +55,7 @@ sub processDoxygenLine
my $SIP_RUN = 0;
my $HEADER_CODE = 0;
my @ACCESS = (PUBLIC);
my @EXPORTED = (0);
my $MULTILINE_DEFINITION = 0;

my $comment = '';
Expand Down Expand Up @@ -390,6 +391,11 @@ sub detect_comment_block{
if ($#ACCESS > 0){
pop(@global_bracket_nesting_index);
pop(@ACCESS);

die "Class $classname in $headerfile should be exported with appropriate [LIB]_EXPORT macro. If this should not be available in python, wrap it in a `#ifndef SIP_RUN` block."
if $EXPORTED[-1] == 0;

pop @EXPORTED;
}
if ($#ACCESS == 0){
dbg_info("reached top level");
Expand Down Expand Up @@ -455,6 +461,7 @@ sub detect_comment_block{
if ( $line =~ m/^\s*struct(\s+\w+_EXPORT)?\s+\w+$/ ) {
dbg_info(" going to struct => public");
push @ACCESS, PUBLIC;
push @EXPORTED, 0;
push @global_bracket_nesting_index, 0;
}

Expand All @@ -463,12 +470,13 @@ sub detect_comment_block{
if ( $line =~ m/^(\s*class)\s+([A-Z]+_EXPORT\s+)?(\w+)(\s*\:\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*(,\s*(public|private)\s+\w+(<([\w]|::)+>)?(::\w+(<\w+>)?)*)*)?(?<annot>\s*SIP_.*)?$/ ){
dbg_info("class definition started => private");
push @ACCESS, PRIVATE;
push @EXPORTED, 0;
push @global_bracket_nesting_index, 0;
my @template_inheritance_template = ();
my @template_inheritance_class = ();
do {no warnings 'uninitialized';
$classname = $3;
$line =~ m/\b[A-Z]+_EXPORT\b/ or die "Class $classname in $headerfile should be exported with appropriate [LIB]_EXPORT macro. If this should not be available in python, wrap it in a `#ifndef SIP_RUN` block.";
$EXPORTED[-1]++ if $line =~ m/\b[A-Z]+_EXPORT\b/;
};
$line = "$1 $3";
# Inheritance
Expand Down Expand Up @@ -626,6 +634,11 @@ sub detect_comment_block{
$line =~ s/\bnullptr\b/0/g;
$line =~ s/\s*=\s*default\b//g;

if( $line =~ /\w+_EXPORT/ ) {
$EXPORTED[-1]++;
$line =~ s/\b\w+_EXPORT\s+//g;
}

# remove constructor definition, function bodies, member initializing list
$SIP_RUN == 1 or detect_and_remove_following_body_or_initializerlist();

Expand Down
16 changes: 8 additions & 8 deletions src/core/qgsfeaturerequest.h
Expand Up @@ -215,49 +215,49 @@ class CORE_EXPORT QgsFeatureRequest
*
* \since QGIS 2.14
*/
class CORE_EXPORT OrderBy : public QList<QgsFeatureRequest::OrderByClause>
class OrderBy : public QList<QgsFeatureRequest::OrderByClause>
{
public:

/**
* Create a new empty order by
*/
OrderBy()
CORE_EXPORT OrderBy()
: QList<QgsFeatureRequest::OrderByClause>()
{}

/**
* Create a new order by from a list of clauses
*/
OrderBy( const QList<QgsFeatureRequest::OrderByClause> &other );
CORE_EXPORT OrderBy( const QList<QgsFeatureRequest::OrderByClause> &other );

/**
* Get a copy as a list of OrderByClauses
*
* This is only required in Python where the inheritance
* is not properly propagated and this makes it usable.
*/
QList<QgsFeatureRequest::OrderByClause> list() const;
QList<QgsFeatureRequest::OrderByClause> CORE_EXPORT list() const;

/**
* Serialize to XML
*/
void save( QDomElement &elem ) const;
void CORE_EXPORT save( QDomElement &elem ) const;

/**
* Deserialize from XML
*/
void load( const QDomElement &elem );
void CORE_EXPORT load( const QDomElement &elem );

/**
* Returns a set of used attributes
*/
QSet<QString> usedAttributes() const;
QSet<QString> CORE_EXPORT usedAttributes() const;

/**
* Dumps the content to an SQL equivalent syntax
*/
QString dump() const;
QString CORE_EXPORT dump() const;
};

/**
Expand Down

0 comments on commit 258c872

Please sign in to comment.