string -> filesystem::path
authorCarl Hetherington <cth@carlh.net>
Wed, 16 Oct 2013 21:07:00 +0000 (22:07 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 16 Oct 2013 21:07:00 +0000 (22:07 +0100)
src/lib/film.cc
src/lib/film.h
src/tools/dcpomatic.cc
src/wx/film_editor.h

index 8c0365e024e7c45b4b4ed240043d303d17d0d669..3cae2a02f8e05e1e66775ee98bc4ae8c054d9837 100644 (file)
@@ -131,7 +131,7 @@ Film::Film (boost::filesystem::path dir)
                }
        }
 
-       set_directory (result.string ());
+       set_directory (result);
        _log.reset (new FileLog (file ("log")));
 
        _playlist->set_sequence_video (_sequence_video);
@@ -313,13 +313,13 @@ Film::encoded_frames () const
 void
 Film::write_metadata () const
 {
-       if (!boost::filesystem::exists (directory())) {
-               boost::filesystem::create_directory (directory());
+       if (!boost::filesystem::exists (directory ())) {
+               boost::filesystem::create_directory (directory ());
        }
        
        LocaleGuard lg;
 
-       boost::filesystem::create_directories (directory());
+       boost::filesystem::create_directories (directory ());
 
        xmlpp::Document doc;
        xmlpp::Element* root = doc.create_root_node ("Metadata");
@@ -546,7 +546,7 @@ Film::dcp_name (bool if_created_now) const
 
 
 void
-Film::set_directory (string d)
+Film::set_directory (boost::filesystem::path d)
 {
        _directory = d;
        _dirty = true;
@@ -917,7 +917,7 @@ Film::make_kdm (
        shared_ptr<const Signer> signer = make_signer ();
 
        /* Find the DCP to make the KDM for */
-       string const dir = this->directory ();
+       boost::filesystem::path const dir = this->directory ();
        list<boost::filesystem::path> dcps;
        for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator(dir); i != boost::filesystem::directory_iterator(); ++i) {
                if (
index 71bbd3844525e2f73e910fb629c23fc9763ce01c..821c4e2b28ec46d19ecb1902da804c16dc0fa090 100644 (file)
@@ -161,7 +161,7 @@ public:
 
        /* GET */
 
-       std::string directory () const {
+       boost::filesystem::path directory () const {
                return _directory;
        }
 
@@ -229,7 +229,7 @@ public:
 
        /* SET */
 
-       void set_directory (std::string);
+       void set_directory (boost::filesystem::path);
        void set_name (std::string);
        void set_use_dci_name (bool);
        void examine_and_add_content (boost::shared_ptr<Content>);
@@ -277,7 +277,7 @@ private:
        /** Complete path to directory containing the film metadata;
         *  must not be relative.
         */
-       std::string _directory;
+       boost::filesystem::path _directory;
        
        /** Name for DCP-o-matic */
        std::string _name;
index ab8c4536de3a1f75d8c83eeca13a8f6e8e5264c7..d4faac8158e98128219abe19feebbafd8923e6e6 100644 (file)
@@ -302,12 +302,12 @@ private:
                set_menu_sensitivity ();
        }
 
-       void file_changed (string f)
+       void file_changed (boost::filesystem::path f)
        {
                stringstream s;
                s << wx_to_std (_("DCP-o-matic"));
                if (!f.empty ()) {
-                       s << " - " << f;
+                       s << " - " << f.string ();
                }
                
                SetTitle (std_to_wx (s.str()));
@@ -455,14 +455,14 @@ private:
 #else
                int r = system ("which nautilus");
                if (WEXITSTATUS (r) == 0) {
-                       r = system (string ("nautilus " + film->directory()).c_str ());
+                       r = system (string ("nautilus " + film->directory().string()).c_str ());
                        if (WEXITSTATUS (r)) {
                                error_dialog (this, _("Could not show DCP (could not run nautilus)"));
                        }
                } else {
                        int r = system ("which konqueror");
                        if (WEXITSTATUS (r) == 0) {
-                               r = system (string ("konqueror " + film->directory()).c_str ());
+                               r = system (string ("konqueror " + film->directory().string()).c_str ());
                                if (WEXITSTATUS (r)) {
                                        error_dialog (this, _("Could not show DCP (could not run konqueror)"));
                                }
index 06a65dd9f661e2716adee8ab16d7acb7de28dc27..80c35d3d86cb8c9bfdac7e07a3206288f409d7f2 100644 (file)
@@ -50,7 +50,7 @@ public:
        void set_film (boost::shared_ptr<Film>);
        void set_selection (boost::weak_ptr<Content>);
 
-       boost::signals2::signal<void (std::string)> FileChanged;
+       boost::signals2::signal<void (boost::filesystem::path)> FileChanged;
 
        /* Stuff for panels */