Skip to content

Commit 721c536

Browse files
authored
Merge branch 'master' into overlay-alg-fixes-1
2 parents 45b264d + 0e0e133 commit 721c536

File tree

83 files changed

+1771
-540
lines changed

Some content is hidden

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

83 files changed

+1771
-540
lines changed

.ci/travis/linux/before_script.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ echo "${bold}Travis environment variables${endbold}"
3232
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
3333
echo "TRAVIS_EVENT_TYPE: $TRAVIS_EVENT_TYPE"
3434
echo "DOCKER_TAG: $DOCKER_TAG"
35+
echo "TRAVIS_COMMIT_MESSAGE: $TRAVIS_COMMIT_MESSAGE"
3536
echo "DOCKER_DEPS_PUSH: $DOCKER_DEPS_PUSH"
3637
echo "DOCKER_DEPS_IMAGE_REBUILD: $DOCKER_DEPS_IMAGE_REBUILD"
3738
echo "DOCKER_QGIS_IMAGE_BUILD_PUSH: $DOCKER_QGIS_IMAGE_BUILD_PUSH"
@@ -48,10 +49,10 @@ if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
4849
docker-compose -f $DOCKER_COMPOSE config
4950
fi
5051

51-
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
5252
if [[ $DOCKER_DEPS_IMAGE_REBUILD =~ true ]]; then
5353
docker build --no-cache -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
5454
else
55+
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
5556
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
5657
fi
5758
echo "travis_fold:end:docker_build"

debian/control.in

+15-14
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Build-Depends:
3838
graphviz,
3939
xvfb, xauth,
4040
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
41-
#sid buster artful bionic# libosgearth-dev, qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
41+
#sid buster artful bionic# libosgearth-dev,
42+
#artful bionic# qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
4243
#oracle# oracle-instantclient12.1-devel, oracle-instantclient12.1-basiclite, qtbase5-private-dev,
4344
locales, ca-certificates, ninja-build
4445
Build-Conflicts: libqgis-dev, qgis-dev
@@ -145,19 +146,19 @@ Description: QGIS - shared native gui library
145146
.
146147
This package contains the shared native gui library.
147148

148-
#artful bionic buster sid#Package: libqgis-3d{QGIS_ABI}
149-
#artful bionic buster sid#Architecture: any
150-
#artful bionic buster sid#Section: libs
151-
#artful bionic buster sid#Depends:
152-
#artful bionic buster sid# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
153-
#artful bionic buster sid# ${shlibs:Depends},
154-
#artful bionic buster sid# ${misc:Depends}
155-
#artful bionic buster sid#Description: QGIS - shared 3d library
156-
#artful bionic buster sid# QGIS is a Geographic Information System (GIS) which manages, analyzes and
157-
#artful bionic buster sid# display databases of geographic information.
158-
#artful bionic buster sid# .
159-
#artful bionic buster sid# This package contains the shared 3d library.
160-
#artful bionic buster sid#
149+
#artful bionic#Package: libqgis-3d{QGIS_ABI}
150+
#artful bionic#Architecture: any
151+
#artful bionic#Section: libs
152+
#artful bionic#Depends:
153+
#artful bionic# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
154+
#artful bionic# ${shlibs:Depends},
155+
#artful bionic# ${misc:Depends}
156+
#artful bionic#Description: QGIS - shared 3d library
157+
#artful bionic# QGIS is a Geographic Information System (GIS) which manages, analyzes and
158+
#artful bionic# display databases of geographic information.
159+
#artful bionic# .
160+
#artful bionic# This package contains the shared 3d library.
161+
#artful bionic#
161162
Package: libqgisgrass{GRASSVER}-{QGIS_ABI}
162163
Architecture: any
163164
Section: libs

debian/libqgis-dev.install.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ usr/lib/libqgis_server.so
88
usr/lib/libqgisgrass{GRASSVER}.so
99
usr/lib/libqgispython.so
1010
usr/share/qgis/FindQGIS.cmake
11-
#sid buster artful bionic#usr/lib/libqgis_3d.so
11+
#artful bionic#usr/lib/libqgis_3d.so

debian/rules

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ifneq (,$(findstring $(DISTRIBUTION),"sid buster stretch"))
102102
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
103103
endif
104104

105-
ifneq (,$(findstring $(DISTRIBUTION),"artful bionic buster sid"))
105+
ifneq (,$(findstring $(DISTRIBUTION),"artful bionic"))
106106
CMAKE_OPTS += \
107107
-DWITH_3D=TRUE \
108108
-DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so

external/libdxfrw/drw_base.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ namespace DRW
9393

9494
enum DBG_LEVEL
9595
{
96-
NONE,
97-
DEBUG
96+
none,
97+
debug
9898
};
9999

100100
//! Special codes for colors

external/libdxfrw/intern/drw_dbg.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ DRW_dbg *DRW_dbg::getInstance()
6767

6868
DRW_dbg::DRW_dbg()
6969
{
70-
level = NONE;
70+
level = none;
7171
prClass = new print_none;
7272
}
7373

@@ -77,7 +77,7 @@ void DRW_dbg::setLevel( LEVEL lvl )
7777
delete prClass;
7878
switch ( level )
7979
{
80-
case DEBUG:
80+
case debug:
8181
prClass = new print_debug;
8282
break;
8383
default:

external/libdxfrw/intern/drw_dbg.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class DRW_dbg
3232
public:
3333
enum LEVEL
3434
{
35-
NONE,
36-
DEBUG
35+
none,
36+
debug
3737
};
3838
void setLevel( LEVEL lvl );
3939
LEVEL getLevel();

external/libdxfrw/libdwgr.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dwgR::dwgR( const char *name )
5353
, writer( nullptr )
5454
#endif
5555
{
56-
DRW_DBGSL( DRW_dbg::NONE );
56+
DRW_DBGSL( DRW_dbg::none );
5757
}
5858

5959
dwgR::~dwgR()
@@ -65,11 +65,11 @@ void dwgR::setDebug( DRW::DBG_LEVEL lvl )
6565
{
6666
switch ( lvl )
6767
{
68-
case DRW::DEBUG:
69-
DRW_DBGSL( DRW_dbg::DEBUG );
68+
case DRW::debug:
69+
DRW_DBGSL( DRW_dbg::debug );
7070
break;
7171
default:
72-
DRW_DBGSL( DRW_dbg::NONE );
72+
DRW_DBGSL( DRW_dbg::none );
7373
}
7474
}
7575

external/libdxfrw/libdxfrw.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dxfRW::dxfRW( const char *name )
6262
, elParts( 128 ) //parts number when convert ellipse to polyline
6363
, currHandle( 0 )
6464
{
65-
DRW_DBGSL( DRW_dbg::NONE );
65+
DRW_DBGSL( DRW_dbg::none );
6666
}
6767

6868
dxfRW::~dxfRW()
@@ -79,11 +79,11 @@ void dxfRW::setDebug( DRW::DBG_LEVEL lvl )
7979
{
8080
switch ( lvl )
8181
{
82-
case DRW::DEBUG:
83-
DRW_DBGSL( DRW_dbg::DEBUG );
82+
case DRW::debug:
83+
DRW_DBGSL( DRW_dbg::debug );
8484
break;
8585
default:
86-
DRW_DBGSL( DRW_dbg::NONE );
86+
DRW_DBGSL( DRW_dbg::none );
8787
}
8888
}
8989

@@ -3398,7 +3398,8 @@ bool dxfRW::processImageDef()
33983398
return true;
33993399
}
34003400

3401-
/** Utility function
3401+
/**
3402+
* Utility function
34023403
* convert a int to string in hex
34033404
**/
34043405
std::string dxfRW::toHexStr( int n )

python/core/expression/qgsexpression.sip.in

+29
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ Implicit sharing was added in 2.14
6666
%End
6767
public:
6868

69+
struct ParserError
70+
{
71+
enum ParserErrorType
72+
{
73+
Unknown,
74+
FunctionUnknown,
75+
FunctionWrongArgs,
76+
FunctionInvalidParams,
77+
FunctionNamedArgsError
78+
};
79+
80+
ParserErrorType errorType;
81+
82+
int firstLine;
83+
84+
int firstColumn;
85+
86+
int lastLine;
87+
88+
int lastColumn;
89+
};
90+
6991
QgsExpression( const QString &expr );
7092
%Docstring
7193
Creates a new expression based on the provided string.
@@ -109,6 +131,13 @@ Returns true if an error occurred when parsing the input expression
109131
QString parserErrorString() const;
110132
%Docstring
111133
Returns parser error
134+
%End
135+
136+
ParserError parserError() const;
137+
%Docstring
138+
Returns parser error details including location of error.
139+
140+
.. versionadded:: 3.0
112141
%End
113142

114143
const QgsExpressionNode *rootNode() const;

python/core/qgsproject.sip.in

+20
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,26 @@ Sets the project's ``metadata`` store.
952952
.. seealso:: :py:func:`metadata`
953953

954954
.. seealso:: :py:func:`metadataChanged`
955+
%End
956+
957+
QSet<QgsMapLayer *> requiredLayers() const;
958+
%Docstring
959+
Returns a set of map layers that are required in the project and therefore they should not get
960+
removed from the project. The set of layers may be configured by users in project properties.
961+
and it is mainly a hint for the user interface to protect users from removing layers that important
962+
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.
963+
964+
.. versionadded:: 3.2
965+
%End
966+
967+
void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
968+
%Docstring
969+
Configures a set of map layers that are required in the project and therefore they should not get
970+
removed from the project. The set of layers may be configured by users in project properties.
971+
and it is mainly a hint for the user interface to protect users from removing layers that important
972+
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.
973+
974+
.. versionadded:: 3.2
955975
%End
956976

957977
signals:

python/plugins/db_manager/dlg_import_vector.py

+18-21
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def __init__(self, inLayer, outDb, outUri, parent=None):
6868
# updates of UI
6969
self.setupWorkingMode(self.mode)
7070
self.cboSchema.currentIndexChanged.connect(self.populateTables)
71+
self.widgetSourceSrid.setCrs(QgsProject.instance().crs())
72+
self.widgetTargetSrid.setCrs(QgsProject.instance().crs())
7173

7274
def setupWorkingMode(self, mode):
7375
""" hide the widget to select a layer/file if the input layer is already set """
@@ -210,9 +212,10 @@ def updateInputLayer(self):
210212
self.editGeomColumn.setText(geom)
211213

212214
srcCrs = self.inLayer.crs()
213-
srid = srcCrs.postgisSrid() if srcCrs.isValid() else 4326
214-
self.editSourceSrid.setText("%s" % srid)
215-
self.editTargetSrid.setText("%s" % srid)
215+
if not srcCrs.isValid():
216+
srcCrs = QgsCoordinateReferenceSystem(4326)
217+
self.widgetSourceSrid.setCrs(srcCrs)
218+
self.widgetTargetSrid.setCrs(srcCrs)
216219

217220
return True
218221

@@ -270,27 +273,23 @@ def accept(self):
270273

271274
# sanity checks
272275
if self.inLayer is None:
273-
QMessageBox.information(self, self.tr("Import to database"), self.tr("Input layer missing or not valid"))
276+
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Input layer missing or not valid."))
274277
return
275278

276279
if self.cboTable.currentText() == "":
277-
QMessageBox.information(self, self.tr("Import to database"), self.tr("Output table name is required"))
280+
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Output table name is required."))
278281
return
279282

280283
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
281-
try:
282-
sourceSrid = self.editSourceSrid.text()
283-
except ValueError:
284-
QMessageBox.information(self, self.tr("Import to database"),
285-
self.tr("Invalid source srid: must be an integer"))
284+
if not self.widgetSourceSrid.crs().isValid():
285+
QMessageBox.critical(self, self.tr("Import to Database"),
286+
self.tr("Invalid source srid: must be a valid crs."))
286287
return
287288

288289
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
289-
try:
290-
targetSrid = self.editTargetSrid.text()
291-
except ValueError:
292-
QMessageBox.information(self, self.tr("Import to database"),
293-
self.tr("Invalid target srid: must be an integer"))
290+
if not self.widgetTargetSrid.crs().isValid():
291+
QMessageBox.critical(self, self.tr("Import to Database"),
292+
self.tr("Invalid target srid: must be a valid crs."))
294293
return
295294

296295
with OverrideCursor(Qt.WaitCursor):
@@ -344,13 +343,11 @@ def accept(self):
344343

345344
outCrs = QgsCoordinateReferenceSystem()
346345
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
347-
targetSrid = int(self.editTargetSrid.text())
348-
outCrs = QgsCoordinateReferenceSystem(targetSrid)
346+
outCrs = self.widgetTargetSrid.crs()
349347

350348
# update input layer crs and encoding
351349
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
352-
sourceSrid = int(self.editSourceSrid.text())
353-
inCrs = QgsCoordinateReferenceSystem(sourceSrid)
350+
inCrs = self.widgetSourceSrid.crs()
354351
self.inLayer.setCrs(inCrs)
355352

356353
if self.chkEncoding.isEnabled() and self.chkEncoding.isChecked():
@@ -372,7 +369,7 @@ def accept(self):
372369

373370
if ret != 0:
374371
output = QgsMessageViewer()
375-
output.setTitle(self.tr("Import to database"))
372+
output.setTitle(self.tr("Import to Database"))
376373
output.setMessageAsPlainText(self.tr("Error {0}\n{1}").format(ret, errMsg))
377374
output.showMessage()
378375
return
@@ -383,7 +380,7 @@ def accept(self):
383380

384381
self.db.connection().reconnect()
385382
self.db.refresh()
386-
QMessageBox.information(self, self.tr("Import to database"), self.tr("Import was successful."))
383+
QMessageBox.information(self, self.tr("Import to Database"), self.tr("Import was successful."))
387384
return QDialog.accept(self)
388385

389386
def closeEvent(self, event):

0 commit comments

Comments
 (0)