Skip to content

Commit

Permalink
GNOME - Fix DnD Not Working
Browse files Browse the repository at this point in the history
Fixes #354
  • Loading branch information
nlogozzo committed Jan 5, 2024
1 parent 2f55d0e commit a15a660
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions NickvisionTagger.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public Program(string[] args)
_mainWindowController = new MainWindowController(args);
_mainWindowController.AppInfo.Changelog =
@"* Fixed an issue where album art was not deleted correctly on delete tag action
* Fixed an issue where dragging and dropping a library was not working
* Updated translations (Thanks everyone on Weblate!)";
_application.OnActivate += OnActivate;
if (File.Exists(Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) + "/org.nickvision.tagger.gresource"))
Expand Down
14 changes: 6 additions & 8 deletions NickvisionTagger.GNOME/Views/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,15 +717,13 @@ private bool OnCloseRequested(Gtk.Window sender, EventArgs e)
/// <param name="e">Gtk.DropTarget.DropSignalArgs</param>
private bool OnDrop(Gtk.DropTarget sender, Gtk.DropTarget.DropSignalArgs e)
{
var obj = e.Value.GetObject();
if (obj is Gio.FileHelper file)
var file = new Gio.FileHelper(e.Value.GetObject()!.Handle, false);
var path = file.GetPath() ?? "";
Console.WriteLine(path);

This comment has been minimized.

Copy link
@DaPigGuy

DaPigGuy Jan 5, 2024

Member

This slipped through 😅

This comment has been minimized.

Copy link
@nlogozzo

nlogozzo Jan 5, 2024

Author Member

thanks for the catch!

if (MusicLibrary.GetIsValidLibraryPath(path))
{
var path = file.GetPath() ?? "";
if (MusicLibrary.GetIsValidLibraryPath(path))
{
_controller.OpenLibraryAsync(path).Wait();
return true;
}
Task.Run(async () => await _controller.OpenLibraryAsync(path));
return true;
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<release version="2024.1.0-next" date="2024-01-01">
<description translatable="no">
<p>- Fixed an issue where album art was not deleted correctly on delete tag action</p>
<p>- Fixed an issue where dragging and dropping a library was not working</p>
<p>- Updated translations (Thanks everyone on Weblate!)</p>
</description>
</release>
Expand Down

0 comments on commit a15a660

Please sign in to comment.