Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3628 from rouault/dbmanager_gpkg
[DBManager] Add dedicated GeoPackage plugin
  • Loading branch information
rouault committed Oct 24, 2016
2 parents 72229c1 + d32a949 commit af236c4
Show file tree
Hide file tree
Showing 22 changed files with 1,692 additions and 99 deletions.
1 change: 1 addition & 0 deletions ci/travis/linux/blacklist.txt
Expand Up @@ -5,3 +5,4 @@ qgis_composermapgridtest
qgis_composerutils
ProcessingGrass7AlgorithmsImageryTest
ProcessingGrass7AlgorithmsRasterTest
PyQgsDBManagerGpkg
3 changes: 2 additions & 1 deletion python/plugins/db_manager/db_model.py
Expand Up @@ -300,6 +300,7 @@ def __init__(self, parent=None):
self.importVector.connect(self.vectorImport)

self.hasSpatialiteSupport = "spatialite" in supportedDbTypes()
self.hasGPKGSupport = "gpkg" in supportedDbTypes()

self.rootItem = TreeItem(None, None)
for dbtype in supportedDbTypes():
Expand Down Expand Up @@ -401,7 +402,7 @@ def flags(self, index):
flags |= Qt.ItemIsDropEnabled

# SL/Geopackage db files can be dropped everywhere in the tree
if self.hasSpatialiteSupport:
if self.hasSpatialiteSupport or self.hasGPKGSupport:
flags |= Qt.ItemIsDropEnabled

return flags
Expand Down
1 change: 1 addition & 0 deletions python/plugins/db_manager/db_plugins/CMakeLists.txt
@@ -1,5 +1,6 @@
ADD_SUBDIRECTORY(postgis)
ADD_SUBDIRECTORY(spatialite)
ADD_SUBDIRECTORY(gpkg)
IF(WITH_ORACLE)
ADD_SUBDIRECTORY(oracle)
ENDIF(WITH_ORACLE)
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/db_manager/db_plugins/__init__.py
Expand Up @@ -25,7 +25,8 @@
class NotSupportedDbType(Exception):

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

def __str__(self):
Expand Down
9 changes: 9 additions & 0 deletions python/plugins/db_manager/db_plugins/gpkg/CMakeLists.txt
@@ -0,0 +1,9 @@

FILE(GLOB PY_FILES *.py)
FILE(GLOB ICON_FILES icons/*.png)

PYQT_ADD_RESOURCES(PYRC_FILES resources.qrc)

PLUGIN_INSTALL(db_manager db_plugins/gpkg ${PY_FILES} ${PYRC_FILES})
PLUGIN_INSTALL(db_manager db_plugins/gpkg/icons ${ICON_FILES})

Empty file.

0 comments on commit af236c4

Please sign in to comment.