Commit 0b78d533 authored by Murray Cumming's avatar Murray Cumming
Browse files

Window_RelationshipsOverview: Use std::unique_ptr instead of a naked new.

parent 1adf8945
......@@ -44,7 +44,6 @@ const bool Window_RelationshipsOverview::glade_developer(true);
Window_RelationshipsOverview::Window_RelationshipsOverview(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
: Gtk::ApplicationWindow(cobject),
m_builder(builder),
m_menu(nullptr),
m_modified(false),
m_scrolledwindow_canvas(nullptr)
{
......@@ -83,10 +82,9 @@ Window_RelationshipsOverview::Window_RelationshipsOverview(BaseObjectType* cobje
if(!gmenu)
g_warning("GMenu not found");
m_menu = new Gtk::MenuBar(gmenu);
vbox->pack_start(*m_menu, Gtk::PACK_SHRINK);
m_menu->show();
auto menu = std::make_unique<Gtk::MenuBar>(gmenu);
menu->show();
vbox->pack_start(*(Gtk::manage(menu.release())), Gtk::PACK_SHRINK);
//Get the scolled window and add the canvas to it:
......@@ -465,7 +463,7 @@ void Window_RelationshipsOverview::setup_context_menu()
if(!gmenu)
g_warning("GMenu not found");
m_context_menu = new Gtk::Menu(gmenu);
m_context_menu = std::make_unique<Gtk::Menu>(gmenu);
m_context_menu->attach_to_widget(*this);
}
......
......@@ -80,7 +80,6 @@ private:
Glib::RefPtr<Gtk::Builder> m_builder;
Glib::RefPtr<Gio::SimpleAction> m_action_showgrid;
Gtk::MenuBar* m_menu;
bool m_modified;
CanvasEditable m_canvas;
......@@ -98,7 +97,7 @@ private:
type_list_connections m_list_table_connections;
//Context menu:
Gtk::Menu* m_context_menu;
std::unique_ptr<Gtk::Menu> m_context_menu;
Glib::RefPtr<Gio::SimpleAction> m_action_edit_fields, m_action_edit_relationships;
sigc::connection m_connection_edit_fields, m_connection_edit_relationships;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment