[niepce: 4/22] More C++11
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce: 4/22] More C++11
- Date: Tue, 29 Jul 2014 08:05:50 +0000 (UTC)
commit d4bad176ccd092fe53f9b9cf19c8b582686b4eb1
Author: Hubert Figuière <hub figuiere net>
Date: Thu Jul 17 23:51:26 2014 -0400
More C++11
src/fwk/toolkit/gtkutils.cpp | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/fwk/toolkit/gtkutils.cpp b/src/fwk/toolkit/gtkutils.cpp
index fb37c49..0e9f086 100644
--- a/src/fwk/toolkit/gtkutils.cpp
+++ b/src/fwk/toolkit/gtkutils.cpp
@@ -30,11 +30,9 @@ add_action(const Glib::RefPtr<Gio::ActionMap> & group,
const Glib::RefPtr<Gio::Menu> & menu,
const char* label, const char* context, const char* accel)
{
- Glib::RefPtr<Gio::SimpleAction> an_action
- = Gio::SimpleAction::create(name);
+ auto an_action = Gio::SimpleAction::create(name);
group->add_action(an_action);
- an_action->signal_activate()
- .connect(sigc::hide(slot));
+ an_action->signal_activate().connect(sigc::hide(slot));
if (menu && label && context) {
Glib::ustring detail = Glib::ustring::compose("%1.%2", context, name);
menu->append(label, detail);
@@ -49,7 +47,7 @@ add_action(const Glib::RefPtr<Gio::ActionMap> & group,
Glib::RefPtr<Gtk::ListStore>
ModelRecord::inject(Gtk::TreeView & treeview)
{
- Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(*this);
+ auto model = Gtk::ListStore::create(*this);
treeview.set_model(model);
treeview.append_column("text", m_col1);
return model;
@@ -58,10 +56,10 @@ ModelRecord::inject(Gtk::TreeView & treeview)
Glib::RefPtr<Gtk::ListStore>
ModelRecord::inject(Gtk::ComboBox & combo)
{
- Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(*this);
+ auto model = Gtk::ListStore::create(*this);
combo.set_model(model);
- combo.clear();
- combo.pack_start(m_col1);
+ combo.clear();
+ combo.pack_start(m_col1);
return model;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]