Skip to content

Commit b9b8a03

Browse files
committedAug 20, 2013
fix #8488: use QgsMimeDataUtils to decode uris when dropping into db_manager
1 parent b460eeb commit b9b8a03

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed
 

‎python/plugins/db_manager/db_model.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -523,21 +523,7 @@ def dropMimeData(self, data, action, row, column, parent):
523523
added += 1
524524

525525
if data.hasFormat(self.QGIS_URI_MIME):
526-
encodedData = data.data(self.QGIS_URI_MIME)
527-
stream = QDataStream(encodedData, QIODevice.ReadOnly)
528-
529-
while not stream.atEnd():
530-
mimeUri = stream.readQString()
531-
532-
parts = mimeUri.split(":", 3)
533-
if len(parts) != 4:
534-
# invalid qgis mime uri
535-
QMessageBox.warning(None, self.tr("Invalid MIME uri"), self.tr("The dropped object is not a valid layer"))
536-
continue
537-
538-
layerType, providerKey, layerName, uriString = parts
539-
540-
if self.importLayer( layerType, providerKey, layerName, uriString, parent ):
526+
for uri tin qgis.core.QgsMimeDataUtils.decodeUriList( data ):
541527
added += 1
542528

543529
return added > 0

0 commit comments

Comments
 (0)
Please sign in to comment.