[gtkmm-documentation/gtkmm-3-24] Make conversions between std::string and Glib::ustring explicit
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm-documentation/gtkmm-3-24] Make conversions between std::string and Glib::ustring explicit
- Date: Mon, 18 Nov 2019 15:05:44 +0000 (UTC)
commit 172e5213f9f70f36445d4234d0bc2271e59a0801
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Mon Nov 18 16:03:11 2019 +0100
Make conversions between std::string and Glib::ustring explicit
examples/book/buildapp/step3/exampleappwindow.cc | 2 +-
examples/book/buildapp/step5/exampleappwindow.cc | 2 +-
examples/book/buildapp/step6/exampleappwindow.cc | 2 +-
examples/book/buildapp/step7/exampleappwindow.cc | 2 +-
examples/book/buildapp/step8/exampleappwindow.cc | 2 +-
examples/book/buildapp/step9/exampleappwindow.cc | 2 +-
examples/book/clipboard/ideal/examplewindow.cc | 4 ++--
examples/book/giomm/write_file/main.cc | 2 +-
examples/others/calendar/calendar.cc | 2 +-
examples/others/dnd/dndwindow.cc | 2 +-
10 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/examples/book/buildapp/step3/exampleappwindow.cc
b/examples/book/buildapp/step3/exampleappwindow.cc
index 31e038c..42317a2 100644
--- a/examples/book/buildapp/step3/exampleappwindow.cc
+++ b/examples/book/buildapp/step3/exampleappwindow.cc
@@ -44,7 +44,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/buildapp/step5/exampleappwindow.cc
b/examples/book/buildapp/step5/exampleappwindow.cc
index 66bd536..a2a6a03 100644
--- a/examples/book/buildapp/step5/exampleappwindow.cc
+++ b/examples/book/buildapp/step5/exampleappwindow.cc
@@ -48,7 +48,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/buildapp/step6/exampleappwindow.cc
b/examples/book/buildapp/step6/exampleappwindow.cc
index f2c9088..7762187 100644
--- a/examples/book/buildapp/step6/exampleappwindow.cc
+++ b/examples/book/buildapp/step6/exampleappwindow.cc
@@ -73,7 +73,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/buildapp/step7/exampleappwindow.cc
b/examples/book/buildapp/step7/exampleappwindow.cc
index a9e3af1..4461a3c 100644
--- a/examples/book/buildapp/step7/exampleappwindow.cc
+++ b/examples/book/buildapp/step7/exampleappwindow.cc
@@ -107,7 +107,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/buildapp/step8/exampleappwindow.cc
b/examples/book/buildapp/step8/exampleappwindow.cc
index 402d96f..1b972a0 100644
--- a/examples/book/buildapp/step8/exampleappwindow.cc
+++ b/examples/book/buildapp/step8/exampleappwindow.cc
@@ -127,7 +127,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/buildapp/step9/exampleappwindow.cc
b/examples/book/buildapp/step9/exampleappwindow.cc
index 61c47cd..28b346f 100644
--- a/examples/book/buildapp/step9/exampleappwindow.cc
+++ b/examples/book/buildapp/step9/exampleappwindow.cc
@@ -136,7 +136,7 @@ ExampleAppWindow* ExampleAppWindow::create()
void ExampleAppWindow::open_file_view(const Glib::RefPtr<Gio::File>& file)
{
- const auto basename = file->get_basename();
+ const Glib::ustring basename = file->get_basename();
auto scrolled = Gtk::make_managed<Gtk::ScrolledWindow>();
scrolled->set_hexpand(true);
diff --git a/examples/book/clipboard/ideal/examplewindow.cc b/examples/book/clipboard/ideal/examplewindow.cc
index 6441a8c..e00f6e1 100644
--- a/examples/book/clipboard/ideal/examplewindow.cc
+++ b/examples/book/clipboard/ideal/examplewindow.cc
@@ -136,8 +136,8 @@ void ExampleWindow::on_clipboard_get(Gtk::SelectionData& selection_data,
if(target == example_target_custom)
{
- // This set() override uses an 8-bit text format for the data.
- selection_data.set(example_target_custom, m_ClipboardStore);
+ // This set() overload uses an 8-bit text format for the data.
+ selection_data.set(example_target_custom, m_ClipboardStore.raw());
}
else if(target == example_target_text)
{
diff --git a/examples/book/giomm/write_file/main.cc b/examples/book/giomm/write_file/main.cc
index cd50eab..cc725b1 100644
--- a/examples/book/giomm/write_file/main.cc
+++ b/examples/book/giomm/write_file/main.cc
@@ -43,7 +43,7 @@ int main(int /* argc */, char** /* argv */)
std::cerr << "Gio::File::create_file() returned an empty RefPtr." << std::endl;
Glib::ustring contents = "This is some test output";
- const gsize bytes_read = stream->write(contents);
+ const gsize bytes_read = stream->write(contents.raw());
if(bytes_read)
std::cout << "File contents written: " << contents << std::endl;
diff --git a/examples/others/calendar/calendar.cc b/examples/others/calendar/calendar.cc
index 9d6760e..977a91b 100644
--- a/examples/others/calendar/calendar.cc
+++ b/examples/others/calendar/calendar.cc
@@ -130,7 +130,7 @@ void CalendarExample::on_font_button_font_set()
try
{
- css_provider_->load_from_data(css);
+ css_provider_->load_from_data(css.raw());
}
catch (const Gtk::CssProviderError& ex)
{
diff --git a/examples/others/dnd/dndwindow.cc b/examples/others/dnd/dndwindow.cc
index 00e6598..6f904ee 100644
--- a/examples/others/dnd/dndwindow.cc
+++ b/examples/others/dnd/dndwindow.cc
@@ -181,7 +181,7 @@ bool DnDWindow::on_image_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context
std::vector<std::string> targets = context->list_targets();
if(!targets.empty())
{
- drag_get_data( context, targets[0], time );
+ drag_get_data( context, Glib::ustring(targets[0]), time );
}
return true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]