Skip to content

Commit

Permalink
[db manager] Fix virtual layers plugin (fixes #14404)
Browse files Browse the repository at this point in the history
(cherry-picked from commit 7dbc0bf)
  • Loading branch information
Hugo Mercier committed Mar 24, 2016
1 parent 8aa3ecd commit 363050d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/plugins/db_manager/db_plugins/vlayers/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
from ..plugin import DbError

from PyQt4.QtCore import QUrl, QTime, QTemporaryFile
from qgis.core import QgsProviderRegistry, QgsErrorMessage, QGis, QgsVectorLayer

import os
from qgis.core import QGis, QgsVectorLayer, QgsWKBTypes


class LTableDataModel(TableDataModel):
Expand All @@ -48,7 +46,13 @@ def __init__(self, table, parent=None):
# populate self.resdata
self.resdata = []
for f in self.layer.getFeatures():
self.resdata.append(f.attributes())
a = f.attributes()
# add the geometry type
if f.geometry():
a.append(QgsWKBTypes.displayString(QGis.fromOldWkbType(f.geometry().wkbType())))
else:
a.append('None')
self.resdata.append(a)

self.fetchedFrom = 0
self.fetchedCount = len(self.resdata)
Expand Down

0 comments on commit 363050d

Please sign in to comment.