Skip to content
Permalink
Browse files

Geopackage: Use the same settings for DB Manager and browser

  • Loading branch information
elpaso committed Aug 14, 2017
1 parent 2364801 commit 04f79d174d76f4d459b55c93c3ed0924b7ba52cf
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/plugins/db_manager/db_plugins/gpkg/plugin.py
@@ -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)
@@ -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)
@@ -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

0 comments on commit 04f79d1

Please sign in to comment.
You can’t perform that action at this time.