Skip to content

Commit

Permalink
fix #8488: use QgsMimeDataUtils to decode uris when dropping into db_…
Browse files Browse the repository at this point in the history
…manager
  • Loading branch information
jef-n committed Aug 20, 2013
1 parent b460eeb commit b9b8a03
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions python/plugins/db_manager/db_model.py
Expand Up @@ -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
Expand Down

0 comments on commit b9b8a03

Please sign in to comment.