Skip to content

Commit

Permalink
Merge pull request #5019 from boundlessgeo/gpkg-dbmanager-sync
Browse files Browse the repository at this point in the history
Geopackage: Use the same settings for DB Manager and browser
  • Loading branch information
elpaso committed Aug 14, 2017
2 parents 80e8ff0 + 04f79d1 commit 7d4f81d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/plugins/db_manager/db_plugins/gpkg/plugin.py
Expand Up @@ -61,7 +61,7 @@ def providerName(self):

@classmethod
def connectionSettingsKey(self):
return '/GPKG/connections'
return '/providers/geopackage/connections'

def databasesFactory(self, connection, uri):
return GPKGDatabase(connection, uri)
Expand All @@ -71,10 +71,10 @@ def connect(self, parent=None):
settings = QgsSettings()
settings.beginGroup(u"/%s/%s" % (self.connectionSettingsKey(), conn_name))

if not settings.contains("gpkgpath"): # non-existent entry?
if not settings.contains("path"): # non-existent entry?
raise InvalidDataException(self.tr(u'There is no defined database connection "{0}".').format(conn_name))

database = settings.value("gpkgpath")
database = settings.value("path")

uri = QgsDataSourceUri()
uri.setDatabase(database)
Expand All @@ -84,7 +84,7 @@ def connect(self, parent=None):
def addConnection(self, conn_name, uri):
settings = QgsSettings()
settings.beginGroup(u"/%s/%s" % (self.connectionSettingsKey(), conn_name))
settings.setValue("gpkgpath", uri.database())
settings.setValue("path", uri.database())
return True

@classmethod
Expand Down

0 comments on commit 7d4f81d

Please sign in to comment.