Skip to content

Commit

Permalink
Merge branch 'master' into overlay-alg-fixes-1
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Apr 18, 2018
2 parents 45b264d + 0e0e133 commit 721c536
Show file tree
Hide file tree
Showing 83 changed files with 1,771 additions and 540 deletions.
3 changes: 2 additions & 1 deletion .ci/travis/linux/before_script.sh
Expand Up @@ -32,6 +32,7 @@ echo "${bold}Travis environment variables${endbold}"
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
echo "TRAVIS_EVENT_TYPE: $TRAVIS_EVENT_TYPE"
echo "DOCKER_TAG: $DOCKER_TAG"
echo "TRAVIS_COMMIT_MESSAGE: $TRAVIS_COMMIT_MESSAGE"
echo "DOCKER_DEPS_PUSH: $DOCKER_DEPS_PUSH"
echo "DOCKER_DEPS_IMAGE_REBUILD: $DOCKER_DEPS_IMAGE_REBUILD"
echo "DOCKER_QGIS_IMAGE_BUILD_PUSH: $DOCKER_QGIS_IMAGE_BUILD_PUSH"
Expand All @@ -48,10 +49,10 @@ if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
docker-compose -f $DOCKER_COMPOSE config
fi

docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
if [[ $DOCKER_DEPS_IMAGE_REBUILD =~ true ]]; then
docker build --no-cache -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
else
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
fi
echo "travis_fold:end:docker_build"
Expand Down
29 changes: 15 additions & 14 deletions debian/control.in
Expand Up @@ -38,7 +38,8 @@ Build-Depends:
graphviz,
xvfb, xauth,
xfonts-base, xfonts-100dpi, xfonts-75dpi, xfonts-scalable,
#sid buster artful bionic# libosgearth-dev, qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#sid buster artful bionic# libosgearth-dev,
#artful bionic# qt3d5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#oracle# oracle-instantclient12.1-devel, oracle-instantclient12.1-basiclite, qtbase5-private-dev,
locales, ca-certificates, ninja-build
Build-Conflicts: libqgis-dev, qgis-dev
Expand Down Expand Up @@ -145,19 +146,19 @@ Description: QGIS - shared native gui library
.
This package contains the shared native gui library.

#artful bionic buster sid#Package: libqgis-3d{QGIS_ABI}
#artful bionic buster sid#Architecture: any
#artful bionic buster sid#Section: libs
#artful bionic buster sid#Depends:
#artful bionic buster sid# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#artful bionic buster sid# ${shlibs:Depends},
#artful bionic buster sid# ${misc:Depends}
#artful bionic buster sid#Description: QGIS - shared 3d library
#artful bionic buster sid# QGIS is a Geographic Information System (GIS) which manages, analyzes and
#artful bionic buster sid# display databases of geographic information.
#artful bionic buster sid# .
#artful bionic buster sid# This package contains the shared 3d library.
#artful bionic buster sid#
#artful bionic#Package: libqgis-3d{QGIS_ABI}
#artful bionic#Architecture: any
#artful bionic#Section: libs
#artful bionic#Depends:
#artful bionic# qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, qt3d-gltfsceneio-plugin, qt3d-scene2d-plugin,
#artful bionic# ${shlibs:Depends},
#artful bionic# ${misc:Depends}
#artful bionic#Description: QGIS - shared 3d library
#artful bionic# QGIS is a Geographic Information System (GIS) which manages, analyzes and
#artful bionic# display databases of geographic information.
#artful bionic# .
#artful bionic# This package contains the shared 3d library.
#artful bionic#
Package: libqgisgrass{GRASSVER}-{QGIS_ABI}
Architecture: any
Section: libs
Expand Down
2 changes: 1 addition & 1 deletion debian/libqgis-dev.install.in
Expand Up @@ -8,4 +8,4 @@ usr/lib/libqgis_server.so
usr/lib/libqgisgrass{GRASSVER}.so
usr/lib/libqgispython.so
usr/share/qgis/FindQGIS.cmake
#sid buster artful bionic#usr/lib/libqgis_3d.so
#artful bionic#usr/lib/libqgis_3d.so
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -102,7 +102,7 @@ ifneq (,$(findstring $(DISTRIBUTION),"sid buster stretch"))
CMAKE_OPTS += -DPOSTGRES_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libpq.so
endif

ifneq (,$(findstring $(DISTRIBUTION),"artful bionic buster sid"))
ifneq (,$(findstring $(DISTRIBUTION),"artful bionic"))
CMAKE_OPTS += \
-DWITH_3D=TRUE \
-DGEOS_LIBRARY=/usr/lib/$(DEB_BUILD_MULTIARCH)/libgeos_c.so
Expand Down
4 changes: 2 additions & 2 deletions external/libdxfrw/drw_base.h
Expand Up @@ -93,8 +93,8 @@ namespace DRW

enum DBG_LEVEL
{
NONE,
DEBUG
none,
debug
};

//! Special codes for colors
Expand Down
4 changes: 2 additions & 2 deletions external/libdxfrw/intern/drw_dbg.cpp
Expand Up @@ -67,7 +67,7 @@ DRW_dbg *DRW_dbg::getInstance()

DRW_dbg::DRW_dbg()
{
level = NONE;
level = none;
prClass = new print_none;
}

Expand All @@ -77,7 +77,7 @@ void DRW_dbg::setLevel( LEVEL lvl )
delete prClass;
switch ( level )
{
case DEBUG:
case debug:
prClass = new print_debug;
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions external/libdxfrw/intern/drw_dbg.h
Expand Up @@ -32,8 +32,8 @@ class DRW_dbg
public:
enum LEVEL
{
NONE,
DEBUG
none,
debug
};
void setLevel( LEVEL lvl );
LEVEL getLevel();
Expand Down
8 changes: 4 additions & 4 deletions external/libdxfrw/libdwgr.cpp
Expand Up @@ -53,7 +53,7 @@ dwgR::dwgR( const char *name )
, writer( nullptr )
#endif
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}

dwgR::~dwgR()
Expand All @@ -65,11 +65,11 @@ void dwgR::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}

Expand Down
11 changes: 6 additions & 5 deletions external/libdxfrw/libdxfrw.cpp
Expand Up @@ -62,7 +62,7 @@ dxfRW::dxfRW( const char *name )
, elParts( 128 ) //parts number when convert ellipse to polyline
, currHandle( 0 )
{
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}

dxfRW::~dxfRW()
Expand All @@ -79,11 +79,11 @@ void dxfRW::setDebug( DRW::DBG_LEVEL lvl )
{
switch ( lvl )
{
case DRW::DEBUG:
DRW_DBGSL( DRW_dbg::DEBUG );
case DRW::debug:
DRW_DBGSL( DRW_dbg::debug );
break;
default:
DRW_DBGSL( DRW_dbg::NONE );
DRW_DBGSL( DRW_dbg::none );
}
}

Expand Down Expand Up @@ -3398,7 +3398,8 @@ bool dxfRW::processImageDef()
return true;
}

/** Utility function
/**
* Utility function
* convert a int to string in hex
**/
std::string dxfRW::toHexStr( int n )
Expand Down
29 changes: 29 additions & 0 deletions python/core/expression/qgsexpression.sip.in
Expand Up @@ -66,6 +66,28 @@ Implicit sharing was added in 2.14
%End
public:

struct ParserError
{
enum ParserErrorType
{
Unknown,
FunctionUnknown,
FunctionWrongArgs,
FunctionInvalidParams,
FunctionNamedArgsError
};

ParserErrorType errorType;

int firstLine;

int firstColumn;

int lastLine;

int lastColumn;
};

QgsExpression( const QString &expr );
%Docstring
Creates a new expression based on the provided string.
Expand Down Expand Up @@ -109,6 +131,13 @@ Returns true if an error occurred when parsing the input expression
QString parserErrorString() const;
%Docstring
Returns parser error
%End

ParserError parserError() const;
%Docstring
Returns parser error details including location of error.

.. versionadded:: 3.0
%End

const QgsExpressionNode *rootNode() const;
Expand Down
20 changes: 20 additions & 0 deletions python/core/qgsproject.sip.in
Expand Up @@ -952,6 +952,26 @@ Sets the project's ``metadata`` store.
.. seealso:: :py:func:`metadata`

.. seealso:: :py:func:`metadataChanged`
%End

QSet<QgsMapLayer *> requiredLayers() const;
%Docstring
Returns a set of map layers that are required in the project and therefore they should not get
removed from the project. The set of layers may be configured by users in project properties.
and it is mainly a hint for the user interface to protect users from removing layers that important
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

.. versionadded:: 3.2
%End

void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
%Docstring
Configures a set of map layers that are required in the project and therefore they should not get
removed from the project. The set of layers may be configured by users in project properties.
and it is mainly a hint for the user interface to protect users from removing layers that important
in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

.. versionadded:: 3.2
%End

signals:
Expand Down
39 changes: 18 additions & 21 deletions python/plugins/db_manager/dlg_import_vector.py
Expand Up @@ -68,6 +68,8 @@ def __init__(self, inLayer, outDb, outUri, parent=None):
# updates of UI
self.setupWorkingMode(self.mode)
self.cboSchema.currentIndexChanged.connect(self.populateTables)
self.widgetSourceSrid.setCrs(QgsProject.instance().crs())
self.widgetTargetSrid.setCrs(QgsProject.instance().crs())

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

srcCrs = self.inLayer.crs()
srid = srcCrs.postgisSrid() if srcCrs.isValid() else 4326
self.editSourceSrid.setText("%s" % srid)
self.editTargetSrid.setText("%s" % srid)
if not srcCrs.isValid():
srcCrs = QgsCoordinateReferenceSystem(4326)
self.widgetSourceSrid.setCrs(srcCrs)
self.widgetTargetSrid.setCrs(srcCrs)

return True

Expand Down Expand Up @@ -270,27 +273,23 @@ def accept(self):

# sanity checks
if self.inLayer is None:
QMessageBox.information(self, self.tr("Import to database"), self.tr("Input layer missing or not valid"))
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Input layer missing or not valid."))
return

if self.cboTable.currentText() == "":
QMessageBox.information(self, self.tr("Import to database"), self.tr("Output table name is required"))
QMessageBox.critical(self, self.tr("Import to Database"), self.tr("Output table name is required."))
return

if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
try:
sourceSrid = self.editSourceSrid.text()
except ValueError:
QMessageBox.information(self, self.tr("Import to database"),
self.tr("Invalid source srid: must be an integer"))
if not self.widgetSourceSrid.crs().isValid():
QMessageBox.critical(self, self.tr("Import to Database"),
self.tr("Invalid source srid: must be a valid crs."))
return

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

with OverrideCursor(Qt.WaitCursor):
Expand Down Expand Up @@ -344,13 +343,11 @@ def accept(self):

outCrs = QgsCoordinateReferenceSystem()
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
targetSrid = int(self.editTargetSrid.text())
outCrs = QgsCoordinateReferenceSystem(targetSrid)
outCrs = self.widgetTargetSrid.crs()

# update input layer crs and encoding
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
sourceSrid = int(self.editSourceSrid.text())
inCrs = QgsCoordinateReferenceSystem(sourceSrid)
inCrs = self.widgetSourceSrid.crs()
self.inLayer.setCrs(inCrs)

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

if ret != 0:
output = QgsMessageViewer()
output.setTitle(self.tr("Import to database"))
output.setTitle(self.tr("Import to Database"))
output.setMessageAsPlainText(self.tr("Error {0}\n{1}").format(ret, errMsg))
output.showMessage()
return
Expand All @@ -383,7 +380,7 @@ def accept(self):

self.db.connection().reconnect()
self.db.refresh()
QMessageBox.information(self, self.tr("Import to database"), self.tr("Import was successful."))
QMessageBox.information(self, self.tr("Import to Database"), self.tr("Import was successful."))
return QDialog.accept(self)

def closeEvent(self, event):
Expand Down

0 comments on commit 721c536

Please sign in to comment.