From 647c988599b9c9ca179dfd70a17b23e20006c9c9 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Tue, 20 Sep 2022 09:44:21 +0100 Subject: Use Environment.SpecialFolder.UserProfile instead of Personal Mono and .NET, before .NET 8, would resolve the System.Environment.SpecialFolder.Personal enum value to the $HOME directory. In .NET 8 this is changing. The Personal folder will now refer to $XDG_DOCUMENTS_DIR if set or $HOME/Documents otherwise. Replace all uses of Environment.SpecialFolder.Personal with Environment.SpecialFolder.UserProfile so the code behaves as it did before. UserProfile still maps to $HOME dotnet/runtime#68610 --- Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs | 2 +- Mono.Addins.Gui/Mono.Addins.Gui/NewSiteDialog.cs | 2 +- Mono.Addins.GuiGtk3/Mono.Addins.Gui/AddinManagerDialog.cs | 2 +- Mono.Addins.GuiGtk3/Mono.Addins.Gui/NewSiteDialog.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs index bc69529..29bbec8 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs @@ -531,7 +531,7 @@ namespace Mono.Addins.Gui if (lastFolder != null) dlg.SetCurrentFolder (lastFolder); else - dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); + dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); dlg.SelectMultiple = true; Gtk.FileFilter f = new Gtk.FileFilter (); diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/NewSiteDialog.cs b/Mono.Addins.Gui/Mono.Addins.Gui/NewSiteDialog.cs index b10d691..bb3ae2d 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/NewSiteDialog.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/NewSiteDialog.cs @@ -95,7 +95,7 @@ namespace Mono.Addins.Gui dlg.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); dlg.AddButton (Gtk.Stock.Open, Gtk.ResponseType.Ok); - dlg.SetFilename (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); + dlg.SetFilename (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); if (dlg.Run () == (int) ResponseType.Ok) { pathEntry.Text = dlg.Filename; } diff --git a/Mono.Addins.GuiGtk3/Mono.Addins.Gui/AddinManagerDialog.cs b/Mono.Addins.GuiGtk3/Mono.Addins.Gui/AddinManagerDialog.cs index ed1d564..e0e5aab 100644 --- a/Mono.Addins.GuiGtk3/Mono.Addins.Gui/AddinManagerDialog.cs +++ b/Mono.Addins.GuiGtk3/Mono.Addins.Gui/AddinManagerDialog.cs @@ -584,7 +584,7 @@ namespace Mono.Addins.GuiGtk3 if (lastFolder != null) dlg.SetCurrentFolder (lastFolder); else - dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); + dlg.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); dlg.SelectMultiple = true; Gtk.FileFilter f = new Gtk.FileFilter (); diff --git a/Mono.Addins.GuiGtk3/Mono.Addins.Gui/NewSiteDialog.cs b/Mono.Addins.GuiGtk3/Mono.Addins.Gui/NewSiteDialog.cs index db65ec8..5de4c03 100644 --- a/Mono.Addins.GuiGtk3/Mono.Addins.Gui/NewSiteDialog.cs +++ b/Mono.Addins.GuiGtk3/Mono.Addins.Gui/NewSiteDialog.cs @@ -113,7 +113,7 @@ namespace Mono.Addins.GuiGtk3 dlg.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); dlg.AddButton (Gtk.Stock.Open, Gtk.ResponseType.Ok); - dlg.SetFilename (Environment.GetFolderPath (Environment.SpecialFolder.Personal)); + dlg.SetFilename (Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)); if (dlg.Run () == (int) ResponseType.Ok) { pathEntry.Text = dlg.Filename; } -- cgit v1.2.3