Use std::string and Glib::build_filename in gtk2_ardour
authorTim Mayberry <mojofunk@gmail.com>
Sat, 23 Jun 2012 05:09:46 +0000 (05:09 +0000)
committerTim Mayberry <mojofunk@gmail.com>
Sat, 23 Jun 2012 05:09:46 +0000 (05:09 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12903 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/export_range_markers_dialog.cc
gtk2_ardour/keyboard.cc
gtk2_ardour/startup.cc
gtk2_ardour/startup.h

index cc5837d7adb75da29d2812bc97de1334c6266542..8b90b2d5b87f5099b33b1d4ea29bb071357453bb 100644 (file)
@@ -1110,7 +1110,7 @@ ARDOUR_UI::update_wall_clock ()
 void
 ARDOUR_UI::redisplay_recent_sessions ()
 {
-       std::vector<sys::path> session_directories;
+       std::vector<std::string> session_directories;
        RecentSessionsSorter cmp;
 
        recent_session_display.set_model (Glib::RefPtr<TreeModel>(0));
@@ -1131,18 +1131,18 @@ ARDOUR_UI::redisplay_recent_sessions ()
                session_directories.push_back ((*i).second);
        }
 
-       for (vector<sys::path>::const_iterator i = session_directories.begin();
+       for (vector<std::string>::const_iterator i = session_directories.begin();
                        i != session_directories.end(); ++i)
        {
                std::vector<std::string> state_file_paths;
 
                // now get available states for this session
 
-               get_state_files_in_directory (i->to_string(), state_file_paths);
+               get_state_files_in_directory (*i, state_file_paths);
 
                vector<string*>* states;
                vector<const gchar*> item;
-               string fullpath = i->to_string();
+               string fullpath = *i;
 
                /* remove any trailing / */
 
index 9519143af2cb8d9baebff2bb3cf77044b6555e49..c556b9a9578aff111b203a3f140a28c0f22ab41b 100644 (file)
@@ -134,7 +134,7 @@ ARDOUR_UI::install_actions ()
 
 #ifdef WITH_CMT
 
-       sys::path anicomp_file_path;
+       std::string anicomp_file_path;
 
        if (PBD::find_file_in_search_path (Glib::getenv("PATH"), "AniComp", anicomp_file_path)) {
                act = ActionManager::register_action (main_actions, X_("aniConnect"), _("Connect"),  (sigc::mem_fun (*editor, &PublicEditor::connect_to_image_compositor)));
index c6bf578a329dc947c1b796c09ee2c13d73b13090..5c73e20d071d1ab0780dc8a5cc79225d683582d7 100644 (file)
@@ -157,7 +157,7 @@ ExportRangeMarkersDialog::is_filepath_valid(string &filepath)
 
        // directory needs to exist and be writable
        string dirpath = Glib::path_get_dirname (filepath);
-       if (!exists_and_writable (sys::path (dirpath))) {
+       if (!exists_and_writable (dirpath)) {
                string txt = _("Cannot write file in: ") + dirpath;
                MessageDialog msg (*this, txt, false, MESSAGE_ERROR, BUTTONS_OK, true);
                msg.run();
index 732118f3381839cada54d9cd0e40704b27a999bc..98ffab1160bb563fa2a2f5abf868062f6d10e281 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "pbd/error.h"
 #include "pbd/file_utils.h"
-#include "pbd/filesystem.h"
 
 #include "ardour/filesystem_paths.h"
 
@@ -60,10 +59,7 @@ ArdourKeyboard::setup_keybindings ()
 
        /* set up the per-user bindings path */
 
-       sys::path p (user_config_directory ());
-       p /= "ardour.bindings";
-
-       user_keybindings_path = p.to_string ();
+       user_keybindings_path = Glib::build_filename (user_config_directory(), "ardour.bindings");
 
        if (Glib::file_test (user_keybindings_path, Glib::FILE_TEST_EXISTS)) {
                std::pair<string,string> newpair;
index 689312baa2c784c5147380205c2e31e2ce5f0317..a811fd7cc1982c80cbe99fc2d42794d2a06dd3f4 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "pbd/failed_constructor.h"
 #include "pbd/file_utils.h"
-#include "pbd/filesystem.h"
 #include "pbd/replace_all.h"
 #include "pbd/whitespace.h"
 
@@ -123,7 +122,7 @@ Ardour will play NO role in monitoring"))
                set_default_icon_list (window_icons);
        }
 
-       new_user = !Glib::file_test(been_here_before_path().to_string(), Glib::FILE_TEST_EXISTS);
+       new_user = !Glib::file_test(been_here_before_path(), Glib::FILE_TEST_EXISTS);
 
        bool need_audio_setup = !EngineControl::engine_running();
 
@@ -642,7 +641,7 @@ ArdourStartup::on_apply ()
                Config->set_use_monitor_bus (use_monitor_section_button.get_active());
 
                /* "touch" the been-here-before path now that we're about to save Config */
-               ofstream fout (been_here_before_path().to_string().c_str());
+               ofstream fout (been_here_before_path().c_str());
                
                Config->save_state ();
        }
@@ -901,7 +900,7 @@ ArdourStartup::new_name_changed ()
 int
 ArdourStartup::redisplay_recent_sessions ()
 {
-       std::vector<sys::path> session_directories;
+       std::vector<std::string> session_directories;
        RecentSessionsSorter cmp;
 
        recent_session_display.set_model (Glib::RefPtr<TreeModel>(0));
@@ -922,17 +921,17 @@ ArdourStartup::redisplay_recent_sessions ()
                session_directories.push_back ((*i).second);
        }
 
-       for (vector<sys::path>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
+       for (vector<std::string>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i)
        {
                std::vector<std::string> state_file_paths;
 
                // now get available states for this session
 
-               get_state_files_in_directory ((*i).to_string (), state_file_paths);
+               get_state_files_in_directory (*i, state_file_paths);
 
                vector<string*>* states;
                vector<const gchar*> item;
-               string fullpath = (*i).to_string();
+               string fullpath = *i;
 
                /* remove any trailing / */
 
@@ -1393,11 +1392,9 @@ ArdourStartup::existing_session_selected ()
        move_along_now ();
 }
 
-sys::path
+std::string
 ArdourStartup::been_here_before_path () const
 {
-       sys::path b = user_config_directory();
-       b /= ".a3"; // XXXX use more specific version so we can catch upgrades
-       return b;
+       // XXXX use more specific version so we can catch upgrades
+       return Glib::build_filename (user_config_directory (), ".a3");
 }
-
index be3972a298591cd0817c9c7f8f32130de0ec0704..c2de96c55fc64f7eb4e0eed11795cb5ce39aa3f0 100644 (file)
@@ -39,8 +39,6 @@
 #include <gtkmm/liststore.h>
 #include <gtkmm/combobox.h>
 
-#include "pbd/filesystem.h"
-
 #include "ardour/utils.h"
 
 class EngineControl;
@@ -87,7 +85,7 @@ class ArdourStartup : public Gtk::Assistant {
        bool new_user;
        bool new_only;
 
-       PBD::sys::path been_here_before_path () const;
+       std::string been_here_before_path () const;
 
        void on_apply ();
        void on_cancel ();