summarylogtreecommitdiffstats
path: root/fix_deprecated_boost_api.patch
blob: f14a2c6ca0310c7871943c002a92c27f51f3d868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
diff -ruN old/src/mbase/project/table.cpp new/src/mbase/project/table.cpp
--- old/src/mbase/project/table.cpp	2016-06-18 11:19:57.649798271 +0430
+++ new/src/mbase/project/table.cpp	2016-06-18 11:26:53.226439812 +0430
@@ -154,7 +154,7 @@
 void SerializePath(Archieve& ar, const char* tag_name, std::string& fpath)
 {
     //ar & NameValue("Path", mdPath);
-    fs::path rel_to_dir = fs::path(AData().GetProjectFName()).branch_path();
+    fs::path rel_to_dir = fs::path(AData().GetProjectFName()).parent_path();
     if( ar.IsLoad() )
     {
         ar >> NameValue(tag_name, fpath);
@@ -162,7 +162,7 @@
         if( !fpath.empty() )
         {
             fs::path pth(fpath);
-            if( !pth.is_complete() )
+            if( !pth.is_absolute() )
                 fpath = (rel_to_dir/fpath).string();
         }
     }
diff -ruN old/src/mgui/author/script.cpp new/src/mgui/author/script.cpp
--- old/src/mgui/author/script.cpp	2016-06-18 11:19:57.656464937 +0430
+++ new/src/mgui/author/script.cpp	2016-06-18 11:24:46.063114167 +0430
@@ -676,7 +676,7 @@
     if( !fs::exists(font_path) )
     {
         std::string err_str;
-        if( !CreateDirs(font_path.branch_path(), err_str) )
+        if( !CreateDirs(font_path.parent_path(), err_str) )
             Error(err_str.c_str());
         fs::copy_file(DataDirPath("copy-n-paste/FreeSans.ttf"), font_path);
     }
diff -ruN old/src/mgui/mux.cpp new/src/mgui/mux.cpp
--- old/src/mgui/mux.cpp	2016-06-18 11:19:57.653131605 +0430
+++ new/src/mgui/mux.cpp	2016-06-18 11:25:09.986446054 +0430
@@ -162,7 +162,7 @@
     fs::path pth = GetFilename(v_btn);
     if( pth.empty() )
         return;
-    std::string folder = pth.branch_path().string();
+    std::string folder = pth.parent_path().string();
 
     if( a_btn.get_filename().empty() )
         a_btn.set_current_folder(folder);
diff -ruN old/src/mgui/project/add.cpp new/src/mgui/project/add.cpp
--- old/src/mgui/project/add.cpp	2016-06-18 11:19:57.656464937 +0430
+++ new/src/mgui/project/add.cpp	2016-06-18 11:25:30.836444794 +0430
@@ -479,7 +479,7 @@
                 MessageBox(BF_("The file \"%1%\" looks like VOB from DVD.\nRun import?") % leaf % bf::stop,
                            Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_OK_CANCEL) == Gtk::RESPONSE_OK )
             {
-                DVD::RunImport(*GetTopWindow(brw), pth.branch_path().string());
+                DVD::RunImport(*GetTopWindow(brw), pth.parent_path().string());
                 return;
             }
         }
diff -ruN old/src/mgui/project/serialize.cpp new/src/mgui/project/serialize.cpp
--- old/src/mgui/project/serialize.cpp	2016-06-18 11:19:57.656464937 +0430
+++ new/src/mgui/project/serialize.cpp	2016-06-18 11:25:56.913109885 +0430
@@ -73,7 +73,7 @@
     fs::path full_path(db.GetProjectFName());
     std::string res_str = fs::name_str(full_path);
     if( with_path_breakdown )
-        res_str += " (" + full_path.branch_path().string() + ")";
+        res_str += " (" + full_path.parent_path().string() + ")";
     return res_str;
 }
 
diff -ruN old/src/mgui/timeline/select.cpp new/src/mgui/timeline/select.cpp
--- old/src/mgui/timeline/select.cpp	2016-06-18 11:19:57.659798271 +0430
+++ new/src/mgui/timeline/select.cpp	2016-06-18 11:26:26.869774739 +0430
@@ -152,7 +152,7 @@
 
         mon.FramePixbuf()->save(fnam, ext);
 
-        SaveFrameDir() = fs::path(fnam).branch_path().string();
+        SaveFrameDir() = fs::path(fnam).parent_path().string();
         if( add_btn.get_active() )
             Project::TryAddMediaQuiet(fnam, "SaveFrame");
     }
diff -ruN old/src/mbase/project/tests/test_table.cpp new/src/mbase/project/tests/test_table.cpp
--- old/src/mbase/project/tests/test_table.cpp	2016-06-18 11:19:57.649798271 +0430
+++ new/src/mbase/project/tests/test_table.cpp	2016-06-18 11:27:15.263105145 +0430
@@ -129,7 +129,7 @@
         // проверка чтения/записи путей
         boost::intrusive_ptr<StillImageMD> pict2 = ptr::dynamic_pointer_cast<StillImageMD>(ml[2]);
         fs::path pth = pict2->GetPath();
-        BOOST_CHECK( pth.is_complete() );
+        BOOST_CHECK( pth.is_absolute() );
         BOOST_CHECK( fs::exists(pth) );
 
         // проверка ссылок
diff -ruN old/src/mlib/tests/test_utils.cpp new/src/mlib/tests/test_utils.cpp
--- old/src/mlib/tests/test_utils.cpp	2016-06-18 11:19:57.663131604 +0430
+++ new/src/mlib/tests/test_utils.cpp	2016-06-18 11:28:13.619768287 +0430
@@ -139,17 +139,17 @@
 #endif
     }
 
-    // is_complete
+    // is_absolute
     {
         fs::path pth("../some_file");
-        BOOST_CHECK( !pth.is_complete() );
-        BOOST_CHECK( fs::current_path().is_complete() );
+        BOOST_CHECK( !pth.is_absolute() );
+        BOOST_CHECK( fs::current_path().is_absolute() );
 
         fs::path apth = Project::MakeAbsolutePath(pth);
         //LOG_INF << "Making abs path: " << pth.string() << " => " << apth.string() << io::endl;
 
-        BOOST_CHECK( Project::MakeAbsolutePath(pth, MakeRootComplete("/")).is_complete() );
-        BOOST_CHECK( !Project::MakeAbsolutePath(pth, "./").is_complete() );
+        BOOST_CHECK( Project::MakeAbsolutePath(pth, MakeRootComplete("/")).is_absolute() );
+        BOOST_CHECK( !Project::MakeAbsolutePath(pth, "./").is_absolute() );
     }
 
     // MakeRelativeToDir
diff -ruN old/src/mlib/filesystem.cpp new/src/mlib/filesystem.cpp
--- old/src/mlib/filesystem.cpp	2016-06-18 11:19:57.659798271 +0430
+++ new/src/mlib/filesystem.cpp	2016-06-18 11:30:15.303094263 +0430
@@ -161,25 +161,16 @@
 
 fs::path MakeAbsolutePath(const fs::path& pth, const fs::path& cur_dir)
 {
-    fs::path res;
-
-    if( pth.is_complete() )
-        res = pth;
-    else
-    {
-        fs::path dir = cur_dir.empty() ? fs::current_path() : cur_dir ;
-        res = dir/pth;
-    }
-    return res.normalize();
+    return absolute(pth, cur_dir);
 }
 
 // оба аргумента должны быть абсолютными путями
 bool MakeRelativeToDir(fs::path& pth, fs::path dir)
 {
-    pth.normalize();
-    dir.normalize();
-    ASSERT( pth.is_complete() );
-    ASSERT( dir.is_complete() );
+    pth = canonical(pth);
+    dir = canonical(dir);
+    ASSERT( pth.is_absolute() );
+    ASSERT( dir.is_absolute() );
 
     fs::path::iterator p_itr = pth.begin(), p_end = pth.end();
     fs::path::iterator d_itr = dir.begin(), d_end = dir.end();