summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2022-09-27 22:25:52 +0200
committerMarcus Lundblad <ml@dfupdate.se>2022-09-27 22:25:52 +0200
commit7540cab0c0b3ba9c07b9b67164015bf56d2cd21d (patch)
treeb196eedf5a4429b714a3eb136b9e99c064bc61b0
parent04e5ed8155705d4bc629e4adfb5f8080089fee65 (diff)
downloadgnome-maps-7540cab0c0b3ba9c07b9b67164015bf56d2cd21d.tar.gz
mainWindow: Pass a GListStore to openShapeLayerswip/mlundblad/fix-shapelayer-drag-and-drop
The openShapeLayers method expects a GListModel as returned by the file chooser when selecting files. While the drag-and-drop action gets the value a GFile. So wrap the object in a GListStore before passing in on from the DND handler.
-rw-r--r--src/mainWindow.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mainWindow.js b/src/mainWindow.js
index fb93a8b5..7e6ec6a7 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -177,7 +177,11 @@ export class MainWindow extends Gtk.ApplicationWindow {
this.add_controller(this._dropTarget);
this._dropTarget.connect('drop', (target, value, x, y, data) => {
- return this._mapView.openShapeLayers([value]);
+ let list = new Gio.ListStore(Gio.File.Gtype);
+
+ list.insert(0, value);
+
+ return this._mapView.openShapeLayers(list);
});
}