diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2022-09-27 22:25:52 +0200 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2022-09-27 22:25:52 +0200 |
commit | 7540cab0c0b3ba9c07b9b67164015bf56d2cd21d (patch) | |
tree | b196eedf5a4429b714a3eb136b9e99c064bc61b0 | |
parent | 04e5ed8155705d4bc629e4adfb5f8080089fee65 (diff) | |
download | gnome-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.js | 6 |
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); }); } |