Skip to content

Commit af236c4

Browse files
authoredOct 24, 2016
Merge pull request #3628 from rouault/dbmanager_gpkg
[DBManager] Add dedicated GeoPackage plugin
2 parents 72229c1 + d32a949 commit af236c4

File tree

22 files changed

+1692
-99
lines changed

22 files changed

+1692
-99
lines changed
 

‎ci/travis/linux/blacklist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ qgis_composermapgridtest
55
qgis_composerutils
66
ProcessingGrass7AlgorithmsImageryTest
77
ProcessingGrass7AlgorithmsRasterTest
8+
PyQgsDBManagerGpkg

‎python/plugins/db_manager/db_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def __init__(self, parent=None):
300300
self.importVector.connect(self.vectorImport)
301301

302302
self.hasSpatialiteSupport = "spatialite" in supportedDbTypes()
303+
self.hasGPKGSupport = "gpkg" in supportedDbTypes()
303304

304305
self.rootItem = TreeItem(None, None)
305306
for dbtype in supportedDbTypes():
@@ -401,7 +402,7 @@ def flags(self, index):
401402
flags |= Qt.ItemIsDropEnabled
402403

403404
# SL/Geopackage db files can be dropped everywhere in the tree
404-
if self.hasSpatialiteSupport:
405+
if self.hasSpatialiteSupport or self.hasGPKGSupport:
405406
flags |= Qt.ItemIsDropEnabled
406407

407408
return flags

‎python/plugins/db_manager/db_plugins/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ADD_SUBDIRECTORY(postgis)
22
ADD_SUBDIRECTORY(spatialite)
3+
ADD_SUBDIRECTORY(gpkg)
34
IF(WITH_ORACLE)
45
ADD_SUBDIRECTORY(oracle)
56
ENDIF(WITH_ORACLE)

‎python/plugins/db_manager/db_plugins/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
class NotSupportedDbType(Exception):
2626

2727
def __init__(self, dbtype):
28-
self.msg = self.tr("%s is not supported yet") % dbtype
28+
from qgis.PyQt.QtWidgets import QApplication
29+
self.msg = QApplication.translate("DBManagerPlugin", "%s is not supported yet" % dbtype)
2930
Exception(self, self.msg)
3031

3132
def __str__(self):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
FILE(GLOB PY_FILES *.py)
3+
FILE(GLOB ICON_FILES icons/*.png)
4+
5+
PYQT_ADD_RESOURCES(PYRC_FILES resources.qrc)
6+
7+
PLUGIN_INSTALL(db_manager db_plugins/gpkg ${PY_FILES} ${PYRC_FILES})
8+
PLUGIN_INSTALL(db_manager db_plugins/gpkg/icons ${ICON_FILES})
9+

‎python/plugins/db_manager/db_plugins/gpkg/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.