Skip to content

Commit 840749c

Browse files
authored
Merge branch 'master' into deprecated_plugins_grayed_out
2 parents a041c50 + b5024c3 commit 840749c

File tree

180 files changed

+2154
-1721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+2154
-1721
lines changed

.ci/travis/linux/blacklist.txt

100755100644
File mode changed.

debian/rules

100755100644
File mode changed.

external/astyle/ASBeautifier.cpp

100755100644
File mode changed.

external/astyle/ASEnhancer.cpp

100755100644
File mode changed.

external/astyle/ASFormatter.cpp

100755100644
File mode changed.

external/astyle/ASLocalizer.cpp

100755100644
File mode changed.

external/astyle/ASLocalizer.h

100755100644
File mode changed.

external/astyle/ASResource.cpp

100755100644
File mode changed.

external/astyle/LICENSE.md

100755100644
File mode changed.

external/astyle/astyle.h

100755100644
File mode changed.

external/astyle/astyle_main.cpp

100755100644
File mode changed.

external/astyle/astyle_main.h

100755100644
File mode changed.

external/o2/src/o1.cpp

100755100644
File mode changed.

external/wintoast/LICENSE.txt

100755100644
File mode changed.

external/wintoast/README.md

100755100644
File mode changed.

external/wintoast/src/wintoastlib.cpp

100755100644
File mode changed.

external/wintoast/src/wintoastlib.h

100755100644
+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace WinToastLib {
3535
ApplicationHidden = ToastDismissalReason::ToastDismissalReason_ApplicationHidden,
3636
TimedOut = ToastDismissalReason::ToastDismissalReason_TimedOut
3737
};
38+
virtual ~IWinToastHandler() = default;
3839
virtual void toastActivated() const = 0;
3940
virtual void toastActivated(int actionIndex) const = 0;
4041
virtual void toastDismissed(WinToastDismissalReason state) const = 0;

images/images.qrc

100755100644
-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
<file>themes/default/copyright_label.svg</file>
150150
<file>themes/default/dbmanager.svg</file>
151151
<file>themes/default/extents.svg</file>
152-
<file>themes/default/externalLink.svg</file>
153152
<file>themes/default/gpsicons/barchart.svg</file>
154153
<file>themes/default/gpsicons/polarchart.svg</file>
155154
<file>themes/default/grass_location.svg</file>

images/themes/default/externalLink.svg

-1
This file was deleted.

python/core/auto_generated/qgsapplication.sip.in

+8-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ for resources in their own datastores e.g. a Qt4 resource bundle.
143143
be reverted to 'default'.
144144
%End
145145

146-
static QString resolvePkgPath( );
146+
static QString resolvePkgPath();
147147
%Docstring
148148
Calculate the application pkg path
149149

@@ -807,6 +807,13 @@ The maximum number of concurrent connections per connections pool.
807807
QGIS may in some situations allocate more than this amount
808808
of connections to avoid deadlocks.
809809

810+
.. versionadded:: 3.4
811+
%End
812+
813+
static void setTranslation( const QString &translation );
814+
%Docstring
815+
Set translation
816+
810817
.. versionadded:: 3.4
811818
%End
812819

python/core/auto_generated/qgsmaplayer.sip.in

-34
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,6 @@ This is the base class for all map layer types (vector, raster).
9494
typedef QFlags<QgsMapLayer::StyleCategory> StyleCategories;
9595

9696

97-
struct ReadableStyleCategory
98-
{
99-
public:
100-
ReadableStyleCategory( const QString &name, const QString &toolTip = QString() );
101-
%Docstring
102-
Create a ReadableStyleCategory
103-
%End
104-
ReadableStyleCategory( const QString &name, const QIcon &icon, const QString &toolTip = QString() );
105-
%Docstring
106-
Create a ReadableStyleCategory
107-
%End
108-
QString name() const;
109-
%Docstring
110-
Return the translated name of the category
111-
%End
112-
QString toolTip() const;
113-
%Docstring
114-
Return the translated tooltip of the category
115-
%End
116-
QIcon icon() const;
117-
%Docstring
118-
Return the icon of the category
119-
%End
120-
};
121-
12297
QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString(), const QString &source = QString() );
12398
%Docstring
12499
Constructor for QgsMapLayer
@@ -181,15 +156,6 @@ Returns the extension of a Property.
181156
.. versionadded:: 3.0
182157
%End
183158

184-
static ReadableStyleCategory readableStyleCategory( StyleCategory category );
185-
%Docstring
186-
Readable and Translated category
187-
188-
.. versionadded:: 3.4
189-
%End
190-
191-
192-
193159
QString id() const;
194160
%Docstring
195161
Returns the layer's unique ID, which is used to access this layer from :py:class:`QgsProject`.

python/core/auto_generated/qgsxmlutils.sip.in

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Supported types are
6060
- QVariant.Double
6161
- QVariant.String
6262
- :py:class:`QgsProperty` (since QGIS 3.4)
63+
- :py:class:`QgsCoordinateReferenceSystem` (since QGIS 3.4)
6364
%End
6465

6566
static QVariant readVariant( const QDomElement &element );

python/plugins/processing/algs/gdal/GdalUtils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -447,5 +447,5 @@ def gdal_crs_string(crs):
447447
if crs.authid().upper().startswith('EPSG:'):
448448
return crs.authid()
449449

450-
# fallback to proj4 string
451-
return crs.toProj4()
450+
# fallback to proj4 string, stripping out newline characters
451+
return crs.toProj4().replace('\n', ' ').replace('\r', ' ')

python/plugins/processing/algs/gdal/gdalcalc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def groupId(self):
176176
return 'rastermiscellaneous'
177177

178178
def commandName(self):
179-
return 'gdal_calc'
179+
return 'gdal_calc' if isWindows() else 'gdal_calc.py'
180180

181181
def getConsoleCommands(self, parameters, context, feedback, executing=True):
182182
out = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)

python/plugins/processing/algs/grass7/Grass7Utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ def prepareGrassExecution(commands):
330330
Prepare GRASS batch job in a script and
331331
returns it as a command ready for subprocess.
332332
"""
333+
if Grass7Utils.command is None:
334+
Grass7Utils.grassBin()
335+
333336
env = os.environ.copy()
334337
env['GRASS_MESSAGE_FORMAT'] = 'plain'
335338
if 'GISBASE' in env:

python/plugins/processing/algs/qgis/Aggregate.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
QgsField,
3535
QgsFields,
3636
QgsGeometry,
37+
QgsProcessing,
3738
QgsProcessingParameterDefinition,
3839
QgsProcessingParameterExpression,
3940
QgsProcessingParameterFeatureSink,
@@ -68,7 +69,8 @@ def displayName(self):
6869

6970
def initAlgorithm(self, config=None):
7071
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
71-
self.tr('Input layer')))
72+
self.tr('Input layer'),
73+
types=[QgsProcessing.TypeVector]))
7274
self.addParameter(QgsProcessingParameterExpression(self.GROUP_BY,
7375
self.tr('Group by expression (NULL to group all features)'),
7476
defaultValue='NULL',

python/plugins/processing/algs/qgis/PointsInPolygon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def processAlgorithm(self, parameters, context, feedback):
117117

118118
fields = poly_source.fields()
119119
if fields.lookupField(field_name) < 0:
120-
fields.append(QgsField(field_name, QVariant.Int))
120+
fields.append(QgsField(field_name, QVariant.LongLong))
121121
field_index = fields.lookupField(field_name)
122122

123123
(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,

python/plugins/processing/gui/HistoryDialog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def executeAlgorithm(self):
116116
if isinstance(item, TreeLogEntryItem):
117117
if item.isAlg:
118118
script = 'import processing\n'
119-
script += 'from qgis.core import QgsProcessingOutputLayerDefinition, QgsProcessingFeatureSourceDefinition, QgsProperty\n'
119+
script += 'from qgis.core import QgsProcessingOutputLayerDefinition, QgsProcessingFeatureSourceDefinition, QgsProperty, QgsCoordinateReferenceSystem\n'
120120
script += item.entry.text.replace('processing.run(', 'processing.execAlgorithmDialog(')
121121
self.close()
122122
exec(script)

python/plugins/processing/gui/wrappers.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,14 @@ def _getOptions(self):
638638
[QgsProcessingOutputRasterLayer,
639639
QgsProcessingOutputMapLayer,
640640
QgsProcessingOutputMultipleLayers])
641-
elif self.parameterDefinition().layerType() == QgsProcessing.TypeVector:
642-
options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
641+
elif self.parameterDefinition().layerType() == QgsProcessing.TypeMapLayer:
642+
options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterRasterLayer,
643+
QgsProcessingParameterFeatureSource,
643644
QgsProcessingParameterVectorLayer,
644645
QgsProcessingParameterMultipleLayers),
645-
[QgsProcessingOutputVectorLayer,
646+
[QgsProcessingOutputRasterLayer,
647+
QgsProcessingOutputVectorLayer,
648+
QgsProcessingOutputMapLayer,
646649
QgsProcessingOutputMultipleLayers])
647650
else:
648651
options = self.dialog.getAvailableValuesOfType(QgsProcessingParameterFile, QgsProcessingOutputFile)

python/plugins/processing/modeler/ProjectProvider.py

+10-14
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, project=None):
4545
else:
4646
self.project = project
4747

48-
self.model_definitions = [] # list of maps defining models
48+
self.model_definitions = {} # dict of models in project
4949
self.is_loading = False
5050

5151
# must reload models if providers list is changed - previously unavailable algorithms
@@ -67,7 +67,7 @@ def clear(self):
6767
"""
6868
Remove all algorithms from the provider
6969
"""
70-
self.model_definitions = []
70+
self.model_definitions = {}
7171
self.refreshAlgorithms()
7272

7373
def add_model(self, model):
@@ -77,7 +77,7 @@ def add_model(self, model):
7777
:param model: model to add
7878
"""
7979
definition = model.toVariant()
80-
self.model_definitions.append(definition)
80+
self.model_definitions[model.name()] = definition
8181
self.refreshAlgorithms()
8282

8383
def remove_model(self, model):
@@ -89,31 +89,27 @@ def remove_model(self, model):
8989
if model is None:
9090
return
9191

92-
filtered_model_definitions = []
93-
for m in self.model_definitions:
94-
algorithm = QgsProcessingModelAlgorithm()
95-
if algorithm.loadVariant(m) and algorithm.name() == model.name():
96-
# found matching model definition, skip it
97-
continue
98-
filtered_model_definitions.append(m)
92+
if model.name() in self.model_definitions:
93+
del self.model_definitions[model.name()]
9994

100-
self.model_definitions = filtered_model_definitions
10195
self.refreshAlgorithms()
10296

10397
def read_project(self, doc):
10498
"""
10599
Reads the project model definitions from the project DOM document
106100
:param doc: DOM document
107101
"""
108-
self.model_definitions = []
102+
self.model_definitions = {}
109103
project_models_nodes = doc.elementsByTagName('projectModels')
110104
if project_models_nodes:
111105
project_models_node = project_models_nodes.at(0)
112106
model_nodes = project_models_node.childNodes()
113107
for n in range(model_nodes.count()):
114108
model_element = model_nodes.at(n).toElement()
115109
definition = QgsXmlUtils.readVariant(model_element)
116-
self.model_definitions.append(definition)
110+
algorithm = QgsProcessingModelAlgorithm()
111+
if algorithm.loadVariant(definition):
112+
self.model_definitions[algorithm.name()] = definition
117113

118114
self.refreshAlgorithms()
119115

@@ -158,7 +154,7 @@ def loadAlgorithms(self):
158154
return
159155
self.is_loading = True
160156

161-
for definition in self.model_definitions:
157+
for definition in self.model_definitions.values():
162158
algorithm = QgsProcessingModelAlgorithm()
163159
if algorithm.loadVariant(definition):
164160
self.addAlgorithm(algorithm)

0 commit comments

Comments
 (0)