summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2015-09-08 15:38:17 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2015-09-08 15:45:33 +0100
commitd0fdcf2848f9196404f9a8e7e4f16a3cb931e4a2 (patch)
tree6f0fad69778cdf61eccb8e1eac2c234d28bf71db /gtk2_ardour/ardour_ui.cc
parentd11b15fbca760049cf9c2f0bdf58ecd3d66ee6fb (diff)
Use glib to open our 'announcements' file, rather than opening directly with ofstream
(on Windows, std::ofstream doesn't support UTF8)
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index f2d0132b48..ce95aec7e6 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -808,13 +808,20 @@ ARDOUR_UI::check_announcements ()
_annc_filename.append (VERSIONSTRING);
std::string path = Glib::build_filename (user_config_directory(), _annc_filename);
- std::ifstream announce_file (path.c_str());
- if ( announce_file.fail() )
- _announce_string = "";
- else {
- std::stringstream oss;
- oss << announce_file.rdbuf();
- _announce_string = oss.str();
+ FILE* fin = g_fopen (path.c_str(), "rb");
+
+ if (fin) {
+ std::ifstream announce_file (fin);
+
+ if ( announce_file.fail() )
+ _announce_string = "";
+ else {
+ std::stringstream oss;
+ oss << announce_file.rdbuf();
+ _announce_string = oss.str();
+ }
+
+ fclose (fin);
}
pingback (VERSIONSTRING, path);