Skip to content

Commit

Permalink
Persists selected music library folder when changed through the GUI (#…
Browse files Browse the repository at this point in the history
…469)

* Resolves #453 and #295 by changing and saving the music folder location
  • Loading branch information
ZavierHenry authored and Mohelm97 committed Dec 18, 2018
1 parent 305ed7e commit 9f1e34e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dialogs/PreferencesWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public class Noise.PreferencesWindow : Gtk.Dialog {
library_filechooser.hexpand = true;
library_filechooser.set_current_folder (Settings.Main.get_default ().music_folder);
library_filechooser.file_set.connect (() => {
App.main_window.setMusicFolder (library_filechooser.get_current_folder ());
string? filename = library_filechooser.get_uri ().replace ("file://", "");
App.main_window.setMusicFolder (filename);
});

var main_settings = Settings.Main.get_default ();
Expand Down
3 changes: 3 additions & 0 deletions src/LocalBackend/LocalLibrary.vala
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public class Noise.LocalLibrary : Library {
m_folder = m_folder.replace (GLib.Environment.get_home_dir ()+ "/", "");

if (start_file_operations (_("Importing music from %s").printf ("<b>" + Markup.escape_text (m_folder) + "</b>"))) {

Settings.Main.get_default ().music_folder = folder;

remove_all_static_playlists ();

clear_medias ();
Expand Down

0 comments on commit 9f1e34e

Please sign in to comment.