def computeDiffs(self): self.commit1 = self.commit1Panel.getRef() self.commit2 = self.commit2Panel.getRef() self.unloadLayers() allchanges = exportVersionDiffs(self.commit1, self.commit2) self.allchanges = {} for path, layers in allchanges.iteritems(): self.allchanges[path] = layers for layer in layers: if layer is not None: QgsMapLayerRegistry.instance().addMapLayer(layer, False) if self.allchanges: self.layers = self.allchanges.values()[0] self.ui.layerCombo.blockSignals(True) self.ui.layerCombo.clear() self.ui.layerCombo.addItems(self.allchanges.keys()) self.ui.layerCombo.blockSignals(False) self.computeLayerDiffs(self.allchanges.keys()[0]) else: self.mapCanvas.clear() self.proxyModel.deleteLater()
def exportAndLoadVersionDiffs(self, commita, commitb = None): diffs = exportVersionDiffs(commita, commitb) allLayers = [] for layers in diffs.values(): allLayers.extend(reversed([l for l in layers if l is not None])) QgsMapLayerRegistry.instance().addMapLayers(allLayers)
def exportAndLoadVersionDiffs(self, commita, commitb=None): diffs = exportVersionDiffs(commita, commitb) allLayers = [] for layers in diffs.values(): allLayers.extend(reversed([l for l in layers if l is not None])) QgsMapLayerRegistry.instance().addMapLayers(allLayers)