Skip to content
Permalink
Browse files

fix #8488: use QgsMimeDataUtils to decode uris when dropping into db_…

…manager
  • Loading branch information
jef-n committed Aug 20, 2013
1 parent b460eeb commit b9b8a03905e0a0482e05bec99d4f021b1f54644c
Showing with 1 addition and 15 deletions.
  1. +1 −15 python/plugins/db_manager/db_model.py
@@ -523,21 +523,7 @@ def dropMimeData(self, data, action, row, column, parent):
added += 1

if data.hasFormat(self.QGIS_URI_MIME):
encodedData = data.data(self.QGIS_URI_MIME)
stream = QDataStream(encodedData, QIODevice.ReadOnly)

while not stream.atEnd():
mimeUri = stream.readQString()

parts = mimeUri.split(":", 3)
if len(parts) != 4:
# invalid qgis mime uri
QMessageBox.warning(None, self.tr("Invalid MIME uri"), self.tr("The dropped object is not a valid layer"))
continue

layerType, providerKey, layerName, uriString = parts

if self.importLayer( layerType, providerKey, layerName, uriString, parent ):
for uri tin qgis.core.QgsMimeDataUtils.decodeUriList( data ):
added += 1

return added > 0

0 comments on commit b9b8a03

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