Fix missing words in properties windows (#874).
authorCarl Hetherington <cth@carlh.net>
Mon, 23 May 2016 09:20:56 +0000 (10:20 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 23 May 2016 09:20:56 +0000 (10:20 +0100)
ChangeLog
src/lib/raw_convert.cc [new file with mode: 0644]
src/lib/raw_convert.h
src/lib/wscript
test/util_test.cc

index 3398aa1bd6c23e84dcb681efa6969e93e0894b53..8092617c5466cebb755148217888dbed48ed5924 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-05-23  c.hetherington  <cth@carlh.net>
+
+       * Fix missing words in properties window (#874).
+
 2016-05-23  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.8.4 released.
diff --git a/src/lib/raw_convert.cc b/src/lib/raw_convert.cc
new file mode 100644 (file)
index 0000000..4325f52
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "raw_convert.h"
+
+using std::string;
+
+template <>
+string
+raw_convert<string, string> (string v, int)
+{
+       return v;
+}
+
+template <>
+string
+raw_convert<string, char const *> (char const * v, int)
+{
+       return v;
+}
index 6e55d49cf4802c8930b3eb7e994c8e05f09d8471..985c4e643263df5e41a05c7207f829fb893eacf9 100644 (file)
@@ -44,4 +44,12 @@ raw_convert (Q v, int precision = 16)
        return r;
 }
 
+template <>
+std::string
+raw_convert<std::string, char const *> (char const * v, int);
+
+template <>
+std::string
+raw_convert<std::string, std::string> (std::string v, int);
+
 #endif
index fe4eac114019c85a9998bfca48914ca0807e8df0..6a9f5106c1752986aa9129c7bc494c1d9dff8d94 100644 (file)
@@ -115,11 +115,12 @@ sources = """
           send_problem_report_job.cc
           server.cc
           string_log_entry.cc
+          raw_convert.cc
+          subtitle_content.cc
+          subtitle_decoder.cc
           text_subtitle.cc
           text_subtitle_content.cc
           text_subtitle_decoder.cc
-          subtitle_content.cc
-          subtitle_decoder.cc
           timer.cc
           transcode_job.cc
           transcoder.cc
index e296229e1ad3d42c3242071d731dd1e01532022a..9dcd053395a1bc5e39b479bb539bb3b94ea12f9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
 
 #include <boost/test/unit_test.hpp>
 #include "lib/util.h"
+#include "lib/raw_convert.h"
 #include "lib/exceptions.h"
 
 using std::string;
@@ -85,3 +86,9 @@ BOOST_AUTO_TEST_CASE (seconds_to_approximate_hms_test)
        BOOST_CHECK_EQUAL (seconds_to_approximate_hms (3600 + 40 * 60), "1h 40m");
        BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14h");
 }
+
+BOOST_AUTO_TEST_CASE (raw_convert_test)
+{
+       BOOST_CHECK_EQUAL (raw_convert<string> ("foo"), "foo");
+       BOOST_CHECK_EQUAL (raw_convert<string> ("foo bar"), "foo bar");
+}