Skip to content

Commit

Permalink
Merge branch 'master' into deprecated_plugins_grayed_out
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty committed Sep 18, 2018
2 parents a041c50 + b5024c3 commit 840749c
Show file tree
Hide file tree
Showing 180 changed files with 2,154 additions and 1,721 deletions.
Empty file modified .ci/travis/linux/blacklist.txt 100755 → 100644
Empty file.
Empty file modified debian/rules 100755 → 100644
Empty file.
Empty file modified external/astyle/ASBeautifier.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/ASEnhancer.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/ASFormatter.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/ASLocalizer.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/ASLocalizer.h 100755 → 100644
Empty file.
Empty file modified external/astyle/ASResource.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/LICENSE.md 100755 → 100644
Empty file.
Empty file modified external/astyle/astyle.h 100755 → 100644
Empty file.
Empty file modified external/astyle/astyle_main.cpp 100755 → 100644
Empty file.
Empty file modified external/astyle/astyle_main.h 100755 → 100644
Empty file.
Empty file modified external/o2/src/o1.cpp 100755 → 100644
Empty file.
Empty file modified external/wintoast/LICENSE.txt 100755 → 100644
Empty file.
Empty file modified external/wintoast/README.md 100755 → 100644
Empty file.
Empty file modified external/wintoast/src/wintoastlib.cpp 100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions external/wintoast/src/wintoastlib.h 100755 → 100644
Expand Up @@ -35,6 +35,7 @@ namespace WinToastLib {
ApplicationHidden = ToastDismissalReason::ToastDismissalReason_ApplicationHidden,
TimedOut = ToastDismissalReason::ToastDismissalReason_TimedOut
};
virtual ~IWinToastHandler() = default;
virtual void toastActivated() const = 0;
virtual void toastActivated(int actionIndex) const = 0;
virtual void toastDismissed(WinToastDismissalReason state) const = 0;
Expand Down
1 change: 0 additions & 1 deletion images/images.qrc 100755 → 100644
Expand Up @@ -149,7 +149,6 @@
<file>themes/default/copyright_label.svg</file>
<file>themes/default/dbmanager.svg</file>
<file>themes/default/extents.svg</file>
<file>themes/default/externalLink.svg</file>
<file>themes/default/gpsicons/barchart.svg</file>
<file>themes/default/gpsicons/polarchart.svg</file>
<file>themes/default/grass_location.svg</file>
Expand Down
1 change: 0 additions & 1 deletion images/themes/default/externalLink.svg

This file was deleted.

9 changes: 8 additions & 1 deletion python/core/auto_generated/qgsapplication.sip.in
Expand Up @@ -143,7 +143,7 @@ for resources in their own datastores e.g. a Qt4 resource bundle.
be reverted to 'default'.
%End

static QString resolvePkgPath( );
static QString resolvePkgPath();
%Docstring
Calculate the application pkg path

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

.. versionadded:: 3.4
%End

static void setTranslation( const QString &translation );
%Docstring
Set translation

.. versionadded:: 3.4
%End

Expand Down
34 changes: 0 additions & 34 deletions python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -94,31 +94,6 @@ This is the base class for all map layer types (vector, raster).
typedef QFlags<QgsMapLayer::StyleCategory> StyleCategories;


struct ReadableStyleCategory
{
public:
ReadableStyleCategory( const QString &name, const QString &toolTip = QString() );
%Docstring
Create a ReadableStyleCategory
%End
ReadableStyleCategory( const QString &name, const QIcon &icon, const QString &toolTip = QString() );
%Docstring
Create a ReadableStyleCategory
%End
QString name() const;
%Docstring
Return the translated name of the category
%End
QString toolTip() const;
%Docstring
Return the translated tooltip of the category
%End
QIcon icon() const;
%Docstring
Return the icon of the category
%End
};

QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString(), const QString &source = QString() );
%Docstring
Constructor for QgsMapLayer
Expand Down Expand Up @@ -181,15 +156,6 @@ Returns the extension of a Property.
.. versionadded:: 3.0
%End

static ReadableStyleCategory readableStyleCategory( StyleCategory category );
%Docstring
Readable and Translated category

.. versionadded:: 3.4
%End



QString id() const;
%Docstring
Returns the layer's unique ID, which is used to access this layer from :py:class:`QgsProject`.
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsxmlutils.sip.in
Expand Up @@ -60,6 +60,7 @@ Supported types are
- QVariant.Double
- QVariant.String
- :py:class:`QgsProperty` (since QGIS 3.4)
- :py:class:`QgsCoordinateReferenceSystem` (since QGIS 3.4)
%End

static QVariant readVariant( const QDomElement &element );
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/gdal/GdalUtils.py
Expand Up @@ -447,5 +447,5 @@ def gdal_crs_string(crs):
if crs.authid().upper().startswith('EPSG:'):
return crs.authid()

# fallback to proj4 string
return crs.toProj4()
# fallback to proj4 string, stripping out newline characters
return crs.toProj4().replace('\n', ' ').replace('\r', ' ')
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/gdalcalc.py
Expand Up @@ -176,7 +176,7 @@ def groupId(self):
return 'rastermiscellaneous'

def commandName(self):
return 'gdal_calc'
return 'gdal_calc' if isWindows() else 'gdal_calc.py'

def getConsoleCommands(self, parameters, context, feedback, executing=True):
out = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -330,6 +330,9 @@ def prepareGrassExecution(commands):
Prepare GRASS batch job in a script and
returns it as a command ready for subprocess.
"""
if Grass7Utils.command is None:
Grass7Utils.grassBin()

env = os.environ.copy()
env['GRASS_MESSAGE_FORMAT'] = 'plain'
if 'GISBASE' in env:
Expand Down
4 changes: 3 additions & 1 deletion python/plugins/processing/algs/qgis/Aggregate.py
Expand Up @@ -34,6 +34,7 @@
QgsField,
QgsFields,
QgsGeometry,
QgsProcessing,
QgsProcessingParameterDefinition,
QgsProcessingParameterExpression,
QgsProcessingParameterFeatureSink,
Expand Down Expand Up @@ -68,7 +69,8 @@ def displayName(self):

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input layer')))
self.tr('Input layer'),
types=[QgsProcessing.TypeVector]))
self.addParameter(QgsProcessingParameterExpression(self.GROUP_BY,
self.tr('Group by expression (NULL to group all features)'),
defaultValue='NULL',
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/PointsInPolygon.py
Expand Up @@ -117,7 +117,7 @@ def processAlgorithm(self, parameters, context, feedback):

fields = poly_source.fields()
if fields.lookupField(field_name) < 0:
fields.append(QgsField(field_name, QVariant.Int))
fields.append(QgsField(field_name, QVariant.LongLong))
field_index = fields.lookupField(field_name)

(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/HistoryDialog.py
Expand Up @@ -116,7 +116,7 @@ def executeAlgorithm(self):
if isinstance(item, TreeLogEntryItem):
if item.isAlg:
script = 'import processing\n'
script += 'from qgis.core import QgsProcessingOutputLayerDefinition, QgsProcessingFeatureSourceDefinition, QgsProperty\n'
script += 'from qgis.core import QgsProcessingOutputLayerDefinition, QgsProcessingFeatureSourceDefinition, QgsProperty, QgsCoordinateReferenceSystem\n'
script += item.entry.text.replace('processing.run(', 'processing.execAlgorithmDialog(')
self.close()
exec(script)
Expand Down
9 changes: 6 additions & 3 deletions python/plugins/processing/gui/wrappers.py
Expand Up @@ -638,11 +638,14 @@ def _getOptions(self):
[QgsProcessingOutputRasterLayer,
QgsProcessingOutputMapLayer,
QgsProcessingOutputMultipleLayers])
elif self.parameterDefinition().layerType() == QgsProcessing.TypeVector:
options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
elif self.parameterDefinition().layerType() == QgsProcessing.TypeMapLayer:
options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterRasterLayer,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterMultipleLayers),
[QgsProcessingOutputVectorLayer,
[QgsProcessingOutputRasterLayer,
QgsProcessingOutputVectorLayer,
QgsProcessingOutputMapLayer,
QgsProcessingOutputMultipleLayers])
else:
options = self.dialog.getAvailableValuesOfType(QgsProcessingParameterFile, QgsProcessingOutputFile)
Expand Down
24 changes: 10 additions & 14 deletions python/plugins/processing/modeler/ProjectProvider.py
Expand Up @@ -45,7 +45,7 @@ def __init__(self, project=None):
else:
self.project = project

self.model_definitions = [] # list of maps defining models
self.model_definitions = {} # dict of models in project
self.is_loading = False

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

def add_model(self, model):
Expand All @@ -77,7 +77,7 @@ def add_model(self, model):
:param model: model to add
"""
definition = model.toVariant()
self.model_definitions.append(definition)
self.model_definitions[model.name()] = definition
self.refreshAlgorithms()

def remove_model(self, model):
Expand All @@ -89,31 +89,27 @@ def remove_model(self, model):
if model is None:
return

filtered_model_definitions = []
for m in self.model_definitions:
algorithm = QgsProcessingModelAlgorithm()
if algorithm.loadVariant(m) and algorithm.name() == model.name():
# found matching model definition, skip it
continue
filtered_model_definitions.append(m)
if model.name() in self.model_definitions:
del self.model_definitions[model.name()]

self.model_definitions = filtered_model_definitions
self.refreshAlgorithms()

def read_project(self, doc):
"""
Reads the project model definitions from the project DOM document
:param doc: DOM document
"""
self.model_definitions = []
self.model_definitions = {}
project_models_nodes = doc.elementsByTagName('projectModels')
if project_models_nodes:
project_models_node = project_models_nodes.at(0)
model_nodes = project_models_node.childNodes()
for n in range(model_nodes.count()):
model_element = model_nodes.at(n).toElement()
definition = QgsXmlUtils.readVariant(model_element)
self.model_definitions.append(definition)
algorithm = QgsProcessingModelAlgorithm()
if algorithm.loadVariant(definition):
self.model_definitions[algorithm.name()] = definition

self.refreshAlgorithms()

Expand Down Expand Up @@ -158,7 +154,7 @@ def loadAlgorithms(self):
return
self.is_loading = True

for definition in self.model_definitions:
for definition in self.model_definitions.values():
algorithm = QgsProcessingModelAlgorithm()
if algorithm.loadVariant(definition):
self.addAlgorithm(algorithm)
Expand Down

0 comments on commit 840749c

Please sign in to comment.