rework 8b80fe0, use std::string, not char*
authorRobin Gareus <robin@gareus.org>
Thu, 15 Oct 2015 09:24:15 +0000 (11:24 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 15 Oct 2015 09:24:15 +0000 (11:24 +0200)
13 files changed:
gtk2_ardour/ardour_ui.cc
gtk2_ardour/editor_regions.cc
gtk2_ardour/interthread_progress_window.cc
gtk2_ardour/missing_file_dialog.cc
gtk2_ardour/mixer_strip.cc
gtk2_ardour/monitor_section.cc
gtk2_ardour/port_matrix.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/route_time_axis.cc
gtk2_ardour/route_ui.cc
gtk2_ardour/session_dialog.cc
gtk2_ardour/sfdb_ui.cc
gtk2_ardour/splash.cc

index e418e3c62f7d3d25ff45d0ac1a516d3d82e07c60..fc28ee741fb7fab189da0f84f33638d85f2e778c 100644 (file)
@@ -3480,7 +3480,7 @@ The following file was deleted from %2,\n\
 releasing %3 %4bytes of disk space", "\
 The following %1 files were deleted from %2,\n\
 releasing %3 %4bytes of disk space", removed),
-                                       removed, Glib::Markup::escape_text (dead_directory).c_str(), space_adjusted, bprefix, PROGRAM_NAME));
+                                       removed, Gtkmm2ext::markup_escape_text (dead_directory), space_adjusted, bprefix, PROGRAM_NAME));
        } else {
                txt.set_markup (string_compose (P_("\
 The following file was not in use and \n\
@@ -3493,7 +3493,7 @@ have been moved to: %2\n\n\
 After a restart of %5\n\n\
 <span face=\"mono\">Session -> Clean-up -> Flush Wastebasket</span>\n\n\
 will release an additional %3 %4bytes of disk space.\n", removed),
-                                       removed, Glib::Markup::escape_text (dead_directory).c_str(), space_adjusted, bprefix, PROGRAM_NAME));
+                                       removed, Gtkmm2ext::markup_escape_text (dead_directory), space_adjusted, bprefix, PROGRAM_NAME));
        }
 
        dhbox.pack_start (*dimage, true, false, 5);
index 12503e1ab73499e387af640ace5a5b7c0ab05b27..0968c4052bcd460be8517ffdd0a39b9d948dd88e 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "gtkmm2ext/choice.h"
 #include "gtkmm2ext/treeutils.h"
+#include "gtkmm2ext/utils.h"
 
 #include "audio_clock.h"
 #include "editor.h"
@@ -390,14 +391,14 @@ EditorRegions::add_region (boost::shared_ptr<Region> region)
                row[_columns.property_toggles_visible] = false;
 
                if (missing_source) {
-                       row[_columns.path] = _("(MISSING) ") + std::string(Glib::Markup::escape_text (region->source()->name()));
+                       row[_columns.path] = _("(MISSING) ") + Gtkmm2ext::markup_escape_text (region->source()->name());
 
                } else {
                        boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource>(region->source());
                        if (fs) {
-                               row[_columns.path] = Glib::Markup::escape_text (fs->path()).c_str();
+                               row[_columns.path] = Gtkmm2ext::markup_escape_text (fs->path());
                        } else {
-                               row[_columns.path] = Glib::Markup::escape_text (region->source()->name()).c_str();
+                               row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
                        }
                }
 
@@ -949,9 +950,9 @@ void
 EditorRegions::populate_row_name (boost::shared_ptr<Region> region, TreeModel::Row const &row)
 {
        if (region->n_channels() > 1) {
-               row[_columns.name] = string_compose("%1  [%2]", Glib::Markup::escape_text (region->name()).c_str(), region->n_channels());
+               row[_columns.name] = string_compose("%1  [%2]", Gtkmm2ext::markup_escape_text (region->name()), region->n_channels());
        } else {
-               row[_columns.name] = Glib::Markup::escape_text (region->name()).c_str();
+               row[_columns.name] = Gtkmm2ext::markup_escape_text (region->name());
        }
 }
 
@@ -959,9 +960,9 @@ void
 EditorRegions::populate_row_source (boost::shared_ptr<Region> region, TreeModel::Row const &row)
 {
         if (boost::dynamic_pointer_cast<SilentFileSource>(region->source())) {
-               row[_columns.path] = _("MISSING ") + std::string(Glib::Markup::escape_text (region->source()->name()));
+               row[_columns.path] = _("MISSING ") + Gtkmm2ext::markup_escape_text (region->source()->name());
        } else {
-               row[_columns.path] = Glib::Markup::escape_text (region->source()->name()).c_str();
+               row[_columns.path] = Gtkmm2ext::markup_escape_text (region->source()->name());
        }
 }
 
index 96a9b810eb4c433f753e9c27c191f53d02661cb2..e63bf629a9e4d012b27ab41dbe0c28503f948d11 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <glibmm/main.h>
 #include <gtkmm/stock.h>
+#include "gtkmm2ext/utils.h"
 #include "ardour/import_status.h"
 #include "interthread_progress_window.h"
 #include "i18n.h"
@@ -87,8 +88,7 @@ bool
 ImportProgressWindow::update ()
 {
        _cancel_button.set_sensitive (!_import_status->freeze);
-       std::string op = Glib::Markup::escape_text(_import_status->doing_what);
-       _label.set_markup ("<i>" + op + "</i>");
+       _label.set_markup ("<i>" + Gtkmm2ext::markup_escape_text (_import_status->doing_what) + "</i>");
 
        /* use overall progress for the bar, rather than that for individual files */
        _bar.set_fraction ((_import_status->current - 1 + _import_status->progress) / _import_status->total);
index 9bbb564592441b5432457b87deb03e0a0969fdff..691dd29c61152c4a28d3c8e5552598dc4b6ab86d 100644 (file)
@@ -22,6 +22,7 @@
 #include "pbd/search_path.h"
 
 #include "ardour/session.h"
+#include "gtkmm2ext/utils.h"
 
 #include "missing_file_dialog.h"
 #include "i18n.h"
@@ -68,7 +69,7 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
 
         msg.set_justify (JUSTIFY_LEFT);
         msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
-<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Glib::Markup::escape_text(path).c_str(), Glib::Markup::escape_text (oss.str().c_str())));
+<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Gtkmm2ext::markup_escape_text (path), Gtkmm2ext::markup_escape_text (oss.str())));
 
         HBox* hbox = manage (new HBox);
         hbox->pack_start (msg, false, true);
index 2ff54512c69e4d2caa471ff401b7c450bf6427b6..f3ae79dc1fcfbdf257c77bf15c3b81f540beb822 100644 (file)
@@ -1207,10 +1207,10 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
 
        if (for_input) {
                io_count = route->n_inputs().n_total();
-               tooltip << string_compose (_("<b>INPUT</b> to %1"), Glib::Markup::escape_text(route->name()).c_str());
+               tooltip << string_compose (_("<b>INPUT</b> to %1"), Gtkmm2ext::markup_escape_text (route->name()));
        } else {
                io_count = route->n_outputs().n_total();
-               tooltip << string_compose (_("<b>OUTPUT</b> from %1"), Glib::Markup::escape_text(route->name()).c_str());
+               tooltip << string_compose (_("<b>OUTPUT</b> from %1"), Gtkmm2ext::markup_escape_text (route->name()));
        }
 
 
@@ -1244,12 +1244,12 @@ MixerStrip::update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width widt
                                }
 
                                if (io_connection_count == 0) {
-                                       tooltip << endl << Glib::Markup::escape_text(port->name().substr(port->name().find("/") + 1)).c_str()
+                                       tooltip << endl << Gtkmm2ext::markup_escape_text (port->name().substr(port->name().find("/") + 1))
                                                << " -> "
-                                               << Glib::Markup::escape_text( pn.empty() ? connection_name : pn ).c_str();
+                                               << Gtkmm2ext::markup_escape_text ( pn.empty() ? connection_name : pn );
                                } else {
                                        tooltip << ", "
-                                               << Glib::Markup::escape_text( pn.empty() ? connection_name : pn ).c_str();
+                                               << Gtkmm2ext::markup_escape_text ( pn.empty() ? connection_name : pn );
                                }
 
                                if (connection_name.find("ardour:") == 0) {
index 6ff9de091ed6a2ccb6f99755a63bc29065445c7a..f246871aca6cddfa14deb2865333637fb266201d 100644 (file)
@@ -27,6 +27,7 @@
 #include "gtkmm2ext/tearoff.h"
 #include "gtkmm2ext/actions.h"
 #include "gtkmm2ext/motionfeedback.h"
+#include "gtkmm2ext/utils.h"
 
 #include <gtkmm/menu.h>
 #include <gtkmm/menuitem.h>
@@ -1352,7 +1353,7 @@ MonitorSection::update_output_display ()
        char * tooltip_cstr;
 
        io_count = _route->n_outputs().n_total();
-       tooltip << string_compose (_("<b>OUTPUT</b> from %1"), Glib::Markup::escape_text(_route->name().c_str()));
+       tooltip << string_compose (_("<b>OUTPUT</b> from %1"), Gtkmm2ext::markup_escape_text (_route->name()));
 
 
        for (io_index = 0; io_index < io_count; ++io_index) {
@@ -1378,12 +1379,12 @@ MonitorSection::update_output_display ()
                                }
 
                                if (io_connection_count == 0) {
-                                       tooltip << endl << Glib::Markup::escape_text(port->name().substr(port->name().find("/") + 1)).c_str()
+                                       tooltip << endl << Gtkmm2ext::markup_escape_text (port->name().substr(port->name().find("/") + 1))
                                                << " -> "
-                                               << Glib::Markup::escape_text( pn.empty() ? connection_name : pn ).c_str();
+                                               << Gtkmm2ext::markup_escape_text ( pn.empty() ? connection_name : pn );
                                } else {
                                        tooltip << ", "
-                                               << Glib::Markup::escape_text( pn.empty() ? connection_name : pn ).c_str();
+                                               << Gtkmm2ext::markup_escape_text ( pn.empty() ? connection_name : pn );
                                }
 
                                if (connection_name.find("ardour:") == 0) {
index 027778ca057c1dcfeb68862abe569faeb06b964f..34e0f68c7ed857e5bbcce15fb4a7b87bddc301de 100644 (file)
@@ -32,6 +32,7 @@
 #include "ardour/session.h"
 #include "ardour/route.h"
 #include "ardour/audioengine.h"
+#include "gtkmm2ext/utils.h"
 #include "port_matrix.h"
 #include "port_matrix_body.h"
 #include "port_matrix_component.h"
@@ -1041,7 +1042,7 @@ PortMatrix::update_tab_highlighting ()
                                label->set_text ((*j)->name);
                        } else if (c.length() && c[0] != '<' && has_connection) {
                                /* this label is not marked up with <b> but should be */
-                               label->set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text ((*j)->name).c_str()));
+                               label->set_markup (string_compose ("<b>%1</b>", Gtkmm2ext::markup_escape_text ((*j)->name)));
                        }
 
                        ++p;
index b72fcbe276f605967e149ad648ebc1ea9814f37e..d8a872ad192cae706b4c66ce192945affe6d84ed 100644 (file)
@@ -606,7 +606,7 @@ ProcessorEntry::Control::set_tooltip ()
                snprintf (tmp, sizeof(tmp), "%s: %.2f", _name.c_str(), c->internal_to_user (c->get_value ()));
        }
 
-       string sm = Glib::Markup::escape_text (tmp);
+       string sm = Gtkmm2ext::markup_escape_text (tmp);
        _slider_persistant_tooltip.set_tip (sm);
        ARDOUR_UI_UTILS::set_tooltip (_button, sm);
 }
index 92ae7e0a0fbe7510069befccf5ef8f5f44813cd1..41d7905bf179bbdd2c17fa66b6069c107a1bf0f2 100644 (file)
@@ -1790,8 +1790,8 @@ RouteTimeAxisView::update_playlist_tip ()
                        set_tooltip (
                                playlist_button,
                                string_compose(_("Take: %1.%2"),
-                                       Glib::Markup::escape_text(rg->name()).c_str(),
-                                       Glib::Markup::escape_text(take_name).c_str())
+                                       Gtkmm2ext::markup_escape_text (rg->name()),
+                                       Gtkmm2ext::markup_escape_text (take_name))
                                );
 
                        return;
@@ -1799,7 +1799,7 @@ RouteTimeAxisView::update_playlist_tip ()
        }
 
        /* set the playlist button tooltip to the playlist name */
-       set_tooltip (playlist_button, _("Playlist") + std::string(": ") + Glib::Markup::escape_text(track()->playlist()->name()).c_str());
+       set_tooltip (playlist_button, _("Playlist") + std::string(": ") + Gtkmm2ext::markup_escape_text (track()->playlist()->name()));
 }
 
 
index 68d00baa2f7b13d8ca9070cdabc54d437df653b3..79506f7bd32b5a18ab1a9d1e00adc03a71c6732e 100644 (file)
@@ -1961,7 +1961,7 @@ RouteUI::open_remote_control_id_dialog ()
                if (_route->is_master() || _route->is_monitor()) {
                        l->set_markup (string_compose (_("The remote control ID of %1 is: %2\n\n\n"
                                                         "The remote control ID of %3 cannot be changed."),
-                                                      Glib::Markup::escape_text (_route->name()),
+                                                      Gtkmm2ext::markup_escape_text (_route->name()),
                                                       _route->remote_control_id(),
                                                       (_route->is_master() ? _("the master bus") : _("the monitor bus"))));
                } else {
@@ -1972,7 +1972,7 @@ RouteUI::open_remote_control_id_dialog ()
                                                       _route->remote_control_id(),
                                                       "<span size=\"small\" style=\"italic\">",
                                                       "</span>",
-                                                      Glib::Markup::escape_text (_route->name()),
+                                                      Gtkmm2ext::markup_escape_text (_route->name()),
                                                       PROGRAM_NAME));
                }
                dialog.get_vbox()->pack_start (*l);
index a7a0f0be263279209bce21a09266b68b504fc1c1..915a7cae1043467d56e35dffe6c61fac0238556e 100644 (file)
@@ -39,6 +39,8 @@
 #include "pbd/stl_delete.h"
 #include "pbd/openuri.h"
 
+#include "gtkmm2ext/utils.h"
+
 #include "ardour/audioengine.h"
 #include "ardour/filesystem_paths.h"
 #include "ardour/recent_sessions.h"
@@ -700,7 +702,7 @@ SessionDialog::redisplay_recent_sessions ()
                g_stat (s.c_str(), &gsb);
 
                row[recent_session_columns.fullpath] = dirname; /* just the dir, but this works too */
-               row[recent_session_columns.tip] = Glib::Markup::escape_text (dirname).c_str();
+               row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
                row[recent_session_columns.time_modified] = gsb.st_mtime;
 
                if (Session::get_info_from_path (s, sr, sf) == 0) {
@@ -739,7 +741,7 @@ SessionDialog::redisplay_recent_sessions ()
 
                                child_row[recent_session_columns.visible_name] = *i2;
                                child_row[recent_session_columns.fullpath] = s;
-                               child_row[recent_session_columns.tip] = Glib::Markup::escape_text (dirname).c_str();
+                               child_row[recent_session_columns.tip] = Gtkmm2ext::markup_escape_text (dirname);
                                g_stat (s.c_str(), &gsb);
                                child_row[recent_session_columns.time_modified] = gsb.st_mtime;
 
index 231498cda29d1bc5c37588d468e56596354a367d..c2bd388d6cb5f83014cb445916473c2214650bc7 100644 (file)
@@ -336,7 +336,7 @@ SoundFileBox::setup_labels (const string& filename)
                return false;
        }
 
-       preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename)).c_str()));
+       preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename))));
        std::string n = sf_info.format_name;
        if (n.substr (0, 8) == X_("Format: ")) {
                n = n.substr (8);
index 63ca20d0572f61235accc1a025d6d48ba23752bc..c2522472752988262abb18d77f93ef1657bd7016 100644 (file)
@@ -25,6 +25,8 @@
 #include "ardour/ardour.h"
 #include "ardour/filesystem_paths.h"
 
+#include "gtkmm2ext/utils.h"
+
 #ifdef check
 #undef check
 #endif
@@ -223,7 +225,7 @@ void
 Splash::message (const string& msg)
 {
        string str ("<b>");
-       str += Glib::Markup::escape_text (msg).c_str();
+       str += Gtkmm2ext::markup_escape_text (msg);
        str += "</b>";
 
         show ();