Use dcp::filesystem to wrap filesystem calls and fix_long_path
[dcpomatic.git] / src / wx / fonts_dialog.cc
index b21bb8498653af24e9ae817c5cf8ad9e1fee6d31..a035a5ffc53c981ad03910eec137158b6fce7caf 100644 (file)
@@ -27,6 +27,7 @@
 #include "lib/font.h"
 #include "lib/scope_guard.h"
 #include "lib/text_content.h"
+#include <dcp/filesystem.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
@@ -174,7 +175,7 @@ FontsDialog::set_from_file_clicked ()
         */
         wxString default_dir = "";
 #ifdef DCPOMATIC_LINUX
-        if (boost::filesystem::exists ("/usr/share/fonts/truetype")) {
+        if (dcp::filesystem::exists("/usr/share/fonts/truetype")) {
                 default_dir = "/usr/share/fonts/truetype";
         } else {
                 default_dir = "/usr/share/fonts";
@@ -184,8 +185,7 @@ FontsDialog::set_from_file_clicked ()
         default_dir = "/System/Library/Fonts";
 #endif
 
-       auto d = new wxFileDialog (this, _("Choose a font file"), default_dir, wxT(""), wxT("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR);
-       ScopeGuard sg = [d]() { d->Destroy(); };
+       auto d = make_wx<wxFileDialog>(this, _("Choose a font file"), default_dir, wxT(""), wxT("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR);
 
        if (d->ShowModal() != wxID_OK) {
                return;
@@ -204,8 +204,7 @@ FontsDialog::set_from_system_font_clicked()
                return;
        }
 
-       auto dialog = new SystemFontDialog(this);
-       ScopeGuard sg = [dialog]() { dialog->Destroy(); };
+       auto dialog = make_wx<SystemFontDialog>(this);
        if (dialog->ShowModal() == wxID_OK) {
                auto font_file = dialog->get_font();
                if (font_file) {