Skip to content

Commit c7e37e8

Browse files
committedDec 23, 2017
[sipify] Correctly convert doxygen warning blocks to sphinx warnings
1 parent 87b8a37 commit c7e37e8

File tree

9 files changed

+36
-10
lines changed

9 files changed

+36
-10
lines changed
 

‎python/core/geocms/geonode/qgsgeonoderequest.sip

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ Any existing request will be aborted.
103103

104104
Calling this method does not block while waiting for a result.
105105

106-
\warning When using the non-blocking methods in this class, sending
106+
.. warning::
107+
108+
When using the non-blocking methods in this class, sending
107109
overlapping requests results in undefined behavior. Use separate instances
108110
of QgsGeoNodeRequest instead to avoid this.
109111

@@ -129,7 +131,9 @@ with the result.
129131

130132
This method is non-blocking and returns immediately.
131133

132-
\warning When using the non-blocking methods in this class, sending
134+
.. warning::
135+
136+
When using the non-blocking methods in this class, sending
133137
overlapping requests results in undefined behavior. Use separate instances
134138
of QgsGeoNodeRequest instead to avoid this.
135139

‎python/core/locator/qgslocator.sip

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ Destructor for QgsLocator. Destruction will block while any currently running qu
5252
%Docstring
5353
Registers a ``filter`` within the locator. Ownership of the filter is transferred to the
5454
locator.
55-
\warning Plugins which register filters to the locator must take care to correctly call
55+
56+
.. warning::
57+
58+
Plugins which register filters to the locator must take care to correctly call
5659
deregisterFilter() and deregister their filters upon plugin unload to avoid crashes.
5760

5861
.. seealso:: :py:func:`deregisterFilter()`

‎python/core/qgscoordinatetransform.sip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ to utilize.
6565
Python scripts should generally use the constructor variant which accepts
6666
a QgsProject instance instead of this constructor.
6767

68-
\warning Do NOT use an empty/default constructed QgsCoordinateTransformContext()
68+
.. warning::
69+
70+
Do NOT use an empty/default constructed QgsCoordinateTransformContext()
6971
object when creating QgsCoordinateTransform objects. This prevents correct
7072
datum transform handling and may result in inaccurate transformations. Always
7173
ensure that the QgsCoordinateTransformContext object is correctly retrieved

‎python/core/qgscoordinatetransformcontext.sip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ The map keys will be :py:func:`QgsCoordinateReferenceSystems.authid()`s.
7979
If either the source transform ID or destination transform ID is -1, then no datum transform is
8080
required for transformations for that source or destination.
8181

82-
\warning This method should not be used to calculate the corresponding datum transforms
82+
.. warning::
83+
84+
This method should not be used to calculate the corresponding datum transforms
8385
to use for a coordinate transform. Instead, always use calculateDatumTransforms()
8486
to determine this.
8587

‎python/core/symbology/qgsrenderer.sip

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ be followed by a corresponding call to stopRender() after all features have been
115115

116116
.. seealso:: :py:func:`stopRender()`
117117

118-
\warning This method is not thread safe. Before calling startRender() in a non-main thread,
118+
119+
.. warning::
120+
121+
This method is not thread safe. Before calling startRender() in a non-main thread,
119122
the renderer should instead be cloned and startRender()/stopRender() called on the clone.
120123
%End
121124

@@ -125,7 +128,9 @@ Must be called when a render cycle has finished, to allow the renderer to clean
125128

126129
Calls to stopRender() must always be preceded by a call to startRender().
127130

128-
\warning This method is not thread safe. Before calling startRender() in a non-main thread,
131+
.. warning::
132+
133+
This method is not thread safe. Before calling startRender() in a non-main thread,
129134
the renderer should instead be cloned and startRender()/stopRender() called on the clone.
130135

131136
.. seealso:: :py:func:`startRender()`

‎python/gui/qgisinterface.sip

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,10 @@ More information here: http://qt-project.org/forums/viewthread/27098
912912
%Docstring
913913
Registers a locator ``filter`` for the app's locator bar. Ownership of the filter is transferred to the
914914
locator.
915-
\warning Plugins which register filters to the locator bar must take care to correctly call
915+
916+
.. warning::
917+
918+
Plugins which register filters to the locator bar must take care to correctly call
916919
deregisterLocatorFilter() and deregister their filters upon plugin unload to avoid crashes.
917920

918921
.. seealso:: :py:func:`deregisterLocatorFilter()`

‎python/gui/qgsprojectionselectiondialog.sip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ by the given Coordinate Reference Systems.
9797
list of projections by. This is useful in (e.g.) WMS situations
9898
where you just want to offer what the WMS server can support.
9999

100-
\warning This function's behavior is undefined if it is called after the dialog is shown.
100+
.. warning::
101+
102+
This function's behavior is undefined if it is called after the dialog is shown.
101103
%End
102104

103105
};

‎python/gui/qgsprojectionselectiontreewidget.sip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ by the given Coordinate Reference Systems.
135135
list of projections by. This is useful in (e.g.) WMS situations
136136
where you just want to offer what the WMS server can support.
137137

138-
\warning This function's behavior is undefined if it is called after the widget is shown.
138+
.. warning::
139+
140+
This function's behavior is undefined if it is called after the widget is shown.
139141
%End
140142

141143
void pushProjectionToFront();

‎scripts/sipify.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ sub processDoxygenLine {
203203
if ( $line =~ m/[\\@]note (.*)/ ) {
204204
return "\n.. note::\n\n $1\n";
205205
}
206+
if ( $line =~ m/[\\@]warning (.*)/ ) {
207+
return "\n.. warning::\n\n $1\n";
208+
}
206209
if ( $line =~ m/[\\@]brief (.*)/ ) {
207210
return " $1\n";
208211
}

0 commit comments

Comments
 (0)
Please sign in to comment.