Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #84 from lbartoletti/master
Browse files Browse the repository at this point in the history
 fix working copy when project was closed
  • Loading branch information
lbartoletti authored Oct 26, 2018
2 parents 16c8c96 + 50bfab7 commit 701cce0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ def on_legend_click(self, current, column=0):
if layer.providerType() == "spatialite":
rev = 0
try:
if not self.versioning:
self.versioning = versioning.spatialite(
uri.database(), self.pg_conn_info())
rev = self.versioning.revision()
except:
self.current_layers = []
Expand All @@ -413,6 +416,11 @@ def on_legend_click(self, current, column=0):
ret = self.is_pgDistant(layer)
if ret:
try:
if not self.versioning:
out = self.selectDatabase()
(pg_conn_info_out, conn_dict) = self.get_conn_from_settings(out)
self.versioning = versioning.pgLocal(
pg_conn_info_out, uri.schema(), self.get_conn_from_uri(uri))
rev = self.versioning.revision()
selection_type = 'working copy'
self.info.setText(uri.database()+' '+uri.schema()
Expand All @@ -435,6 +443,10 @@ def on_legend_click(self, current, column=0):
# check if it's a working copy
rev = 0
try:
if not self.versioning:
self.versioning = versioning.pgServer(
self.pg_conn_info(), uri.schema())

rev = self.versioning.revision()
selection_type = 'working copy'
self.info.setText(uri.database()+' '+uri.schema()
Expand Down

0 comments on commit 701cce0

Please sign in to comment.