[glom] C++11: Use auto for Glib::RefPtr<>s.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: Use auto for Glib::RefPtr<>s.
- Date: Thu, 7 Jan 2016 21:46:16 +0000 (UTC)
commit dd352eab2cd30136318b9172a1b764a68fd6db0d
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Jan 7 22:45:56 2016 +0100
C++11: Use auto for Glib::RefPtr<>s.
glom/application.cc | 2 +-
glom/appwindow.cc | 54 +++++++-------
glom/base_db.cc | 16 ++--
glom/base_db_table_data.cc | 16 ++--
glom/dialog_existing_or_new.cc | 8 +-
glom/frame_glom.cc | 16 ++--
glom/glom_create_from_example.cc | 14 ++--
glom/glom_export_po.cc | 4 +-
glom/glom_export_po_all.cc | 4 +-
glom/glom_import_po_all.cc | 8 +-
glom/libglom/connectionpool.cc | 4 +-
glom/libglom/connectionpool_backends/mysql.cc | 2 +-
glom/libglom/connectionpool_backends/mysql_self.cc | 2 +-
glom/libglom/connectionpool_backends/postgres.cc | 2 +-
.../connectionpool_backends/postgres_self.cc | 2 +-
glom/libglom/connectionpool_backends/sqlite.cc | 2 +-
glom/libglom/db_utils.cc | 74 ++++++++++----------
glom/libglom/document/document.cc | 4 +-
glom/libglom/privs.cc | 24 +++---
glom/libglom/python_embed/py_glom_record.cc | 2 +-
glom/libglom/python_embed/py_glom_relatedrecord.cc | 12 ++--
glom/libglom/report_builder.cc | 14 ++--
glom/libglom/spawn_with_feedback.cc | 12 ++--
glom/libglom/utils.cc | 48 ++++++------
glom/libglom/xsl_utils.cc | 2 +-
glom/main.cc | 2 +-
glom/mode_data/box_data.cc | 4 +-
glom/mode_data/box_data_calendar_related.cc | 8 +-
glom/mode_data/box_data_details.cc | 4 +-
glom/mode_data/box_data_list.cc | 12 ++--
glom/mode_data/box_data_list_related.cc | 4 +-
glom/mode_data/box_data_portal.cc | 4 +-
glom/mode_data/datawidget/cellrenderer_dblist.cc | 8 +-
glom/mode_data/datawidget/combo.cc | 8 +-
.../datawidget/combochoiceswithtreemodel.cc | 6 +-
glom/mode_data/datawidget/datawidget.cc | 2 +-
glom/mode_data/datawidget/treemodel_db.cc | 14 ++--
glom/mode_data/db_adddel/db_adddel.cc | 24 +++---
glom/mode_data/flowtablewithfields.cc | 4 +-
glom/mode_design/box_db_table_relationships.cc | 4 +-
glom/mode_design/dialog_database_preferences.cc | 12 ++--
glom/mode_design/fields/box_db_table_definition.cc | 14 ++--
.../mode_design/fields/dialog_defaultformatting.cc | 2 +-
glom/mode_design/fields/dialog_fieldcalculation.cc | 6 +-
glom/mode_design/fields/dialog_fielddefinition.cc | 6 +-
glom/mode_design/layout/combobox_fields.cc | 2 +-
glom/mode_design/layout/combobox_relationship.cc | 2 +-
glom/mode_design/layout/dialog_choose_field.cc | 12 ++--
.../layout/dialog_choose_relationship.cc | 4 +-
glom/mode_design/layout/dialog_layout.cc | 8 +-
.../layout/dialog_layout_calendar_related.cc | 6 +-
glom/mode_design/layout/dialog_layout_details.cc | 32 ++++----
glom/mode_design/layout/dialog_layout_export.cc | 12 ++--
.../layout/dialog_layout_list_related.cc | 6 +-
.../layout_item_dialogs/dialog_buttonscript.cc | 6 +-
.../layout_item_dialogs/dialog_fieldslist.cc | 16 ++--
.../layout_item_dialogs/dialog_sortfields.cc | 12 ++--
glom/mode_design/layout/treestore_layout.cc | 2 +-
.../print_layouts/window_print_layout_edit.cc | 42 ++++++------
.../relationships_overview/canvas_group_dbtable.cc | 8 +-
.../printoperation_relationshipsoverview.cc | 2 +-
.../window_relationships_overview.cc | 32 ++++----
.../report_layout/dialog_layout_report.cc | 40 +++++-----
.../report_layout/treestore_report_layout.cc | 2 +-
.../script_library/dialog_script_library.cc | 6 +-
glom/mode_design/translation/combobox_locale.cc | 2 +-
.../mode_design/translation/window_translations.cc | 4 +-
glom/mode_design/users/dialog_groups_list.cc | 12 ++--
glom/mode_design/users/dialog_users_list.cc | 10 ++--
glom/navigation/box_tables.cc | 4 +-
glom/print_layout/canvas_layout_item.cc | 46 ++++++------
glom/print_layout/canvas_print_layout.cc | 68 +++++++++---------
glom/print_layout/print_layout_utils.cc | 2 +-
glom/utility_widgets/adddel/adddel.cc | 12 ++--
glom/utility_widgets/adddel/adddel_withbuttons.cc | 2 +-
glom/utility_widgets/canvas/canvas_editable.cc | 18 +++---
glom/utility_widgets/canvas/canvas_group_grid.cc | 6 +-
.../utility_widgets/canvas/canvas_group_movable.cc | 12 ++--
.../canvas/canvas_group_resizable.cc | 46 ++++++------
.../utility_widgets/canvas/canvas_image_movable.cc | 4 +-
glom/utility_widgets/canvas/canvas_item_movable.cc | 42 ++++++------
.../utility_widgets/canvas/canvas_table_movable.cc | 4 +-
.../utility_widgets/canvas/test_canvas_editable.cc | 30 ++++----
glom/utility_widgets/combo_textglade.cc | 2 +-
glom/utility_widgets/dialog_image_load_progress.cc | 2 +-
.../eggspreadtablemm/test_spreadtablednd.cc | 2 +-
glom/utility_widgets/imageglom.cc | 18 +++---
glom/utility_widgets/layoutwidgetmenu.cc | 2 +-
glom/utility_widgets/layoutwidgetutils.cc | 2 +-
glom/utility_widgets/notebooklabelglom.cc | 2 +-
glom/utility_widgets/test_flowtable.cc | 2 +-
glom/utils_ui.cc | 14 ++--
tests/glade_toplevels_instantiation.cc | 4 +-
tests/import/utils.cc | 8 +-
.../python/test_python_execute_func_with_record.cc | 2 +-
tests/test_document_autosave.cc | 2 +-
tests/test_document_load_and_save.cc | 2 +-
tests/test_glade_derived_instantiation.cc | 2 +-
tests/test_selfhosting_new_then_change_columns.cc | 2 +-
tests/test_selfhosting_new_then_image.cc | 2 +-
tests/test_selfhosting_sqlinjection.cc | 4 +-
tests/test_selfhosting_utils.cc | 10 ++--
102 files changed, 578 insertions(+), 578 deletions(-)
---
diff --git a/glom/application.cc b/glom/application.cc
index 71e1dd3..09f8d68 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -119,7 +119,7 @@ void Application::on_open(const Gio::Application::type_vec_files& files,
//std::cout << "debug: files.size()=" << files.size() << std::endl;
for(guint i = 0; i < files.size(); i++)
{
- Glib::RefPtr<Gio::File> file = files[i];
+ auto file = files[i];
if(!file)
{
std::cerr << G_STRFUNC << ": file is null." << std::endl;
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index 2174f80..33ece9d 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -111,9 +111,9 @@ AppWindow::AppWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>&
builder->get_widget_derived("infobar_progress", m_infobar_progress);
//Add menu bar at the top:
- Glib::RefPtr<Glib::Object> object =
+ auto object =
builder->get_object("mainmenu");
- Glib::RefPtr<Gio::Menu> gmenu =
+ auto gmenu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!gmenu)
g_warning("GMenu not found");
@@ -291,7 +291,7 @@ void AppWindow::init_menus_file()
#ifndef GLOM_ENABLE_CLIENT_ONLY
- Glib::RefPtr<Gio::SimpleAction> action_print_edit =
+ auto action_print_edit =
m_refActionGroup_File->add_action("edit-print-layouts",
sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_file_print_edit_layouts));
m_listDeveloperActions.push_back(action_print_edit);
@@ -449,7 +449,7 @@ void AppWindow::on_menu_help_about()
{
m_pAbout->set_transient_for(*this);
- Glib::RefPtr<Gdk::Window> about_win = m_pAbout->get_window();
+ auto about_win = m_pAbout->get_window();
about_win->show();
about_win->raise();
}
@@ -477,7 +477,7 @@ void AppWindow::on_menu_help_about()
//TODO: Use this, instead of the C API, when we can depend on gtkmm 3.12, with a try/catch:
//Glib::RefPtr<Gdk::Pixbuf> logo = Gdk::Pixbuf::create_from_resource(glom_icon_path);
GError* gerror = nullptr;
- Glib::RefPtr<Gdk::Pixbuf> logo =
+ auto logo =
Glib::wrap(gdk_pixbuf_new_from_resource(glom_icon_path.c_str(), &gerror));
if(gerror)
{
@@ -1791,9 +1791,9 @@ void AppWindow::fill_menu_tables()
m_refNavTablesActionGroup = Gio::SimpleActionGroup::create();
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("tables-list");
- Glib::RefPtr<Gio::Menu> menu =
+ auto menu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!menu)
{
@@ -1823,7 +1823,7 @@ void AppWindow::fill_menu_tables()
menu->append(title, ACTION_GROUP_NAME_TABLES + "." + action_name);
- Glib::RefPtr<Gio::SimpleAction> action = m_refNavTablesActionGroup->add_action(action_name,
+ auto action = m_refNavTablesActionGroup->add_action(action_name,
sigc::bind( sigc::mem_fun(*m_pFrame, &Frame_Glom::on_box_tables_selected), table_info->get_name()) );
m_listNavTableActions.push_back(action);
}
@@ -1837,9 +1837,9 @@ void AppWindow::fill_menu_reports(const Glib::ustring& table_name)
m_listNavReportActions.clear();
//Remove existing items.
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("reports-list");
- Glib::RefPtr<Gio::Menu> menu =
+ auto menu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!menu)
{
@@ -1881,7 +1881,7 @@ void AppWindow::fill_menu_reports(const Glib::ustring& table_name)
menu->append(title, ACTION_GROUP_NAME_REPORTS + "." + report_name);
- Glib::RefPtr<Gio::SimpleAction> action = m_refNavReportsActionGroup->add_action(action_name,
+ auto action = m_refNavReportsActionGroup->add_action(action_name,
sigc::bind( sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_report_selected), report->get_name()) );
m_listNavReportActions.push_back(action);
}
@@ -1917,9 +1917,9 @@ void AppWindow::fill_menu_print_layouts(const Glib::ustring& table_name)
m_listNavPrintLayoutActions.clear();
//Remove existing items.
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("print-layouts-list");
- Glib::RefPtr<Gio::Menu> menu =
+ auto menu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!menu)
{
@@ -1964,7 +1964,7 @@ void AppWindow::fill_menu_print_layouts(const Glib::ustring& table_name)
menu->append(title, ACTION_GROUP_NAME_PRINT_LAYOUTS + "." + action_name);
- Glib::RefPtr<Gio::SimpleAction> action = m_refNavPrintLayoutsActionGroup->add_action(action_name,
+ auto action = m_refNavPrintLayoutsActionGroup->add_action(action_name,
sigc::bind( sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_print_layout_selected), name) );
m_listNavPrintLayoutActions.push_back(action);
@@ -2121,10 +2121,10 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
{
//Just start with the parent folder,
//instead of the whole name, to avoid overwriting:
- Glib::RefPtr<Gio::File> gio_file = Gio::File::create_for_uri(old_file_uri);
+ auto gio_file = Gio::File::create_for_uri(old_file_uri);
if(gio_file)
{
- Glib::RefPtr<Gio::File> parent = gio_file->get_parent();
+ auto parent = gio_file->get_parent();
if(parent)
{
const auto uri_parent = parent->get_uri();
@@ -2151,7 +2151,7 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
const auto uri = Utils::get_file_uri_without_extension(uri_chosen);
//Check whether the file exists, and that we have rights to it:
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
if(!file)
return Glib::ustring(); //Failure.
@@ -2226,7 +2226,7 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
//Check that the directory does not exist already.
//The GtkFileChooser could not check for that because it could not know that we would create a
directory based on the filename:
//Note that uri has no extension at this point:
- Glib::RefPtr<Gio::File> dir = Gio::File::create_for_uri(uri);
+ auto dir = Gio::File::create_for_uri(uri);
if(dir->query_exists())
{
ui_warning(_("Directory Already Exists"), _("There is an existing directory with the same name as
the directory that should be created for the new database files. You should specify a different filename to
use a new directory instead."));
@@ -2248,11 +2248,11 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
}
//Add the filename (Note that the caller will add the extension if necessary, so we don't do it
here.)
- Glib::RefPtr<Gio::File> file_with_ext = Gio::File::create_for_uri(uri_chosen);
+ auto file_with_ext = Gio::File::create_for_uri(uri_chosen);
const auto filename_part = file_with_ext->get_basename();
//Add the filename part to the newly-created directory:
- Glib::RefPtr<Gio::File> file_whole = dir->get_child(filename_part);
+ auto file_whole = dir->get_child(filename_part);
return file_whole->get_uri();
}
@@ -2396,7 +2396,7 @@ void AppWindow::on_menu_developer_restore_backup()
file_dlg.set_transient_for(*this);
file_dlg.set_local_only(); //Because we can't untar remote files.
- Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
+ auto filter = Gtk::FileFilter::create();
filter->set_name(_(".tar.gz Backup files"));
filter->add_pattern("*.tar.gz");
filter->add_pattern("*.tgz");
@@ -2865,10 +2865,10 @@ void AppWindow::on_menu_edit_copy_activate()
auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
+ auto buffer = textview->get_buffer();
if(buffer)
{
- Glib::RefPtr<Gtk::Clipboard> clipboard =
+ auto clipboard =
Gtk::Clipboard::get_for_display(get_display());
buffer->copy_clipboard(clipboard);
}
@@ -2891,10 +2891,10 @@ void AppWindow::on_menu_edit_cut_activate()
auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
+ auto buffer = textview->get_buffer();
if(buffer)
{
- Glib::RefPtr<Gtk::Clipboard> clipboard =
+ auto clipboard =
Gtk::Clipboard::get_for_display(get_display());
buffer->cut_clipboard(clipboard, textview->get_editable());
}
@@ -2917,10 +2917,10 @@ void AppWindow::on_menu_edit_paste_activate()
auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
+ auto buffer = textview->get_buffer();
if(buffer)
{
- Glib::RefPtr<Gtk::Clipboard> clipboard =
+ auto clipboard =
Gtk::Clipboard::get_for_display(get_display());
buffer->paste_clipboard(clipboard);
}
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 703a522..e61329d 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -324,7 +324,7 @@ Glib::RefPtr<Gnome::Gda::Connection> Base_DB::get_connection()
return Glib::RefPtr<Gnome::Gda::Connection>();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
return gda_connection;
}
@@ -742,11 +742,11 @@ void Base_DB::calculate_field_in_all_records(const Glib::ustring& table_name, co
{
//Get primary key values for every record:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(primary_key->get_name(), table_name);
builder->select_add_target(table_name);
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
+ auto data_model = DbUtils::query_execute_select(builder);
if(!data_model || !data_model->get_n_rows() || !data_model->get_n_columns())
{
//HandleError();
@@ -1030,7 +1030,7 @@ Gnome::Gda::Value Base_DB::get_field_value_in_database(const LayoutFieldInRecord
type_vecConstLayoutFields list_fields;
auto layout_item = field_in_record.m_field;
list_fields.push_back(layout_item);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query =
Utils::build_sql_select_with_key(field_in_record.m_table_name,
+ auto sql_query = Utils::build_sql_select_with_key(field_in_record.m_table_name,
list_fields, field_in_record.m_key, field_in_record.m_key_value, type_sort_clause(), 1);
Glib::RefPtr<const Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(sql_query);
@@ -1070,7 +1070,7 @@ Gnome::Gda::Value Base_DB::get_field_value_in_database(const std::shared_ptr<Fie
auto layout_item = std::make_shared<LayoutItem_Field>();
layout_item->set_full_field_details(field);
list_fields.push_back(layout_item);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query =
Utils::build_sql_select_with_where_clause(found_set.m_table_name,
+ auto sql_query = Utils::build_sql_select_with_where_clause(found_set.m_table_name,
list_fields,
found_set.m_where_clause,
std::shared_ptr<const Relationship>() /* extra_join */, type_sort_clause(),
@@ -1290,7 +1290,7 @@ bool Base_DB::get_field_value_is_unique(const Glib::ustring& table_name, const s
const auto table_name_used = field->get_table_used(table_name);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(field->get_name(), table_name_used);
builder->select_add_target(table_name_used);
@@ -1372,7 +1372,7 @@ bool Base_DB::get_primary_key_is_in_foundset(const FoundSet& found_set, const Gn
layout_item->set_full_field_details(primary_key);
fieldsToGet.push_back(layout_item);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_target(found_set.m_table_name);
const auto eq_id = builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
@@ -1393,7 +1393,7 @@ bool Base_DB::get_primary_key_is_in_foundset(const FoundSet& found_set, const Gn
builder->set_where(cond_id); //This might be unnecessary.
cond_id = eq_id;
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query =
+ auto query =
Utils::build_sql_select_with_where_clause(found_set.m_table_name, fieldsToGet,
builder->export_expression(cond_id));
Glib::RefPtr<const Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(query);
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 2f8de86..3b9eb58 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -82,13 +82,13 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
}
//Get all entered field name/value pairs:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
builder->set_table(m_table_name);
//Avoid specifying the same field twice:
typedef std::map<Glib::ustring, bool> type_map_added;
type_map_added map_added;
- Glib::RefPtr<Gnome::Gda::Set> params = Gnome::Gda::Set::create();
+ auto params = Gnome::Gda::Set::create();
for(const auto& layout_item : fieldsToAdd)
{
@@ -283,7 +283,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const std::shared_ptr<cons
//Generate the new key value;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_insert =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ auto builder_insert = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
builder_insert->set_table(relationship->get_to_table());
builder_insert->add_field_value(primary_key_field->get_name(), primary_key_value);
if(!DbUtils::query_execute(builder_insert))
@@ -328,7 +328,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const std::shared_ptr<cons
else
{
const auto target_table = relationship->get_from_table();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_update =
+ auto builder_update =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder_update->set_table(target_table);
builder_update->add_field_value_as_value(relationship->get_from_field(), primary_key_value);
@@ -385,7 +385,7 @@ bool Base_DB_Table_Data::record_delete(const Gnome::Gda::Value& primary_key_valu
auto field_primary_key = get_field_primary_key();
if(field_primary_key && !Conversions::value_is_empty(primary_key_value))
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_DELETE);
builder->set_table(m_table_name);
builder->set_where(
@@ -422,7 +422,7 @@ bool Base_DB_Table_Data::get_related_record_exists(const std::shared_ptr<const R
const auto related_table = relationship->get_to_table();
//TODO_Performance: Is this the best way to just find out whether there is one record that meets this
criteria?
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(to_field, related_table);
builder->select_add_target(related_table);
@@ -431,7 +431,7 @@ bool Base_DB_Table_Data::get_related_record_exists(const std::shared_ptr<const R
builder->add_field_id(to_field, related_table),
builder->add_expr(key_value)));
- Glib::RefPtr<Gnome::Gda::DataModel> records = DbUtils::query_execute_select(builder);
+ auto records = DbUtils::query_execute_select(builder);
if(!records)
handle_error();
else
@@ -492,7 +492,7 @@ void Base_DB_Table_Data::refresh_related_fields(const LayoutFieldInRecord& field
if(!fieldsToGet.empty())
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query =
Utils::build_sql_select_with_key(field_in_record_changed.m_table_name, fieldsToGet,
field_in_record_changed.m_key, field_in_record_changed.m_key_value);
+ auto query = Utils::build_sql_select_with_key(field_in_record_changed.m_table_name, fieldsToGet,
field_in_record_changed.m_key, field_in_record_changed.m_key_value);
//std::cout << "debug: " << G_STRFUNC << ": query=" << query << std::endl;
Glib::RefPtr<const Gnome::Gda::DataModel> result = DbUtils::query_execute_select(query);
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 06f06b4..2fd41bd 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -203,7 +203,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
m_notebook->signal_switch_page().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_switch_page));
#endif /* !GLOM_ENABLE_CLIENT_ONLY */
- Glib::RefPtr<Gtk::TreeView::Selection> existing_view_selection = m_existing_view->get_selection();
+ auto existing_view_selection = m_existing_view->get_selection();
existing_view_selection->signal_changed().connect(sigc::mem_fun(*this,
&Dialog_ExistingOrNew::on_existing_selection_changed));
existing_view_selection->set_select_function( sigc::mem_fun(*this,
&Dialog_ExistingOrNew::on_existing_select_func) );
@@ -231,7 +231,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
m_iter_new_template_dummy = create_dummy_item_new(m_iter_new_template, "No templates available.");
- Glib::RefPtr<Gtk::TreeView::Selection> new_view_selection = m_new_view->get_selection();
+ auto new_view_selection = m_new_view->get_selection();
new_view_selection->signal_changed().connect(sigc::mem_fun(*this,
&Dialog_ExistingOrNew::on_new_selection_changed));
new_view_selection->set_select_function( sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_new_select_func) );
#else /* GLOM_ENABLE_CLIENT_ONLY */
@@ -639,7 +639,7 @@ Glib::ustring Dialog_ExistingOrNew::get_title_from_example(const std::string& re
{
try
{
- Glib::RefPtr<Gio::InputStream> stream =
+ auto stream =
Gio::Resource::open_stream_global(resource_name);
//TODO: Really do this asynchronously?
@@ -786,7 +786,7 @@ void Dialog_ExistingOrNew::on_select_clicked()
dialog.add_button(_("_Open"), Gtk::RESPONSE_OK);
dialog.set_default_response(Gtk::RESPONSE_OK);
- Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
+ auto filter = Gtk::FileFilter::create();
filter->add_mime_type("application/x-glom");
filter->set_name("Glom files");
dialog.add_filter(filter);
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 3f3d300..000cdb8 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -388,7 +388,7 @@ void Frame_Glom::show_table_allow_empty(const Glib::ustring& table_name, const G
layout_item_temp->set_full_field_details(field_primary_key);
type_vecLayoutFields layout_fields;
layout_fields.push_back(layout_item_temp);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query_without_sort =
Utils::build_sql_select_with_where_clause(found_set.m_table_name, layout_fields, found_set.m_where_clause,
found_set.m_extra_join, type_sort_clause());
+ auto sql_query_without_sort = Utils::build_sql_select_with_where_clause(found_set.m_table_name,
layout_fields, found_set.m_where_clause, found_set.m_extra_join, type_sort_clause());
const Privileges table_privs = Privs::get_current_privs(found_set.m_table_name);
int count = 0;
@@ -596,10 +596,10 @@ void Frame_Glom::export_data_to_vector(Document::type_example_rows& the_vector,
return;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query =
Utils::build_sql_select_with_where_clause(found_set.m_table_name, fieldsSequence, found_set.m_where_clause,
found_set.m_extra_join, found_set.m_sort_clause);
+ auto query = Utils::build_sql_select_with_where_clause(found_set.m_table_name, fieldsSequence,
found_set.m_where_clause, found_set.m_extra_join, found_set.m_sort_clause);
//TODO: Lock the database (prevent changes) during export.
- Glib::RefPtr<Gnome::Gda::DataModel> result = DbUtils::query_execute_select(query);
+ auto result = DbUtils::query_execute_select(query);
guint rows_count = 0;
if(result)
@@ -646,7 +646,7 @@ void Frame_Glom::export_data_to_stream(std::ostream& the_stream, const FoundSet&
return;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query =
Utils::build_sql_select_with_where_clause(found_set.m_table_name, fieldsSequence, found_set.m_where_clause,
found_set.m_extra_join, found_set.m_sort_clause);
+ auto query = Utils::build_sql_select_with_where_clause(found_set.m_table_name, fieldsSequence,
found_set.m_where_clause, found_set.m_extra_join, found_set.m_sort_clause);
//TODO: Lock the database (prevent changes) during export.
Glib::RefPtr<const Gnome::Gda::DataModel> result = DbUtils::query_execute_select(query);
@@ -736,11 +736,11 @@ void Frame_Glom::on_menu_file_import()
Gtk::FileChooserDialog file_chooser(*get_app_window(), _("Open CSV Document"),
Gtk::FILE_CHOOSER_ACTION_OPEN);
file_chooser.add_button(_("_Cancel"), Gtk::RESPONSE_CANCEL);
file_chooser.add_button(_("_Open"), Gtk::RESPONSE_ACCEPT);
- Glib::RefPtr<Gtk::FileFilter> filter_csv = Gtk::FileFilter::create();
+ auto filter_csv = Gtk::FileFilter::create();
filter_csv->set_name(_("CSV files"));
filter_csv->add_mime_type("text/csv");
file_chooser.add_filter(filter_csv);
- Glib::RefPtr<Gtk::FileFilter> filter_any = Gtk::FileFilter::create();
+ auto filter_any = Gtk::FileFilter::create();
filter_any->set_name(_("All files"));
filter_any->add_pattern("*");
file_chooser.add_filter(filter_any);
@@ -1457,7 +1457,7 @@ void Frame_Glom::update_table_in_document_from_database()
else //if it was found.
{
//Compare the information:
- Glib::RefPtr<Gnome::Gda::Column> field_info_db = field_database->get_field_info();
+ auto field_info_db = field_database->get_field_info();
auto field_document = *iterFindDoc;
if(field_document)
{
@@ -1806,7 +1806,7 @@ void Frame_Glom::add_window_to_app(Gtk::ApplicationWindow* window)
}
//This probably lets the GtkApplication know about the window's actions, which might be useful.
- Glib::RefPtr<Gtk::Application> app = app_window->get_application();
+ auto app = app_window->get_application();
if(app)
app->add_window(*window);
else
diff --git a/glom/glom_create_from_example.cc b/glom/glom_create_from_example.cc
index 0f83b6c..bd87b93 100644
--- a/glom/glom_create_from_example.cc
+++ b/glom/glom_create_from_example.cc
@@ -153,12 +153,12 @@ static bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
//(Recursively) Delete any child files and directories,
//so we can delete this directory.
- Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
+ auto enumerator = directory->enumerate_children();
- Glib::RefPtr<Gio::FileInfo> info = enumerator->next_file();
+ auto info = enumerator->next_file();
while(info)
{
- Glib::RefPtr<Gio::File> child = directory->get_child(info->get_name());
+ auto child = directory->get_child(info->get_name());
bool removed_child = false;
if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
removed_child = delete_directory(child);
@@ -186,7 +186,7 @@ static bool delete_directory(const std::string& uri)
if(uri.empty())
return true;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
return delete_directory(file);
}
@@ -287,7 +287,7 @@ int main(int argc, char* argv[])
if(!input_uri.empty())
{
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(input_uri);
+ auto file = Gio::File::create_for_commandline_arg(input_uri);
if(!file->query_exists())
{
@@ -328,7 +328,7 @@ int main(int argc, char* argv[])
else
{
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(group.m_arg_filepath_dir_output);
+ auto file = Gio::File::create_for_commandline_arg(group.m_arg_filepath_dir_output);
if(!file->query_exists())
{
@@ -389,7 +389,7 @@ int main(int argc, char* argv[])
if(uri.empty())
return EXIT_FAILURE;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(uri);
+ auto file = Gio::File::create_for_commandline_arg(uri);
if(file->query_exists())
{
std::cerr << G_STRFUNC << ": The output path already exists: " << filepath_dir << std::endl;
diff --git a/glom/glom_export_po.cc b/glom/glom_export_po.cc
index b63d425..820762e 100644
--- a/glom/glom_export_po.cc
+++ b/glom/glom_export_po.cc
@@ -152,7 +152,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_input = Gio::File::create_for_commandline_arg(input_uri);
+ auto file_input = Gio::File::create_for_commandline_arg(input_uri);
//Make sure it is really a URI:
input_uri = file_input->get_uri();
@@ -183,7 +183,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_output);
+ auto file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_output);
const auto output_uri = file_output->get_uri();
/* Silently overwriting is easier when we use this in a batch:
diff --git a/glom/glom_export_po_all.cc b/glom/glom_export_po_all.cc
index 9d66ae5..8e8f230 100644
--- a/glom/glom_export_po_all.cc
+++ b/glom/glom_export_po_all.cc
@@ -133,7 +133,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_input = Gio::File::create_for_commandline_arg(input_uri);
+ auto file_input = Gio::File::create_for_commandline_arg(input_uri);
//Make sure it is really a URI:
input_uri = file_input->get_uri();
@@ -164,7 +164,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_output);
+ auto file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_output);
//Create the directory, if necessary:
if(!(file_output->query_exists()))
diff --git a/glom/glom_import_po_all.cc b/glom/glom_import_po_all.cc
index 79bde63..71cc041 100644
--- a/glom/glom_import_po_all.cc
+++ b/glom/glom_import_po_all.cc
@@ -134,7 +134,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_input = Gio::File::create_for_commandline_arg(input_uri);
+ auto file_input = Gio::File::create_for_commandline_arg(input_uri);
//Make sure it is really a URI:
input_uri = file_input->get_uri();
@@ -165,7 +165,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_po_input);
+ auto file_output = Gio::File::create_for_commandline_arg(group.m_arg_filepath_po_input);
file_type = file_output->query_file_type();
if(file_type != Gio::FILE_TYPE_DIRECTORY)
@@ -190,11 +190,11 @@ int main(int argc, char* argv[])
}
//Import all .po files from the directory:
- Glib::RefPtr<Gio::FileEnumerator> enumerator = file_output->enumerate_children();
+ auto enumerator = file_output->enumerate_children();
Glib::RefPtr<Gio::FileInfo> info;
while( (info = enumerator->next_file()) )
{
- Glib::RefPtr<Gio::File> child = file_output->get_child(info->get_name());
+ auto child = file_output->get_child(info->get_name());
if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
continue;
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index a6f958d..b6fe7b5 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -572,7 +572,7 @@ bool ConnectionPool::handle_error_cerr_only()
if(sharedconnection)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
const auto list_errors = gda_connection->get_events();
@@ -864,7 +864,7 @@ gboolean ConnectionPool::on_publisher_document_authentication(EpcAuthContext* co
//Attempt a connection with this username/password:
std::shared_ptr<ExceptionConnection> error;
- Glib::RefPtr<Gnome::Gda::Connection> connection =
connection_pool->m_backend->connect(connection_pool->get_database(), user_name, password);
+ auto connection = connection_pool->m_backend->connect(connection_pool->get_database(), user_name,
password);
if(connection)
{
diff --git a/glom/libglom/connectionpool_backends/mysql.cc b/glom/libglom/connectionpool_backends/mysql.cc
index fbf3f88..2a4a2ac 100644
--- a/glom/libglom/connectionpool_backends/mysql.cc
+++ b/glom/libglom/connectionpool_backends/mysql.cc
@@ -408,7 +408,7 @@ bool MySQL::attempt_create_database(const SlotProgress& slot_progress, const Gli
if(slot_progress)
slot_progress();
- Glib::RefPtr<Gnome::Gda::ServerOperation> op =
+ auto op =
Gnome::Gda::ServerOperation::prepare_create_database("MySQL", database_name);
if(slot_progress)
diff --git a/glom/libglom/connectionpool_backends/mysql_self.cc
b/glom/libglom/connectionpool_backends/mysql_self.cc
index 2c79caf..8e2db1e 100644
--- a/glom/libglom/connectionpool_backends/mysql_self.cc
+++ b/glom/libglom/connectionpool_backends/mysql_self.cc
@@ -438,7 +438,7 @@ Backend::StartupErrors MySQLSelfHosted::startup(const SlotProgress& slot_progres
void MySQLSelfHosted::show_active_connections()
{
/* TODO_MySQL
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field("*", "pg_stat_activity");
builder->select_add_target("pg_stat_activity");
diff --git a/glom/libglom/connectionpool_backends/postgres.cc
b/glom/libglom/connectionpool_backends/postgres.cc
index 3b03d48..7c3fc9d 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -394,7 +394,7 @@ bool Postgres::attempt_create_database(const SlotProgress& slot_progress, const
if(slot_progress)
slot_progress();
- Glib::RefPtr<Gnome::Gda::ServerOperation> op =
+ auto op =
Gnome::Gda::ServerOperation::prepare_create_database("PostgreSQL", database_name);
if(slot_progress)
diff --git a/glom/libglom/connectionpool_backends/postgres_self.cc
b/glom/libglom/connectionpool_backends/postgres_self.cc
index a188de9..d174d34 100644
--- a/glom/libglom/connectionpool_backends/postgres_self.cc
+++ b/glom/libglom/connectionpool_backends/postgres_self.cc
@@ -328,7 +328,7 @@ Backend::StartupErrors PostgresSelfHosted::startup(const SlotProgress& slot_prog
void PostgresSelfHosted::show_active_connections()
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field("*", "pg_stat_activity");
builder->select_add_target("pg_stat_activity");
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index 9629bc1..1d1246e 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -126,7 +126,7 @@ bool Sqlite::create_database(const SlotProgress& slot_progress, const Glib::ustr
if(slot_progress)
slot_progress();
- Glib::RefPtr<Gnome::Gda::Connection> cnc =
+ auto cnc =
Gnome::Gda::Connection::open_from_string("SQLite",
cnc_string, "",
Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 712a516..8488947 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -59,7 +59,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
return Glib::RefPtr<Gnome::Gda::Connection>();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
return gda_connection;
}
@@ -71,7 +71,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
*/
static bool update_gda_metastore_for_table(const Glib::ustring& table_name)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No gda_connection." << std::endl;
@@ -363,7 +363,7 @@ SystemPrefs get_database_preferences(const Document* document)
const auto optional_org_logo = get_field_exists_in_database(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME,
GLOM_STANDARD_TABLE_PREFS_FIELD_ORG_LOGO);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_target(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
@@ -388,7 +388,7 @@ SystemPrefs get_database_preferences(const Document* document)
try
{
//const std::string full_query = Utils::sqlbuilder_get_full_query(builder);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = query_execute_select(builder);
+ auto datamodel = query_execute_select(builder);
if(datamodel && (datamodel->get_n_rows() != 0))
{
const std::locale locale(std::locale::classic()); //Ignored for text types, but it's best to avoid
ever using the current arbitrary locale here.
@@ -442,7 +442,7 @@ void set_database_preferences(Document* document, const SystemPrefs& prefs)
//The logo field was introduced in a later version of Glom.
//If the user is not in developer mode then the new field has not yet been added:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
builder->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_NAME, prefs.m_name);
builder->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_ORG_NAME, prefs.m_org_name);
@@ -484,7 +484,7 @@ bool add_standard_tables(const Document* document)
if(test)
{
//Add the single record:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builderAdd =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ auto builderAdd = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
builderAdd->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
builderAdd->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_ID, 1);
if(!query_execute(builderAdd))
@@ -494,7 +494,7 @@ bool add_standard_tables(const Document* document)
const auto system_name = document->get_database_title_original();
if(!system_name.empty())
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builderUpdate =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builderUpdate = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builderUpdate->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
builderUpdate->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_NAME, system_name);
builderUpdate->set_where(builderUpdate->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
@@ -578,7 +578,7 @@ bool add_standard_groups(Document* document)
//Add the glom_developer group if it does not exist:
const Glib::ustring devgroup = GLOM_STANDARD_GROUP_NAME_DEVELOPER;
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
@@ -649,7 +649,7 @@ bool add_standard_groups(Document* document)
bool add_groups_from_document(const Document* document)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": add_standard_groups(): No connection yet." << std::endl;
@@ -685,7 +685,7 @@ bool add_groups_from_document(const Document* document)
bool set_table_privileges_groups_from_document(const Document* document)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
@@ -828,14 +828,14 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
//TODO: BusyCursor busy_cursor(get_appwindow());
{
- Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
+ auto connection = get_connection();
if(!connection)
{
std::cerr << G_STRFUNC << ": connection is null" << std::endl;
return result;
}
- Glib::RefPtr<Gnome::Gda::Holder> holder_table_name = Gnome::Gda::Holder::create(G_TYPE_STRING, "name");
+ auto holder_table_name = Gnome::Gda::Holder::create(G_TYPE_STRING, "name");
gchar* quoted_table_name_c = gda_meta_store_sql_identifier_quote(table_name.c_str(), connection->gobj());
g_assert(quoted_table_name_c);
Glib::ustring quoted_table_name(quoted_table_name_c);
@@ -880,8 +880,8 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
{
//We also use the GdaMetaTable to discover primary keys.
//Both these libgda APIs are awful, and it's awful that we must use two APIs. murrayc.
- Glib::RefPtr<Gnome::Gda::MetaStore> store = connection->get_meta_store();
- Glib::RefPtr<Gnome::Gda::MetaStruct> metastruct =
+ auto store = connection->get_meta_store();
+ auto metastruct =
Gnome::Gda::MetaStruct::create(store, Gnome::Gda::META_STRUCT_FEATURE_NONE);
GdaMetaDbObject* meta_dbobject = nullptr;
try
@@ -903,7 +903,7 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
const auto rows_count = data_model_fields->get_n_rows();
while(row < rows_count)
{
- Glib::RefPtr<Gnome::Gda::Column> field_info = Gnome::Gda::Column::create();
+ auto field_info = Gnome::Gda::Column::create();
//Get the field name:
const auto value_name =
data_model_fields->get_value_at(Utils::to_utype(GlomGdaDataModelFieldColumns::NAME), row);
@@ -998,10 +998,10 @@ type_vec_fields get_fields_for_table(const Document* document, const Glib::ustri
if(iterFindDatabase != fieldsDatabase.end() ) //Ignore fields that don't exist in the database anymore.
{
- Glib::RefPtr<Gnome::Gda::Column> field_info_document = field->get_field_info();
+ auto field_info_document = field->get_field_info();
//Update the Field information that _might_ have changed in the database.
- Glib::RefPtr<Gnome::Gda::Column> field_info = (*iterFindDatabase)->get_field_info();
+ auto field_info = (*iterFindDatabase)->get_field_info();
//libgda does not tell us whether the field is auto_incremented, so we need to get that from the
document.
field_info->set_auto_increment( field_info_document->get_auto_increment() );
@@ -1058,7 +1058,7 @@ type_vec_strings get_table_names_from_database(bool ignore_system_tables)
type_vec_strings result;
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
Glib::RefPtr<Gnome::Gda::DataModel> data_model_tables;
try
@@ -1148,7 +1148,7 @@ bool create_table_with_default_fields(Document* document, const Glib::ustring& t
if(table_name.empty())
return false;
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
@@ -1164,7 +1164,7 @@ bool create_table_with_default_fields(Document* document, const Glib::ustring& t
field_primary_key->set_primary_key();
field_primary_key->set_auto_increment();
- Glib::RefPtr<Gnome::Gda::Column> field_info = field_primary_key->get_field_info();
+ auto field_info = field_primary_key->get_field_info();
field_info->set_allow_null(false);
field_primary_key->set_field_info(field_info);
@@ -1236,7 +1236,7 @@ bool create_table(Document::HostingMode hosting_mode, const std::shared_ptr<cons
//The field has no gda type, so we set that:
//This usually comes from the database, but that's a bit strange.
- Glib::RefPtr<Gnome::Gda::Column> info = field->get_field_info();
+ auto info = field->get_field_info();
info->set_g_type( Field::get_gda_type_for_glom_type(field->get_glom_type()) );
field->set_field_info(info); //TODO_Performance
@@ -1404,7 +1404,7 @@ Gnome::Gda::Value get_next_auto_increment_value(const Glib::ustring& table_name,
++num_result;
const auto next_value = Conversions::parse_value(num_result);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
builder->add_field_value_as_value(GLOM_STANDARD_TABLE_AUTOINCREMENTS_FIELD_NEXT_VALUE, next_value);
builder_set_where_autoincrement(builder, table_name, field_name);
@@ -1440,7 +1440,7 @@ Gnome::Gda::Value auto_increment_insert_first_if_necessary(const Glib::ustring&
std::cerr << G_STRFUNC << ": The current user may not edit the autoincrements table. Any user who has
create rights for a table should have edit rights to the autoincrements table." << std::endl;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field("next_value", GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
builder->select_add_target(GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
@@ -1503,13 +1503,13 @@ static void recalculate_next_auto_increment_value(const Glib::ustring& table_nam
auto_increment_insert_first_if_necessary(table_name, field_name);
//Get the max key value in the database:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
std::vector<guint> args;
args.push_back(builder->add_field_id(field_name, table_name));
builder->add_field_value_id(builder->add_function("MAX", args));
builder->select_add_target(table_name);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = query_execute_select(builder);
+ auto datamodel = query_execute_select(builder);
if(datamodel && datamodel->get_n_rows() && datamodel->get_n_columns())
{
//Increment it:
@@ -1556,7 +1556,7 @@ void remove_auto_increment(const Glib::ustring& table_name, const Glib::ustring&
return;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_DELETE);
builder->set_table(GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
builder_set_where_autoincrement(builder, table_name, field_name);
@@ -1576,7 +1576,7 @@ bool insert_example_data(const Document* document, const Glib::ustring& table_na
return true;
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": connection is null" << std::endl;
@@ -1608,7 +1608,7 @@ bool insert_example_data(const Document* document, const Glib::ustring& table_na
const auto hosting_mode = document->get_hosting_mode();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
builder->set_table(table_name);
for(unsigned int i = 0; i < row_data.size(); ++i) //TODO_Performance: Avoid calling size() so much.
{
@@ -1667,7 +1667,7 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
//TODO: BusyCursor busy_cursor(get_app_window());
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
@@ -1730,14 +1730,14 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnome::Gda::Set>& params)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
return false;
}
- Glib::RefPtr<Gnome::Gda::SqlParser> parser = gda_connection->create_parser();
+ auto parser = gda_connection->create_parser();
Glib::RefPtr<Gnome::Gda::Statement> stmt;
try
{
@@ -1794,7 +1794,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder)
{
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No connection yet." << std::endl;
@@ -1973,7 +1973,7 @@ int count_rows_returned_by(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& sql
int result = 0;
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+ auto datamodel = DbUtils::query_execute_select(builder);
if(datamodel && datamodel->get_n_rows() && datamodel->get_n_columns())
{
const auto value = datamodel->get_value_at(0, 0);
@@ -2020,7 +2020,7 @@ Glib::ustring escape_sql_id(const Glib::ustring& id)
return id;
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
+ auto gda_connection = get_connection();
if(!gda_connection)
{
std::cerr << G_STRFUNC << ": No gda_connection." << std::endl;
@@ -2259,7 +2259,7 @@ Gnome::Gda::Value get_lookup_value(const Document* document, const Glib::ustring
const auto value_to_key_field = Conversions::convert_value(key_value, to_key_field->get_glom_type());
const auto target_table = relationship->get_to_table();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(source_field->get_name(), target_table );
builder->select_add_target(target_table );
@@ -2268,7 +2268,7 @@ Gnome::Gda::Value get_lookup_value(const Document* document, const Glib::ustring
builder->add_field_id(to_key_field->get_name(), target_table),
builder->add_expr(value_to_key_field)));
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = query_execute_select(builder);
+ auto data_model = query_execute_select(builder);
if(data_model && data_model->get_n_rows())
{
//There should be only 1 row. Well, there could be more but we will ignore them.
@@ -2311,7 +2311,7 @@ type_map_fields get_record_field_values(const Document* document, const Glib::us
{
//sharedptr<const Field> fieldPrimaryKey = get_field_primary_key();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query = Utils::build_sql_select_with_key(table_name, fieldsToGet,
primary_key, primary_key_value);
+ auto query = Utils::build_sql_select_with_key(table_name, fieldsToGet, primary_key, primary_key_value);
Glib::RefPtr<const Gnome::Gda::DataModel> data_model;
try
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index b31e579..4a5e0ea 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -4803,7 +4803,7 @@ private:
bool add_file_to_archive(archive* a, const std::string& parent_dir_path, const std::string& filepath)
{
//TODO: Use read_async() when this calling method is async.
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(filepath);
+ auto file = Gio::File::create_for_path(filepath);
Glib::RefPtr<Gio::FileInputStream> stream;
try
{
@@ -4832,7 +4832,7 @@ bool add_file_to_archive(archive* a, const std::string& parent_dir_path, const s
archive_entry_copy_stat(entry, &st); //This has no return value.
- Glib::RefPtr<Gio::File> file_parent = Gio::File::create_for_path(parent_dir_path);
+ auto file_parent = Gio::File::create_for_path(parent_dir_path);
const auto path = file_parent->get_relative_path(file);
archive_entry_set_pathname(entry, path.c_str()); //This has no return value.
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index c019132..e3e16fd 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -39,12 +39,12 @@ Privs::type_vec_strings Privs::get_database_groups()
{
type_vec_strings result;
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field("groname", "pg_group");
builder->select_add_target("pg_group");
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
+ auto data_model = DbUtils::query_execute_select(builder);
if(data_model)
{
const auto rows_count = data_model->get_n_rows();
@@ -115,12 +115,12 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
if(group_name.empty())
{
//pg_shadow contains the users. pg_users is a view of pg_shadow without the password.
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field("usename", "pg_shadow");
builder->select_add_target("pg_shadow");
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
+ auto data_model = DbUtils::query_execute_select(builder);
if(data_model)
{
const auto rows_count = data_model->get_n_rows();
@@ -134,7 +134,7 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
}
else
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builderGroup =
+ auto builderGroup =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builderGroup->select_add_field("groname", "pg_group");
builderGroup->select_add_field("grolist", "pg_group");
@@ -144,7 +144,7 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
builderGroup->add_field_id("groname", "pg_group"),
builderGroup->add_expr(group_name)));
//TODO: Show SQL.
- Glib::RefPtr<Gnome::Gda::DataModel> data_model_group = DbUtils::query_execute_select(builderGroup);
+ auto data_model_group = DbUtils::query_execute_select(builderGroup);
if(data_model_group && data_model_group->get_n_rows())
{
const auto rows_count = data_model_group->get_n_rows();
@@ -161,7 +161,7 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
for(const auto& userId: vecUserIds)
{
//TODO_Performance: Can we do this in one SQL SELECT?
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builderUser =
+ auto builderUser =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builderUser->select_add_field("usename", "pg_user");
builderUser->select_add_target("pg_user");
@@ -169,7 +169,7 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
builderUser->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
builderUser->add_field_id("usesysid", "pg_user"),
builderUser->add_expr(userId)));
- Glib::RefPtr<Gnome::Gda::DataModel> data_model_user = DbUtils::query_execute_select(builderUser);
+ auto data_model_user = DbUtils::query_execute_select(builderUser);
if(data_model_user && data_model_user->get_n_rows() && data_model_user->get_n_columns())
{
const auto value_user = data_model_user->get_value_at(0, 0);
@@ -289,7 +289,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
return Glib::RefPtr<Gnome::Gda::Connection>();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
return gda_connection;
}
@@ -309,13 +309,13 @@ Privileges Privs::get_table_privileges(const Glib::ustring& group_name, const Gl
}
//Get the permissions:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
const Glib::ustring function_name = "has_table_privilege";
std::vector<Gnome::Gda::SqlBuilder::Id> args_base;
- Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
+ auto connection = get_connection();
if(!connection)
{
std::cerr << G_STRFUNC << ": : Could not get a connection." << std::endl;
@@ -352,7 +352,7 @@ Privileges Privs::get_table_privileges(const Glib::ustring& group_name, const Gl
//const Glib::ustring sql_debug = Utils::sqlbuilder_get_full_query(builder);
//std::cout << "DEBUG: " << sql_debug << std::endl;
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
+ auto data_model = DbUtils::query_execute_select(builder);
if(!data_model || (data_model->get_n_rows() <= 0))
{
std::cerr << G_STRFUNC << ": The query returned no data." << std::endl;
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 0006996..806300b 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -180,7 +180,7 @@ void PyGlomRecord::setitem(const boost::python::object& key, const boost::python
return;
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(m_table_name);
builder->add_field_value_as_value(field->get_name(), field_value);
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc
b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index ed32218..46a49f2 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -95,7 +95,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
return boost::python::object();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
const Glib::ustring related_key_name = m_relationship->get_to_field();
@@ -107,7 +107,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
}
//Get the single value from the related records:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(field_name, related_table);
builder->select_add_target(related_table);
@@ -131,7 +131,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
}*/
// TODO: Does this behave well if this throws an exception?
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel =
gda_connection->statement_execute_select_builder(builder);
+ auto datamodel = gda_connection->statement_execute_select_builder(builder);
if(datamodel && datamodel->get_n_rows())
{
const Gnome::Gda::Value value = datamodel->get_value_at(0, 0);
@@ -185,7 +185,7 @@ boost::python::object PyGlomRelatedRecord::generic_aggregate(const std::string&
return boost::python::object();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
const Glib::ustring related_key_name = m_relationship->get_to_field();
@@ -196,7 +196,7 @@ boost::python::object PyGlomRelatedRecord::generic_aggregate(const std::string&
}
//Get the aggregate value from the related records:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function(aggregate,
builder->add_id(field_name)); //TODO: It would be nice to specify the table here too.
@@ -210,7 +210,7 @@ boost::python::object PyGlomRelatedRecord::generic_aggregate(const std::string&
//std::cout << "PyGlomRelatedRecord: Executing: " << sql_query << std::endl;
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = gda_connection->statement_execute_select_builder(builder);
+ auto datamodel = gda_connection->statement_execute_select_builder(builder);
// Ignore the error: The case that the command execution didn't return
// a datamodel is handled below.
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index 6fe2132..2aee4eb 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -220,7 +220,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
//Get the possible group values, ignoring repeats by using GROUP BY.
const auto group_field_table_name = field_group_by->get_table_used(found_set_parent.m_table_name);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(field_group_by->get_name(), group_field_table_name);
builder->select_add_target(group_field_table_name);
@@ -232,7 +232,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
builder->select_group_by( builder->add_field_id(field_group_by->get_name(), group_field_table_name) );
//TODO: And restrict to the current found set.
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+ auto datamodel = DbUtils::query_execute_select(builder);
if(!datamodel)
{
std::cerr << G_STRFUNC << ": The SQL query failed." << std::endl;
@@ -378,12 +378,12 @@ bool ReportBuilder::report_build_records(const FoundSet& found_set, xmlpp::Eleme
if(one_record_only)
limit = 1;
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query =
Utils::build_sql_select_with_where_clause(found_set.m_table_name,
+ auto sql_query = Utils::build_sql_select_with_where_clause(found_set.m_table_name,
fieldsToGet,
found_set.m_where_clause, std::shared_ptr<const Relationship>() /* extra_join */,
found_set.m_sort_clause,
limit);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(sql_query);
+ auto datamodel = DbUtils::query_execute_select(sql_query);
if(!datamodel)
{
std::cerr << G_STRFUNC << ": The SLQ query failed." << std::endl;
@@ -462,11 +462,11 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
{
//In this case it can only be a system preferences field.
//So let's get that data here:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->set_table(field->get_table_used(found_set.m_table_name));
builder->select_add_field(field->get_name(), found_set.m_table_name);
builder->select_set_limit(1);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel_syspref = DbUtils::query_execute_select(builder);
+ auto datamodel_syspref = DbUtils::query_execute_select(builder);
if(!datamodel_syspref)
{
@@ -584,7 +584,7 @@ std::string ReportBuilder::report_build_and_save(const FoundSet& found_set, cons
const auto temp_uri = Utils::get_temp_file_uri("glom_printout", "html");
std::cout << G_STRFUNC << ": temp_uri=" << temp_uri << std::endl;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(temp_uri);
+ auto file = Gio::File::create_for_uri(temp_uri);
Glib::RefPtr<Gio::FileOutputStream> stream;
//Create the file if it does not already exist:
diff --git a/glom/libglom/spawn_with_feedback.cc b/glom/libglom/spawn_with_feedback.cc
index 2888568..15c0a3e 100644
--- a/glom/libglom/spawn_with_feedback.cc
+++ b/glom/libglom/spawn_with_feedback.cc
@@ -138,7 +138,7 @@ private:
void redirect_to_string(int fd, std::string& string)
{
- Glib::RefPtr<Glib::IOChannel> channel = Glib::IOChannel::create_from_fd(fd);
+ auto channel = Glib::IOChannel::create_from_fd(fd);
channel->set_flags(Glib::IO_FLAG_NONBLOCK);
channel->set_encoding("");
@@ -323,7 +323,7 @@ static int spawn_sync(const Glib::ustring& command_line, std::string* stdout_tex
if(stderr_text)
redirect_flags |= REDIRECT_STDERR;
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(false);
+ auto mainloop = Glib::MainLoop::create(false);
auto info = spawn_async(command_line, redirect_flags); //This could throw
info->signal_finished().connect(
@@ -356,7 +356,7 @@ bool execute_command_line_and_wait(const std::string& command, const SlotProgres
return false;
}
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(false);
+ auto mainloop = Glib::MainLoop::create(false);
info->signal_finished().connect(
sigc::bind(sigc::ptr_fun(&on_spawn_info_finished), sigc::ref(mainloop) ) );
@@ -401,7 +401,7 @@ bool execute_command_line_and_wait(const std::string& command, const SlotProgres
}
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(false);
+ auto mainloop = Glib::MainLoop::create(false);
info->signal_finished().connect(
sigc::bind(sigc::ptr_fun(&on_spawn_info_finished), sigc::ref(mainloop) ) );
@@ -571,7 +571,7 @@ bool execute_command_line_and_wait_until_second_command_returns_success(const st
// b) Get stderr data, to display an error message in case the command
// fails:
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(false);
+ auto mainloop = Glib::MainLoop::create(false);
sigc::connection watch_conn = info->signal_finished().connect(
sigc::bind(sigc::ptr_fun(&on_spawn_info_finished), sigc::ref(mainloop) ) );
@@ -597,7 +597,7 @@ bool execute_command_line_and_wait_until_second_command_returns_success(const st
*
*
//Sleep for a bit more, because I think that pg_ctl sometimes reports success too early.
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(false);
+ auto mainloop = Glib::MainLoop::create(false);
sigc::connection connection_timeout = Glib::signal_timeout().connect(
sigc::bind(sigc::ptr_fun(&on_timeout_delay), sigc::ref(mainloop)),
8000);
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 5250895..1102c1e 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -466,7 +466,7 @@ Gnome::Gda::SqlExpr Utils::build_simple_where_expression(const Glib::ustring& ta
return Gnome::Gda::SqlExpr();
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_target(table_name); //This might not be necessary.
const Gnome::Gda::SqlBuilder::Id id = builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
builder->add_field_id(key_field->get_name(), table_name),
@@ -478,7 +478,7 @@ Gnome::Gda::SqlExpr Utils::build_simple_where_expression(const Glib::ustring& ta
Gnome::Gda::SqlExpr Utils::build_combined_where_expression(const Gnome::Gda::SqlExpr& a, const
Gnome::Gda::SqlExpr& b, Gnome::Gda::SqlOperatorType op)
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
const Gnome::Gda::SqlBuilder::Id id = builder->add_cond(op,
@@ -568,7 +568,7 @@ Utils::type_list_values_with_second Utils::get_choice_values(const Document* doc
}
//TODO: Support related relationships (in the UI too):
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Utils::build_sql_select_with_key(
+ auto builder = Utils::build_sql_select_with_key(
to_table,
fields,
to_field,
@@ -595,7 +595,7 @@ Utils::type_list_values_with_second Utils::get_choice_values(const Document* doc
const std::string sql_query =
Utils::sqlbuilder_get_full_query(builder);
//std::cout << "debug: sql_query=" << sql_query << std::endl;
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel =
connection->get_gda_connection()->statement_execute_select(sql_query);
+ auto datamodel = connection->get_gda_connection()->statement_execute_select(sql_query);
if(datamodel)
{
@@ -980,7 +980,7 @@ bool Utils::file_exists(const Glib::ustring& uri)
//Check whether file exists already:
// Try to examine the input file.
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
return file_exists(file);
}
@@ -1016,7 +1016,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
return Glib::RefPtr<Gnome::Gda::Connection>();
}
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = sharedconnection->get_gda_connection();
+ auto gda_connection = sharedconnection->get_gda_connection();
return gda_connection;
}
@@ -1024,7 +1024,7 @@ static Glib::RefPtr<Gnome::Gda::Connection> get_connection()
std::string Utils::sqlbuilder_get_full_query(
const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder)
{
- Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
+ auto connection = get_connection();
if(!connection)
{
//TODO: Just use the correct provider, without an actual connection?
@@ -1035,7 +1035,7 @@ std::string Utils::sqlbuilder_get_full_query(
try
{
- Glib::RefPtr<Gnome::Gda::Statement> stmt = builder->get_statement();
+ auto stmt = builder->get_statement();
if(!stmt)
{
std::cerr << G_STRFUNC << ": builder->get_statement() failed." << std::endl;
@@ -1090,7 +1090,7 @@ Gnome::Gda::SqlExpr Utils::get_find_where_clause_quick(const Document* document,
if(Conversions::value_is_empty(quick_search))
return Gnome::Gda::SqlExpr();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_target(table_name);
@@ -1105,7 +1105,7 @@ Gnome::Gda::SqlExpr Utils::get_find_where_clause_quick(const Document* document,
}
//We need the connection to generate the correct SQL syntax:
- Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
+ auto connection = get_connection();
if(!connection)
{
std::cerr << G_STRFUNC << ": connection was null." << std::endl;
@@ -1208,12 +1208,12 @@ bool Utils::delete_directory(const Glib::RefPtr<Gio::File>& directory)
//(Recursively) Delete any child files and directories,
//so we can delete this directory.
- Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
+ auto enumerator = directory->enumerate_children();
- Glib::RefPtr<Gio::FileInfo> info = enumerator->next_file();
+ auto info = enumerator->next_file();
while(info)
{
- Glib::RefPtr<Gio::File> child = directory->get_child(info->get_name());
+ auto child = directory->get_child(info->get_name());
bool removed_child = false;
if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
removed_child = delete_directory(child);
@@ -1241,13 +1241,13 @@ bool Utils::delete_directory(const Glib::RefPtr<Gio::File>& directory)
bool Utils::delete_directory(const std::string& uri)
{
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
return delete_directory(file);
}
bool Utils::delete_file(const std::string& uri)
{
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
if(file->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
{
std::cerr << G_STRFUNC << ": The file is a directory." << std::endl;
@@ -1272,10 +1272,10 @@ bool Utils::delete_file(const std::string& uri)
*/
Glib::ustring Utils::get_directory_child_with_suffix(const Glib::ustring& uri_directory, const std::string&
suffix, bool recursive)
{
- Glib::RefPtr<Gio::File> directory = Gio::File::create_for_uri(uri_directory);
- Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
+ auto directory = Gio::File::create_for_uri(uri_directory);
+ auto enumerator = directory->enumerate_children();
- Glib::RefPtr<Gio::FileInfo> info = enumerator->next_file();
+ auto info = enumerator->next_file();
while(info)
{
Glib::RefPtr<const Gio::File> child = directory->get_child(info->get_name());
@@ -1307,7 +1307,7 @@ Glib::ustring Utils::get_file_uri_without_extension(const Glib::ustring& uri)
if(uri.empty())
return uri;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
if(!file)
return uri; //Actually an error.
@@ -1321,8 +1321,8 @@ Glib::ustring Utils::get_file_uri_without_extension(const Glib::ustring& uri)
const Glib::ustring filename_part_without_ext = filename_part.substr(0, pos_dot);
//Use the Gio::File API to manipulate the URI:
- Glib::RefPtr<Gio::File> parent = file->get_parent();
- Glib::RefPtr<Gio::File> file_without_extension = parent->get_child(filename_part_without_ext);
+ auto parent = file->get_parent();
+ auto file_without_extension = parent->get_child(filename_part_without_ext);
return file_without_extension->get_uri();
}
@@ -1333,7 +1333,7 @@ std::string Utils::get_file_path_without_extension(const std::string& filepath)
if(filepath.empty())
return filepath;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(filepath);
+ auto file = Gio::File::create_for_path(filepath);
if(!file)
return filepath; //Actually an error.
@@ -1347,8 +1347,8 @@ std::string Utils::get_file_path_without_extension(const std::string& filepath)
const Glib::ustring filename_part_without_ext = filename_part.substr(0, pos_dot);
//Use the Gio::File API to manipulate the URI:
- Glib::RefPtr<Gio::File> parent = file->get_parent();
- Glib::RefPtr<Gio::File> file_without_extension = parent->get_child(filename_part_without_ext);
+ auto parent = file->get_parent();
+ auto file_without_extension = parent->get_child(filename_part_without_ext);
return file_without_extension->get_path();
}
diff --git a/glom/libglom/xsl_utils.cc b/glom/libglom/xsl_utils.cc
index 4653d17..15340ec 100644
--- a/glom/libglom/xsl_utils.cc
+++ b/glom/libglom/xsl_utils.cc
@@ -70,7 +70,7 @@ static Glib::ustring xslt_process(const xmlpp::Document& xml_document, const std
//nonconst.write_to_stream_formatted(std::cout);
//std::cout << std::endl;
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(resource_path_xslt); //This must use a
resource:// URI.
+ auto file = Gio::File::create_for_uri(resource_path_xslt); //This must use a resource:// URI.
char* xslt_data = nullptr;
gsize xslt_length = 0;
try
diff --git a/glom/main.cc b/glom/main.cc
index e4d1e85..e781fa7 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -492,7 +492,7 @@ main(int argc, char* argv[])
//Create the app here,
//so we can use UI, for instance with Gtk::MessageDialog,
//even before calling run().
- Glib::RefPtr<Glom::Application> application =
+ auto application =
Glom::Application::create();
#ifndef GLOM_ENABLE_CLIENT_ONLY
diff --git a/glom/mode_data/box_data.cc b/glom/mode_data/box_data.cc
index bf7cc79..a48ec5a 100644
--- a/glom/mode_data/box_data.cc
+++ b/glom/mode_data/box_data.cc
@@ -85,12 +85,12 @@ FoundSet Box_Data::get_found_set() const
Gnome::Gda::SqlExpr Box_Data::get_find_where_clause() const
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_target(m_table_name); //This might not be necessary.
guint where_cond_id = 0;
- Glib::RefPtr<Gnome::Gda::Connection> connection = get_connection();
+ auto connection = get_connection();
if(!connection)
{
std::cerr << G_STRFUNC << ": connection was null." << std::endl;
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index e087d4d..552a482 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -187,7 +187,7 @@ bool Box_Data_Calendar_Related::fill_from_database()
//Add an AND to the existing where clause, to get only records within these dates, if any:
auto date_field = derived_portal->get_date_field();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
const auto cond = builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_BETWEEN,
builder->add_field_id(date_field->get_name(), m_found_set.m_table_name),
@@ -211,7 +211,7 @@ bool Box_Data_Calendar_Related::fill_from_database()
//Do one SQL query for the whole month and store the cached values here:
clear_cached_database_values();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query =
Utils::build_sql_select_with_where_clause(m_found_set.m_table_name, m_FieldsShown, where_clause,
m_found_set.m_extra_join, m_found_set.m_sort_clause);
+ auto sql_query = Utils::build_sql_select_with_where_clause(m_found_set.m_table_name, m_FieldsShown,
where_clause, m_found_set.m_extra_join, m_found_set.m_sort_clause);
//std::cout << "DEBUG: sql_query=" << sql_query << std::endl;
Glib::RefPtr<const Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(sql_query);
if(!(datamodel))
@@ -299,7 +299,7 @@ void Box_Data_Calendar_Related::on_record_added(const Gnome::Gda::Value& primary
//Create the link by setting the foreign key
if(m_key_field && m_portal)
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
const auto target_table = m_portal->get_table_used(Glib::ustring() /* not relevant */);
builder->set_table(target_table);
builder->add_field_value_as_value(m_key_field->get_name(), m_key_value);
@@ -524,7 +524,7 @@ void Box_Data_Calendar_Related::setup_menu(Gtk::Widget* /* this */)
//TODO: add_accel_group(m_refUIManager->get_accel_group());
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Edit"), "context.edit");
menu->append(_("_Layout"), "context.layout");
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 8dabdc1..fa89244 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -335,7 +335,7 @@ bool Box_Data_Details::fill_from_database()
}
}
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query = Utils::build_sql_select_with_key(m_table_name,
fieldsToGet, m_field_primary_key, m_primary_key_value);
+ auto query = Utils::build_sql_select_with_key(m_table_name, fieldsToGet, m_field_primary_key,
m_primary_key_value);
Glib::RefPtr<Gnome::Gda::DataModel> result;
if(!primary_key_is_empty)
@@ -926,7 +926,7 @@ void Box_Data_Details::print_layout()
return;
}
- Glib::RefPtr<Gtk::PageSetup> page_setup = Gtk::PageSetup::create(); //TODO: m_canvas.get_page_setup();
+ auto page_setup = Gtk::PageSetup::create(); //TODO: m_canvas.get_page_setup();
if(!page_setup)
{
std::cerr << G_STRFUNC << ": page_setup was null" << std::endl;
diff --git a/glom/mode_data/box_data_list.cc b/glom/mode_data/box_data_list.cc
index 8b9f524..683a642 100644
--- a/glom/mode_data/box_data_list.cc
+++ b/glom/mode_data/box_data_list.cc
@@ -147,7 +147,7 @@ bool Box_Data_List::fill_from_database()
if(table_privs.m_view)
{
//Select first record:
- Glib::RefPtr<Gtk::TreeModel> refModel = m_AddDel.get_model();
+ auto refModel = m_AddDel.get_model();
if(refModel)
m_AddDel.select_item(refModel->children().begin());
@@ -206,8 +206,8 @@ bool Box_Data_List::on_script_button_idle(const std::shared_ptr<const LayoutItem
#if 0
// TODO: This is perhaps a better approach, but
// DbTreeModel::refresh_from_database is protected
- Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
- Glib::RefPtr<DbTreeModel> db_model = Glib::RefPtr<DbTreeModel>::cast_dynamic(model);
+ auto model = m_AddDel.get_model();
+ auto db_model = Glib::RefPtr<DbTreeModel>::cast_dynamic(model);
if(db_model)
db_model->refresh_from_database(m_found_set);
#endif
@@ -321,7 +321,7 @@ Gnome::Gda::Value Box_Data_List::get_primary_key_value_first() const
{
//std::cout << "debug: " << G_STRFUNC << ": get_primary_key_value_first() records_count = " <<
m_AddDel.get_count() << std::endl;
- Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
+ auto model = m_AddDel.get_model();
if(model)
{
auto iter = model->children().begin();
@@ -492,8 +492,8 @@ void Box_Data_List::get_record_counts(gulong& total, gulong& found) const
total = 0;
found = 0;
- Glib::RefPtr<Gtk::TreeModel> refModel = m_AddDel.get_model();
- Glib::RefPtr<DbTreeModel> refModelDerived = Glib::RefPtr<DbTreeModel>::cast_dynamic(refModel);
+ auto refModel = m_AddDel.get_model();
+ auto refModelDerived = Glib::RefPtr<DbTreeModel>::cast_dynamic(refModel);
if(refModelDerived)
refModelDerived->get_record_counts(total, found);
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index 5ec40de..3946e69 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -249,8 +249,8 @@ bool Box_Data_List_Related::on_script_button_idle(const std::shared_ptr<const La
#if 0
// TODO: This is perhaps a better approach, but
// DbTreeModel::refresh_from_database is protected
- Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
- Glib::RefPtr<DbTreeModel> db_model = Glib::RefPtr<DbTreeModel>::cast_dynamic(model);
+ auto model = m_AddDel.get_model();
+ auto db_model = Glib::RefPtr<DbTreeModel>::cast_dynamic(model);
if(db_model)
db_model->refresh_from_database(m_found_set);
#endif
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index 1e5bf55..464a8e5 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -72,7 +72,7 @@ void Box_Data_Portal::make_record_related(const Gnome::Gda::Value& related_recor
}
const auto target_table = m_portal->get_table_used(Glib::ustring() /* not relevant */);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(target_table);
builder->add_field_value_as_value(m_key_field->get_name(), m_key_value);
builder->set_where(
@@ -286,7 +286,7 @@ void Box_Data_Portal::get_suitable_record_to_view_details(const Gnome::Gda::Valu
auto key_field = get_field_primary_key_for_table(related_table);
//std::cout << "DEBUG: related table=" << related_table << ", whose primary_key=" << key_field->get_name()
<< ", with value=" << primary_key_value.to_string() << "getting value for: " <<
layout_item->get_layout_display_name() << std::endl;
- Glib::RefPtr<Gnome::Gda::SqlBuilder> query = Utils::build_sql_select_with_key(related_table, fieldsToGet,
key_field, primary_key_value);
+ auto query = Utils::build_sql_select_with_key(related_table, fieldsToGet, key_field, primary_key_value);
Glib::RefPtr<const Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(query);
diff --git a/glom/mode_data/datawidget/cellrenderer_dblist.cc
b/glom/mode_data/datawidget/cellrenderer_dblist.cc
index f891b86..ba96991 100644
--- a/glom/mode_data/datawidget/cellrenderer_dblist.cc
+++ b/glom/mode_data/datawidget/cellrenderer_dblist.cc
@@ -39,7 +39,7 @@ void CellRendererDbList::set_choices_fixed(const Formatting::type_list_values& l
{
ComboChoicesWithTreeModel::set_choices_fixed(list_values, restricted);
- Glib::RefPtr<Gtk::TreeModel> model = get_choices_model();
+ auto model = get_choices_model();
//Show model in the view:
property_model() = model;
@@ -53,7 +53,7 @@ void CellRendererDbList::set_choices_related(const Document* document, const std
{
ComboChoicesWithTreeModel::set_choices_related(document, layout_field, foreign_key_value);
- Glib::RefPtr<Gtk::TreeModel> model = get_choices_model();
+ auto model = get_choices_model();
if(!model)
{
std::cerr << G_STRFUNC << ": model is null" << std::endl;
@@ -62,7 +62,7 @@ void CellRendererDbList::set_choices_related(const Document* document, const std
//Show model in the view:
property_model() = model;
- Glib::RefPtr<DbTreeModelWithExtraText> model_db =
+ auto model_db =
Glib::RefPtr<DbTreeModelWithExtraText>::cast_dynamic(model);
if(model_db)
property_text_column() = model_db->get_text_column();
@@ -220,7 +220,7 @@ void CellRendererDbList::on_editing_started(Gtk::CellEditable* cell_editable, co
//The DB model has a special virtual text column,
//and the simple model just has text in all columns:
- Glib::RefPtr<DbTreeModelWithExtraText> model_db =
+ auto model_db =
Glib::RefPtr<DbTreeModelWithExtraText>::cast_dynamic(get_choices_model());
if(model_db)
repack_cells_related(combobox);
diff --git a/glom/mode_data/datawidget/combo.cc b/glom/mode_data/datawidget/combo.cc
index f58abb6..a4cc76f 100644
--- a/glom/mode_data/datawidget/combo.cc
+++ b/glom/mode_data/datawidget/combo.cc
@@ -85,7 +85,7 @@ void ComboGlom::set_choices_fixed(const Formatting::type_list_values& list_value
{
ComboChoicesWithTreeModel::set_choices_fixed(list_values, restricted);
- Glib::RefPtr<Gtk::TreeModel> model = get_choices_model();
+ auto model = get_choices_model();
if(!model)
{
std::cerr << G_STRFUNC << ": model is null." << std::endl;
@@ -104,7 +104,7 @@ void ComboGlom::set_choices_fixed(const Formatting::type_list_values& list_value
clear(); //This breaks GtkCombo with has-entry.
}
- Glib::RefPtr<Gtk::CellAreaBox> cell_area =
+ auto cell_area =
Glib::RefPtr<Gtk::CellAreaBox>::cast_dynamic(get_area());
if(!cell_area)
{
@@ -154,7 +154,7 @@ void ComboGlom::set_choices_related(const Document* document, const std::shared_
{
ComboChoicesWithTreeModel::set_choices_related(document, layout_field, foreign_key_value);
- Glib::RefPtr<Gtk::TreeModel> model = get_choices_model();
+ auto model = get_choices_model();
if(!model)
{
std::cerr << G_STRFUNC << ": model is null." << std::endl;
@@ -166,7 +166,7 @@ void ComboGlom::set_choices_related(const Document* document, const std::shared_
if(get_has_entry())
{
- Glib::RefPtr<DbTreeModelWithExtraText> model_db =
+ auto model_db =
Glib::RefPtr<DbTreeModelWithExtraText>::cast_dynamic(model);
if(model_db)
{
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 03ed747..aa8fba4 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -145,7 +145,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
if(layout_choice_extra)
extra_fields = layout_choice_extra->get_items_recursive();
- Glib::RefPtr<Gtk::ListStore> list_store = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(m_refModel);
+ auto list_store = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(m_refModel);
if(!list_store)
{
std::cerr << G_STRFUNC << ": list_store is null." << std::endl;
@@ -200,7 +200,7 @@ void ComboChoicesWithTreeModel::set_choices_fixed(const Formatting::type_list_va
{
create_model_non_db(1); //Use a regular ListStore without a dynamic column?
- Glib::RefPtr<Gtk::ListStore> list_store = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(m_refModel);
+ auto list_store = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(m_refModel);
if(!list_store)
{
std::cerr << G_STRFUNC << ": list_store is null." << std::endl;
@@ -463,7 +463,7 @@ int ComboChoicesWithTreeModel::get_fixed_cell_height(Gtk::Widget& widget)
continue;
// Translators: This is just some example text used to discover an appropriate height for user-entered
text in the UI. This text itself is never shown to the user.
- Glib::RefPtr<Pango::Layout> refLayout = widget.create_pango_layout(_("Example"));
+ auto refLayout = widget.create_pango_layout(_("Example"));
const Pango::FontDescription font(font_name);
refLayout->set_font_description(font);
int width = 0;
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 0be7cc5..5d569af 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -350,7 +350,7 @@ void DataWidget::set_child_size_by_field(const std::shared_ptr<const LayoutItem_
{
int example_width = 0;
int example_height = 0;
- Glib::RefPtr<Pango::Layout> refLayout = create_pango_layout("example"); //TODO: Use different text,
according to the current locale, or allow the user to choose an example?
+ auto refLayout = create_pango_layout("example"); //TODO: Use different text, according to the current
locale, or allow the user to choose an example?
refLayout->get_pixel_size(example_width, example_height);
if(example_height > 0)
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index 505dc2f..3e1c392 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -61,7 +61,7 @@ void DbTreeModelRow::fill_values_if_necessary(DbTreeModel& model, int row)
if((row < (int)model.m_data_model_rows_count) && model.m_gda_datamodel)
{
- Glib::RefPtr<Gnome::Gda::DataModelIter> iter = model.m_gda_datamodel->create_iter();
+ auto iter = model.m_gda_datamodel->create_iter();
if(iter)
{
iter->move_to_row(row);
@@ -304,7 +304,7 @@ bool DbTreeModel::refresh_from_database(const FoundSet& found_set)
//Use a dummy DataModel that has the same columns and types,
//but which does not use a real database table,
//so we can use it to add find criteria.
- Glib::RefPtr<Gnome::Gda::DataModelArray> model_array =
Gnome::Gda::DataModelArray::create(m_column_fields.size());
+ auto model_array = Gnome::Gda::DataModelArray::create(m_column_fields.size());
m_gda_datamodel = model_array;
int col = 0;
@@ -337,7 +337,7 @@ bool DbTreeModel::refresh_from_database(const FoundSet& found_set)
if(m_connection && !m_found_set.m_table_name.empty() && m_get_records)
{
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query =
Utils::build_sql_select_with_where_clause(m_found_set.m_table_name, m_column_fields,
m_found_set.m_where_clause, m_found_set.m_extra_join, m_found_set.m_sort_clause);
+ auto sql_query = Utils::build_sql_select_with_where_clause(m_found_set.m_table_name, m_column_fields,
m_found_set.m_where_clause, m_found_set.m_extra_join, m_found_set.m_sort_clause);
//std::cout << "debug: " << G_STRFUNC << ": " << sql_query << std::endl;
m_gda_datamodel = DbUtils::query_execute_select(sql_query, true /* use_cursor */);
@@ -369,7 +369,7 @@ bool DbTreeModel::refresh_from_database(const FoundSet& found_set)
//This doesn't work with cursor-based models: const int count = m_gda_datamodel->get_n_rows();
//because rows count is -1 until we have iterated to the last row.
- Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query_without_sort =
Utils::build_sql_select_with_where_clause(m_found_set.m_table_name, m_column_fields,
m_found_set.m_where_clause, m_found_set.m_extra_join, type_sort_clause());
+ auto sql_query_without_sort = Utils::build_sql_select_with_where_clause(m_found_set.m_table_name,
m_column_fields, m_found_set.m_where_clause, m_found_set.m_extra_join, type_sort_clause());
const int count = DbUtils::count_rows_returned_by(sql_query_without_sort);
if(count < 0)
{
@@ -472,7 +472,7 @@ void DbTreeModel::get_value_vfunc(const TreeModel::iterator& iter, int column, G
//Examine the columns in the returned DataModel:
for(int col = 0; col < m_gda_datamodel->get_n_columns(); ++col)
{
- Glib::RefPtr<Gnome::Gda::Column> column = m_gda_datamodel->describe_column(col);
+ auto column = m_gda_datamodel->describe_column(col);
std::cout << " debug: column index=" << col << ", name=" << column->get_name() << ", type="
<< g_type_name(column->get_g_type()) << std::endl;
}
*/
@@ -973,7 +973,7 @@ void DbTreeModel::get_record_counts(gulong& total, gulong& found) const
//Ask the database how many records there are in the whole table:
//TODO: Apparently, this is very slow:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
const auto id_function = builder->add_function("count", builder->add_id("*")); //TODO: Is * allowed
here?
@@ -981,7 +981,7 @@ void DbTreeModel::get_record_counts(gulong& total, gulong& found) const
builder->select_add_target(m_found_set.m_table_name);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+ auto datamodel = DbUtils::query_execute_select(builder);
if(datamodel)
{
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index f50f646..50d3117 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -111,7 +111,7 @@ DbAddDel::DbAddDel()
signal_style_changed().connect(sigc::mem_fun(*this, &DbAddDel::on_self_style_changed));
#endif // !GLOM_ENABLE_CLIENT_ONLY
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(refSelection)
{
refSelection->signal_changed().connect(
@@ -198,7 +198,7 @@ void DbAddDel::on_MenuPopup_activate_Delete()
{
finish_editing();
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -252,7 +252,7 @@ void DbAddDel::setup_menu(Gtk::Widget* /* widget */)
//TODO: add_accel_group(builder->get_accel_group());
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Edit"), "context.edit");
menu->append(_("_Add"), "context.add");
menu->append(_("_Delete"), "context.delete");
@@ -368,7 +368,7 @@ Gnome::Gda::Value DbAddDel::get_value_selected(const std::shared_ptr<const Layou
Gtk::TreeModel::iterator DbAddDel::get_item_selected()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
return refTreeSelection->get_selected();
@@ -385,7 +385,7 @@ Gtk::TreeModel::iterator DbAddDel::get_item_selected() const
Glib::RefPtr<const Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
- Glib::RefPtr<Gtk::TreeSelection> unconst =
Glib::RefPtr<Gtk::TreeSelection>::cast_const(refTreeSelection);
+ auto unconst = Glib::RefPtr<Gtk::TreeSelection>::cast_const(refTreeSelection);
return unconst->get_selected();
}
@@ -449,7 +449,7 @@ bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, const std::shar
treemodel_col += get_count_hidden_system_columns();
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
g_assert(refTreeSelection);
refTreeSelection->select(iter);
@@ -510,7 +510,7 @@ guint DbAddDel::get_fixed_cell_height()
// when all columns are known.
//Get a default:
- Glib::RefPtr<Pango::Layout> refLayoutDefault = m_TreeView.create_pango_layout("ExampleEg");
+ auto refLayoutDefault = m_TreeView.create_pango_layout("ExampleEg");
int width_default = 0;
int height_default = 0;
refLayoutDefault->get_pixel_size(width_default, height_default);
@@ -532,7 +532,7 @@ guint DbAddDel::get_fixed_cell_height()
continue;
// Translators: This is just some example text used to discover an appropriate height for user-entered
text in the UI. This text itself is never shown to the user.
- Glib::RefPtr<Pango::Layout> refLayout = m_TreeView.create_pango_layout(_("ExampleEg"));
+ auto refLayout = m_TreeView.create_pango_layout(_("ExampleEg"));
const Pango::FontDescription font(font_name);
refLayout->set_font_description(font);
int width = 0;
@@ -760,7 +760,7 @@ void DbAddDel::construct_specified_columns()
//Show as many rows as needed, but not more than the maximum:
gulong total = 0; //ignored
gulong db_rows_count_found = 0;
- Glib::RefPtr<DbTreeModel> refModelDerived = Glib::RefPtr<DbTreeModel>::cast_dynamic(m_refListStore);
+ auto refModelDerived = Glib::RefPtr<DbTreeModel>::cast_dynamic(m_refListStore);
if(refModelDerived)
refModelDerived->get_record_counts(total, db_rows_count_found);
@@ -1356,7 +1356,7 @@ void DbAddDel::on_treeview_cell_edited_bool(const Glib::ustring& path_string, in
void DbAddDel::on_idle_treeview_cell_edited_revert(const Gtk::TreeModel::Row& row, guint model_column_index)
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
if(!refTreeSelection)
return;
@@ -1905,7 +1905,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
auto pDerived = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
if(pDerived)
{
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
+ auto pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
//Scale it down to a sensible size.
if(pixbuf)
@@ -2398,7 +2398,7 @@ Gtk::TreeModel::iterator DbAddDel::get_row_selected()
void DbAddDel::on_treeview_selection_changed()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(!refSelection)
return;
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 1319ec7..36c9660 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -1165,7 +1165,7 @@ void FlowTableWithFields::apply_size_groups_to_labels(const type_vec_sizegroups&
for(auto info : m_listFields)
{
auto widget = info.m_first;
- Glib::RefPtr<Gtk::SizeGroup> previous_size_group = info.m_first_in_sizegroup;
+ auto previous_size_group = info.m_first_in_sizegroup;
if(!widget || !previous_size_group)
continue;
@@ -1199,7 +1199,7 @@ void FlowTableWithFields::apply_size_groups_to_labels(const type_vec_sizegroups&
if(column >= m_vec_size_groups.size())
continue;
- Glib::RefPtr<Gtk::SizeGroup> size_group = m_vec_size_groups[column];
+ auto size_group = m_vec_size_groups[column];
if(size_group && (info.m_first_in_sizegroup != size_group))
{
size_group->add_widget(*label);
diff --git a/glom/mode_design/box_db_table_relationships.cc b/glom/mode_design/box_db_table_relationships.cc
index bd678f0..419ebe0 100644
--- a/glom/mode_design/box_db_table_relationships.cc
+++ b/glom/mode_design/box_db_table_relationships.cc
@@ -85,7 +85,7 @@ bool Box_DB_Table_Relationships::fill_from_database()
auto sharedconnection = connect_to_server(get_app_window());
if(sharedconnection)
{
- Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
+ auto connection = sharedconnection->get_gda_connection();
//Set combo choices:
m_AddDel.set_column_choices(m_colFromField, util_vecStrings_from_Fields(
@@ -241,7 +241,7 @@ void Box_DB_Table_Relationships::on_adddel_user_activated(const Gtk::TreeModel::
auto sharedconnection = connect_to_server(get_app_window());
if(sharedconnection)
{
- Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
+ auto connection = sharedconnection->get_gda_connection();
auto document = get_document();
type_vec_strings vecFields = util_vecStrings_from_Fields(DbUtils::get_fields_for_table(document,
table_name));
diff --git a/glom/mode_design/dialog_database_preferences.cc b/glom/mode_design/dialog_database_preferences.cc
index 231d9e3..96cbc3a 100644
--- a/glom/mode_design/dialog_database_preferences.cc
+++ b/glom/mode_design/dialog_database_preferences.cc
@@ -88,15 +88,15 @@ Dialog_Database_Preferences::Dialog_Database_Preferences(BaseObjectType* cobject
//Dialog_Properties::set_modified(false);
//Tell the SourceView to do syntax highlighting for Python:
- Glib::RefPtr<Gsv::LanguageManager> languages_manager =
+ auto languages_manager =
Gsv::LanguageManager::get_default();
- Glib::RefPtr<Gsv::Language> language =
+ auto language =
languages_manager->get_language("python"); //This is the GtkSourceView language ID.
if(language)
{
//Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to
set it, using the wrong buffer type:
- Glib::RefPtr<Gsv::Buffer> buffer = Gsv::Buffer::create(language);
+ auto buffer = Gsv::Buffer::create(language);
buffer->set_highlight_syntax();
m_text_view_script->set_buffer(buffer);
}
@@ -126,7 +126,7 @@ void Dialog_Database_Preferences::on_treeview_cell_edited_next_value(const Glib:
const Gnome::Gda::Value next_value = Conversions::parse_value(new_value);
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
builder->add_field_value_as_value(GLOM_STANDARD_TABLE_AUTOINCREMENTS_FIELD_NEXT_VALUE, next_value);
builder->set_where(
@@ -169,7 +169,7 @@ void Dialog_Database_Preferences::load_from_document()
//Show the auto-increment values:
m_model_autoincrements->clear();
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(GLOM_STANDARD_TABLE_AUTOINCREMENTS_FIELD_TABLE_NAME,
GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME);
@@ -181,7 +181,7 @@ void Dialog_Database_Preferences::load_from_document()
NumericFormat numeric_format; //ignored
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+ auto datamodel = DbUtils::query_execute_select(builder);
if(!datamodel)
{
std::cerr << G_STRFUNC << ": Gda::DataModel is NULL." << std::endl;
diff --git a/glom/mode_design/fields/box_db_table_definition.cc
b/glom/mode_design/fields/box_db_table_definition.cc
index 937b195..97cc5a3 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -196,7 +196,7 @@ void Box_DB_Table_Definition::on_adddel_add(const Gtk::TreeModel::iterator& row)
field->set_title( Utils::title_from_string(name) , AppWindow::get_current_locale()); //Start with a
title that might be useful.
field->set_glom_type(Field::glom_field_type::NUMERIC);
- Glib::RefPtr<Gnome::Gda::Column> field_info = field->get_field_info();
+ auto field_info = field->get_field_info();
field_info->set_g_type( Field::get_gda_type_for_glom_type(Field::glom_field_type::NUMERIC) );
field->set_field_info(field_info);
@@ -475,7 +475,7 @@ std::shared_ptr<Field> Box_DB_Table_Definition::get_field_definition(const Gtk::
DbUtils::get_fields_for_table_one_field(pDoc, m_table_name, strFieldNameBeforeEdit);
if(field_temp)
{
- Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field_temp->get_field_info()->copy();
+ auto fieldInfo = field_temp->get_field_info()->copy();
//Name:
const auto name = m_AddDel.get_value(row, m_colName);
@@ -665,7 +665,7 @@ bool Box_DB_Table_Definition::field_has_null_values(const std::shared_ptr<const
{
//Note that "= Null" doesn't work, though it doesn't error either.
//Note also that SELECT COUNT always returns 0 if all the values are NULL, so we can't use that to be more
efficient.
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ auto builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder->select_add_field(field->get_name(), m_table_name);
builder->select_add_target(m_table_name);
@@ -674,7 +674,7 @@ bool Box_DB_Table_Definition::field_has_null_values(const std::shared_ptr<const
builder->add_field_id(field->get_name(), m_table_name)));
long null_count = 0;
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+ auto datamodel = DbUtils::query_execute_select(builder);
if(datamodel)
{
if(datamodel->get_n_rows() && datamodel->get_n_columns())
@@ -697,12 +697,12 @@ bool Box_DB_Table_Definition::field_has_non_unique_values(const std::shared_ptr<
long count_all = 0;
//Count the distinct rows:
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_query_distinct =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+ auto builder_query_distinct = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder_query_distinct->select_set_distinct();
builder_query_distinct->set_table(m_table_name);
builder_query_distinct->select_add_field(field->get_name(), m_table_name);
- Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder_query_distinct);
+ auto datamodel = DbUtils::query_execute_select(builder_query_distinct);
if(datamodel)
{
count_distinct = datamodel->get_n_rows();
@@ -714,7 +714,7 @@ bool Box_DB_Table_Definition::field_has_non_unique_values(const std::shared_ptr<
}
//Count all rows, to compare. TODO_performance: Is there a more efficient way to do this? Maybe count(*),
which apparently doesn't ignore NULL rows like count(somefield) would.
- Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_query_all =
+ auto builder_query_all =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
builder_query_all->select_add_field(field->get_name(), m_table_name);
builder_query_all->select_add_target(m_table_name);
diff --git a/glom/mode_design/fields/dialog_defaultformatting.cc
b/glom/mode_design/fields/dialog_defaultformatting.cc
index 503596c..36a6719 100644
--- a/glom/mode_design/fields/dialog_defaultformatting.cc
+++ b/glom/mode_design/fields/dialog_defaultformatting.cc
@@ -84,7 +84,7 @@ std::shared_ptr<Field> Dialog_DefaultFormatting::get_field() const
auto field = glom_sharedptr_clone(m_Field); //Start with the old details, to preserve anything that is not
in our UI.
// const_cast is necessary and save here for the window (jhs)
auto sharedcnc = connect_to_server(const_cast<Dialog_DefaultFormatting*>(this));
- Glib::RefPtr<Gnome::Gda::Connection> cnc = sharedcnc->get_gda_connection();
+ auto cnc = sharedcnc->get_gda_connection();
//Get the field info from the widgets:
diff --git a/glom/mode_design/fields/dialog_fieldcalculation.cc
b/glom/mode_design/fields/dialog_fieldcalculation.cc
index 15126bb..19ec16a 100644
--- a/glom/mode_design/fields/dialog_fieldcalculation.cc
+++ b/glom/mode_design/fields/dialog_fieldcalculation.cc
@@ -51,13 +51,13 @@ Dialog_FieldCalculation::Dialog_FieldCalculation(BaseObjectType* cobject, const
{
m_text_view->set_highlight_current_line(true);
- Glib::RefPtr<Gsv::LanguageManager> languages_manager = Gsv::LanguageManager::get_default();
+ auto languages_manager = Gsv::LanguageManager::get_default();
- Glib::RefPtr<Gsv::Language> language = languages_manager->get_language("python"); //This is the
GtkSourceView language ID.
+ auto language = languages_manager->get_language("python"); //This is the GtkSourceView language ID.
if(language)
{
//Createa a new buffer and set it, instead of getting the default buffer, in case libglade has tried
to set it, using the wrong buffer type:
- Glib::RefPtr<Gsv::Buffer> buffer = Gsv::Buffer::create(language);
+ auto buffer = Gsv::Buffer::create(language);
buffer->set_highlight_syntax();
m_text_view->set_buffer(buffer);
}
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc
b/glom/mode_design/fields/dialog_fielddefinition.cc
index 37c4346..8cb52ef 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -216,11 +216,11 @@ std::shared_ptr<Field> Dialog_FieldDefinition::get_field() const
auto field = glom_sharedptr_clone(m_Field); //Start with the old details, to preserve anything that is not
in our UI.
// const_cast is necessary and save here for the window (jhs)
auto sharedcnc = connect_to_server(const_cast<Dialog_FieldDefinition*>(this));
- Glib::RefPtr<Gnome::Gda::Connection> cnc = sharedcnc->get_gda_connection();
+ auto cnc = sharedcnc->get_gda_connection();
//Get the field info from the widgets:
- Glib::RefPtr<Gnome::Gda::Column> fieldInfo = field->get_field_info(); //Preserve previous information.
+ auto fieldInfo = field->get_field_info(); //Preserve previous information.
fieldInfo->set_name(m_pEntry_Name->get_text());
@@ -251,7 +251,7 @@ std::shared_ptr<Field> Dialog_FieldDefinition::get_field() const
if(m_pRadio_Calculate)
field->set_calculation(m_pTextView_Calculation->get_buffer()->get_text());
- Glib::RefPtr<Gnome::Gda::Column> field_info_copy = fieldInfo;
+ auto field_info_copy = fieldInfo;
field->set_field_info(fieldInfo);
diff --git a/glom/mode_design/layout/combobox_fields.cc b/glom/mode_design/layout/combobox_fields.cc
index 4040eb0..c4da945 100644
--- a/glom/mode_design/layout/combobox_fields.cc
+++ b/glom/mode_design/layout/combobox_fields.cc
@@ -77,7 +77,7 @@ void ComboBox_Fields::set_selected_field(const std::shared_ptr<const Field>& fie
void ComboBox_Fields::set_selected_field(const Glib::ustring& field_name)
{
//Look for the row with this text, and activate it:
- Glib::RefPtr<Gtk::TreeModel> model = get_model();
+ auto model = get_model();
if(model)
{
for(const auto& row : model->children())
diff --git a/glom/mode_design/layout/combobox_relationship.cc
b/glom/mode_design/layout/combobox_relationship.cc
index d8f773b..a2031d0 100644
--- a/glom/mode_design/layout/combobox_relationship.cc
+++ b/glom/mode_design/layout/combobox_relationship.cc
@@ -104,7 +104,7 @@ void ComboBox_Relationship::set_selected_relationship(const std::shared_ptr<cons
void ComboBox_Relationship::set_selected_relationship(const Glib::ustring& relationship_name, const
Glib::ustring& related_relationship_name)
{
//Look for the row with this text, and activate it:
- Glib::RefPtr<Gtk::TreeModel> model = get_model();
+ auto model = get_model();
if(model)
{
for(const auto& row : model->children())
diff --git a/glom/mode_design/layout/dialog_choose_field.cc b/glom/mode_design/layout/dialog_choose_field.cc
index ecbdd30..00a7fe1 100644
--- a/glom/mode_design/layout/dialog_choose_field.cc
+++ b/glom/mode_design/layout/dialog_choose_field.cc
@@ -63,7 +63,7 @@ Dialog_ChooseField::Dialog_ChooseField(BaseObjectType* cobject, const Glib::RefP
m_treeview->signal_row_activated().connect( sigc::mem_fun(*this, &Dialog_ChooseField::on_row_activated)
);
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview->get_selection();
+ auto refSelection = m_treeview->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_ChooseField::on_treeview_selection_changed) );
@@ -93,7 +93,7 @@ void Dialog_ChooseField::set_document(Document* document, const Glib::ustring& t
//If one start field was specified, then multiple selection would not make
//much sense. The caller probably wants single selection.
//Make this explicit in the API if that is not always suitable.
- Glib::RefPtr<Gtk::TreeView::Selection> selection = m_treeview->get_selection();
+ auto selection = m_treeview->get_selection();
selection->set_mode((field && !(field->get_name().empty()))
? Gtk::SELECTION_SINGLE : Gtk::SELECTION_MULTIPLE);
@@ -140,7 +140,7 @@ void Dialog_ChooseField::set_document(Document* document, const Glib::ustring& t
std::cerr << G_STRFUNC << ": table_name is empty" << std::endl;
}
- Glib::RefPtr<Gtk::TreeView::Selection> selection = m_treeview->get_selection();
+ auto selection = m_treeview->get_selection();
selection->set_mode(Gtk::SELECTION_MULTIPLE);
@@ -186,7 +186,7 @@ void Dialog_ChooseField::select_item(const Field& field)
if(field_item.get_name() == field.get_name())
{
//Select the item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview->get_selection();
+ auto refTreeSelection = m_treeview->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
}
@@ -228,7 +228,7 @@ Dialog_ChooseField::type_list_field_items Dialog_ChooseField::get_fields_chosen(
type_list_field_items list_fields;
//Field:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview->get_selection();
+ auto refTreeSelection = m_treeview->get_selection();
if(!refTreeSelection)
return list_fields;
@@ -331,7 +331,7 @@ void Dialog_ChooseField::on_combo_relationship_changed()
void Dialog_ChooseField::on_treeview_selection_changed()
{
#if 0
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview->get_selection();
+ auto refSelection = m_treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
diff --git a/glom/mode_design/layout/dialog_choose_relationship.cc
b/glom/mode_design/layout/dialog_choose_relationship.cc
index 7e809a8..aab7b08 100644
--- a/glom/mode_design/layout/dialog_choose_relationship.cc
+++ b/glom/mode_design/layout/dialog_choose_relationship.cc
@@ -88,7 +88,7 @@ void Dialog_ChooseRelationship::set_document(Document* document, const Glib::ust
void Dialog_ChooseRelationship::select_item(const std::shared_ptr<const Relationship>& relationship)
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview->get_selection();
+ auto refTreeSelection = m_treeview->get_selection();
if(!refTreeSelection)
return; //Should never happen.
@@ -115,7 +115,7 @@ std::shared_ptr<Relationship> Dialog_ChooseRelationship::get_relationship_chosen
{
std::shared_ptr<Relationship> result;
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview->get_selection();
+ auto refTreeSelection = m_treeview->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
diff --git a/glom/mode_design/layout/dialog_layout.cc b/glom/mode_design/layout/dialog_layout.cc
index 0d29552..d62ed2e 100644
--- a/glom/mode_design/layout/dialog_layout.cc
+++ b/glom/mode_design/layout/dialog_layout.cc
@@ -60,13 +60,13 @@ void Dialog_Layout::init(const Glib::ustring& layout_name, const Glib::ustring&
void Dialog_Layout::move_treeview_selection_up(Gtk::TreeView* treeview, const Gtk::TreeModelColumn<guint>&
sequence_column)
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview->get_selection();
+ auto refSelection = treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
if(iter)
{
- Glib::RefPtr<Gtk::TreeModel> model = treeview->get_model();
+ auto model = treeview->get_model();
if(iter != model->children().begin()) //If it is not the first one.
{
auto iterBefore = iter;
@@ -94,7 +94,7 @@ void Dialog_Layout::move_treeview_selection_up(Gtk::TreeView* treeview, const Gt
void Dialog_Layout::move_treeview_selection_down(Gtk::TreeView* treeview, const Gtk::TreeModelColumn<guint>&
sequence_column)
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview->get_selection();
+ auto refSelection = treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -103,7 +103,7 @@ void Dialog_Layout::move_treeview_selection_down(Gtk::TreeView* treeview, const
auto iterNext = iter;
iterNext++;
- Glib::RefPtr<Gtk::TreeModel> model = treeview->get_model();
+ auto model = treeview->get_model();
if(iterNext != model->children().end()) //If it is not the last one.
{
Gtk::TreeModel::Row row = *iter;
diff --git a/glom/mode_design/layout/dialog_layout_calendar_related.cc
b/glom/mode_design/layout/dialog_layout_calendar_related.cc
index 5a54a5e..189d0be 100644
--- a/glom/mode_design/layout/dialog_layout_calendar_related.cc
+++ b/glom/mode_design/layout/dialog_layout_calendar_related.cc
@@ -385,7 +385,7 @@ void Dialog_Layout_Calendar_Related::on_button_add_field()
row[m_model_items->m_columns.m_col_layout_item] = field;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -396,7 +396,7 @@ void Dialog_Layout_Calendar_Related::on_button_add_field()
void Dialog_Layout_Calendar_Related::on_button_edit()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -417,7 +417,7 @@ void Dialog_Layout_Calendar_Related::on_button_edit()
//Scroll to, and select, the new row:
/*
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
diff --git a/glom/mode_design/layout/dialog_layout_details.cc
b/glom/mode_design/layout/dialog_layout_details.cc
index e1a3694..36f514f 100644
--- a/glom/mode_design/layout/dialog_layout_details.cc
+++ b/glom/mode_design/layout/dialog_layout_details.cc
@@ -154,7 +154,7 @@ Dialog_Layout_Details::Dialog_Layout_Details(BaseObjectType* cobject, const Glib
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_Layout_Details::on_treeview_fields_selection_changed) );
@@ -372,7 +372,7 @@ void Dialog_Layout_Details::init(const Glib::ustring& layout_name, const Glib::u
void Dialog_Layout_Details::enable_buttons()
{
//Fields:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -441,7 +441,7 @@ void Dialog_Layout_Details::enable_buttons()
void Dialog_Layout_Details::on_button_field_delete()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -456,7 +456,7 @@ void Dialog_Layout_Details::on_button_field_delete()
void Dialog_Layout_Details::on_button_up()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -487,7 +487,7 @@ void Dialog_Layout_Details::on_button_up()
void Dialog_Layout_Details::on_button_down()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -533,7 +533,7 @@ void Dialog_Layout_Details::on_button_add_field()
row[m_model_items->m_columns.m_col_layout_item] = glom_sharedptr_clone(layout_item);
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -651,7 +651,7 @@ void Dialog_Layout_Details::on_button_add_button()
row[m_model_items->m_columns.m_col_layout_item] = button;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -676,7 +676,7 @@ void Dialog_Layout_Details::on_button_add_text()
row[m_model_items->m_columns.m_col_layout_item] = textobject;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -701,7 +701,7 @@ void Dialog_Layout_Details::on_button_add_image()
row[m_model_items->m_columns.m_col_layout_item] = imageobject;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -725,7 +725,7 @@ void Dialog_Layout_Details::on_button_add_notebook()
row[m_model_items->m_columns.m_col_layout_item] = notebook;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -754,7 +754,7 @@ void Dialog_Layout_Details::on_button_add_related()
row[m_model_items->m_columns.m_col_layout_item] = portal;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -786,7 +786,7 @@ void Dialog_Layout_Details::on_button_add_related_calendar()
row[m_model_items->m_columns.m_col_layout_item] = portal;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -805,7 +805,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Details::get_selected_group_parent() cons
Gtk::TreeModel::iterator parent;
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -856,7 +856,7 @@ void Dialog_Layout_Details::on_button_add_group()
row[m_model_items->m_columns.m_col_layout_item] = layout_item;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iterNewGroup);
@@ -873,7 +873,7 @@ void Dialog_Layout_Details::on_button_formatting()
//TODO: Abstract this into the base class:
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -912,7 +912,7 @@ void Dialog_Layout_Details::on_button_formatting()
void Dialog_Layout_Details::on_button_edit()
{
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
diff --git a/glom/mode_design/layout/dialog_layout_export.cc b/glom/mode_design/layout/dialog_layout_export.cc
index 0592dbf..d6c582f 100644
--- a/glom/mode_design/layout/dialog_layout_export.cc
+++ b/glom/mode_design/layout/dialog_layout_export.cc
@@ -65,7 +65,7 @@ Dialog_Layout_Export::Dialog_Layout_Export(BaseObjectType* cobject, const Glib::
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_Layout_Export::on_treeview_fields_selection_changed) );
@@ -165,7 +165,7 @@ void Dialog_Layout_Export::set_layout_groups(Document::type_list_layout_groups&
void Dialog_Layout_Export::enable_buttons()
{
//Fields:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -265,7 +265,7 @@ void Dialog_Layout_Export::on_button_add_field()
row[m_ColumnsFields.m_col_layout_item] = field;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -280,7 +280,7 @@ void Dialog_Layout_Export::on_button_add_field()
void Dialog_Layout_Export::on_button_delete()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -319,7 +319,7 @@ void Dialog_Layout_Export::on_cell_data_name(Gtk::CellRenderer* renderer, const
void Dialog_Layout_Export::on_button_edit_field()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -339,7 +339,7 @@ void Dialog_Layout_Export::on_button_edit_field()
//Scroll to, and select, the new row:
/*
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
diff --git a/glom/mode_design/layout/dialog_layout_list_related.cc
b/glom/mode_design/layout/dialog_layout_list_related.cc
index eafd173..617b601 100644
--- a/glom/mode_design/layout/dialog_layout_list_related.cc
+++ b/glom/mode_design/layout/dialog_layout_list_related.cc
@@ -507,7 +507,7 @@ void Dialog_Layout_List_Related::on_button_add_field()
row[m_model_items->m_columns.m_col_layout_item] = field;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -518,7 +518,7 @@ void Dialog_Layout_List_Related::on_button_add_field()
void Dialog_Layout_List_Related::on_button_edit()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -539,7 +539,7 @@ void Dialog_Layout_List_Related::on_button_edit()
//Scroll to, and select, the new row:
/*
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
index 1ebb75f..c20b1fa 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc
@@ -53,15 +53,15 @@ Dialog_ButtonScript::Dialog_ButtonScript(BaseObjectType* cobject, const Glib::Re
//Dialog_Properties::set_modified(false);
//Tell the SourceView to do syntax highlighting for Python:
- Glib::RefPtr<Gsv::LanguageManager> languages_manager =
+ auto languages_manager =
Gsv::LanguageManager::get_default();
- Glib::RefPtr<Gsv::Language> language =
+ auto language =
languages_manager->get_language("python"); //This is the GtkSourceView language ID.
if(language)
{
//Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to
set it, using the wrong buffer type:
- Glib::RefPtr<Gsv::Buffer> buffer = Gsv::Buffer::create(language);
+ auto buffer = Gsv::Buffer::create(language);
buffer->set_highlight_syntax();
m_text_view_script->set_buffer(buffer);
}
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
b/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
index d035583..1532809 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
@@ -63,7 +63,7 @@ Dialog_FieldsList::Dialog_FieldsList(BaseObjectType* cobject, const Glib::RefPtr
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_FieldsList::on_treeview_fields_selection_changed) );
@@ -134,7 +134,7 @@ void Dialog_FieldsList::set_fields(const Glib::ustring& table_name, const Layout
void Dialog_FieldsList::enable_buttons()
{
//Fields:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -217,7 +217,7 @@ Gtk::TreeModel::iterator Dialog_FieldsList::append_appropriate_row()
{
Gtk::TreeModel::iterator result;
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
auto selected = refTreeSelection->get_selected();
//Add the field details to the layout treeview:
@@ -252,7 +252,7 @@ void Dialog_FieldsList::on_button_add_field()
row[m_ColumnsFields.m_col_layout_item] = field;
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -265,7 +265,7 @@ void Dialog_FieldsList::on_button_add_field()
void Dialog_FieldsList::on_button_delete()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -309,7 +309,7 @@ void Dialog_FieldsList::on_cell_data_name(Gtk::CellRenderer* renderer, const Gtk
void Dialog_FieldsList::on_button_edit_field()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -329,7 +329,7 @@ void Dialog_FieldsList::on_button_edit_field()
//Scroll to, and select, the new row:
/*
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -343,7 +343,7 @@ void Dialog_FieldsList::on_button_edit_field()
void Dialog_FieldsList::on_button_formatting()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
b/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
index 0ad3ef8..05bef79 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
@@ -63,7 +63,7 @@ Dialog_SortFields::Dialog_SortFields(BaseObjectType* cobject, const Glib::RefPtr
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_SortFields::on_treeview_fields_selection_changed) );
@@ -130,7 +130,7 @@ void Dialog_SortFields::set_fields(const Glib::ustring& table_name, const Layout
void Dialog_SortFields::enable_buttons()
{
//Fields:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_fields->get_selection();
+ auto refSelection = m_treeview_fields->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -226,7 +226,7 @@ void Dialog_SortFields::on_button_add_field()
row[m_ColumnsFields.m_col_ascending] = true; //Default to this so that alphabetical searches go from A
to Z by default.
//Scroll to, and select, the new row:
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
@@ -239,7 +239,7 @@ void Dialog_SortFields::on_button_add_field()
void Dialog_SortFields::on_button_delete()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -274,7 +274,7 @@ void Dialog_SortFields::on_cell_data_name(Gtk::CellRenderer* renderer, const Gtk
void Dialog_SortFields::on_button_edit_field()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
{
//TODO: Handle multiple-selection:
@@ -295,7 +295,7 @@ void Dialog_SortFields::on_button_edit_field()
//Scroll to, and select, the new row:
/*
- Glib::RefPtr<Gtk::TreeView::Selection> refTreeSelection = m_treeview_fields->get_selection();
+ auto refTreeSelection = m_treeview_fields->get_selection();
if(refTreeSelection)
refTreeSelection->select(iter);
diff --git a/glom/mode_design/layout/treestore_layout.cc b/glom/mode_design/layout/treestore_layout.cc
index fd2e30b..8555f88 100644
--- a/glom/mode_design/layout/treestore_layout.cc
+++ b/glom/mode_design/layout/treestore_layout.cc
@@ -50,7 +50,7 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
{
//Get the Row that is being dragged:
//TODO: Add const version of get_from_selection_data(): Glib::RefPtr<const Gtk::TreeModel> refThis =
Glib::RefPtr<const Gtk::TreeModel>(this);
- Glib::RefPtr<Gtk::TreeModel> refThis = Glib::RefPtr<Gtk::TreeModel>(const_cast<TreeStore_Layout*>(this));
+ auto refThis = Glib::RefPtr<Gtk::TreeModel>(const_cast<TreeStore_Layout*>(this));
refThis->reference(); //, true /* take_copy */)
Gtk::TreeModel::Path path_dragged_row;
Gtk::TreeModel::Path::get_from_selection_data(selection_data, refThis, path_dragged_row);
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc
b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index 12e9fd4..d4b6cab 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -194,7 +194,7 @@ Window_PrintLayout_Edit::Window_PrintLayout_Edit(BaseObjectType* cobject, const
void Window_PrintLayout_Edit::init_menu()
{
- Glib::RefPtr<Gio::SimpleActionGroup> action_group = Gio::SimpleActionGroup::create();
+ auto action_group = Gio::SimpleActionGroup::create();
add_action("pagesetup",
sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_menu_file_page_setup));
@@ -271,9 +271,9 @@ void Window_PrintLayout_Edit::init_menu()
insert_action_group("printlayout", action_group);
//Get the menu:
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("Menubar");
- Glib::RefPtr<Gio::Menu> gmenu =
+ auto gmenu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!gmenu)
g_warning("GMenu not found");
@@ -523,7 +523,7 @@ void Window_PrintLayout_Edit::on_canvas_drag_data_received(const Glib::RefPtr<Gd
return;
}
- Glib::RefPtr<CanvasLayoutItem> item =
+ auto item =
create_canvas_layout_item_and_add(layout_item);
item->snap_position(item_x, item_y);
item->set_xy(item_x, item_y);
@@ -682,7 +682,7 @@ void Window_PrintLayout_Edit::on_context_menu_insert_text()
void Window_PrintLayout_Edit::setup_context_menu()
{
- Glib::RefPtr<Gio::SimpleActionGroup> action_group = Gio::SimpleActionGroup::create();
+ auto action_group = Gio::SimpleActionGroup::create();
action_group->add_action("insert-field",
sigc::mem_fun(*this, &Window_PrintLayout_Edit::on_context_menu_insert_field) );
@@ -699,9 +699,9 @@ void Window_PrintLayout_Edit::setup_context_menu()
insert_action_group("context", action_group);
//Get the menu:
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("ContextMenu");
- Glib::RefPtr<Gio::Menu> gmenu =
+ auto gmenu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!gmenu)
g_warning("GMenu not found");
@@ -735,11 +735,11 @@ void Window_PrintLayout_Edit::on_canvas_show_context_menu(guint button, guint32
bool Window_PrintLayout_Edit::get_is_item_at(double x, double y)
{
- Glib::RefPtr<Goocanvas::Item> item_hit = m_canvas.get_item_at(x, y, false);
+ auto item_hit = m_canvas.get_item_at(x, y, false);
if(!item_hit)
return false;
- Glib::RefPtr<CanvasLayoutItem> layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
+ auto layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
return layout_item;
}
@@ -849,7 +849,7 @@ void Window_PrintLayout_Edit::on_menu_insert_create_standard()
return;
}
- Glib::RefPtr<Gtk::PageSetup> page_setup = m_canvas.get_page_setup();
+ auto page_setup = m_canvas.get_page_setup();
if(!page_setup)
{
std::cerr << G_STRFUNC << ": page_setup was null" << std::endl;
@@ -1003,10 +1003,10 @@ void Window_PrintLayout_Edit::on_menu_view_zoom(int parameter)
void Window_PrintLayout_Edit::on_menu_file_page_setup()
{
- Glib::RefPtr<Gtk::PageSetup> page_setup = m_canvas.get_page_setup();
+ auto page_setup = m_canvas.get_page_setup();
//Show the page setup dialog, asking it to start with the existing settings:
- Glib::RefPtr<Gtk::PrintSettings> print_settings = Gtk::PrintSettings::create(); //TODO: Do we really need
to get this from the user and store it?
+ auto print_settings = Gtk::PrintSettings::create(); //TODO: Do we really need to get this from the user
and store it?
page_setup = Gtk::run_page_setup_dialog(*this, page_setup, print_settings);
//Save the chosen page setup dialog for use when printing, previewing, or
@@ -1094,7 +1094,7 @@ void Window_PrintLayout_Edit::on_menu_edit_paste()
Glib::RefPtr<CanvasLayoutItem> Window_PrintLayout_Edit::create_canvas_layout_item_and_add(const
std::shared_ptr<LayoutItem>& layout_item)
{
- Glib::RefPtr<CanvasLayoutItem> canvas_item = CanvasLayoutItem::create();
+ auto canvas_item = CanvasLayoutItem::create();
m_canvas.add_canvas_layout_item(canvas_item);
canvas_item->set_layout_item(layout_item);
@@ -1107,7 +1107,7 @@ void Window_PrintLayout_Edit::on_menu_edit_delete()
{
while(!m_layout_items_selected.empty())
{
- Glib::RefPtr<CanvasLayoutItem> item = m_layout_items_selected[0];
+ auto item = m_layout_items_selected[0];
if(item)
m_canvas.remove_canvas_layout_item(item);
}
@@ -1132,7 +1132,7 @@ void Window_PrintLayout_Edit::on_menu_align_top()
for(auto iter = m_layout_items_selected.begin();
iter != m_layout_items_selected.end(); ++iter)
{
- Glib::RefPtr<CanvasLayoutItem> selected_item = *iter;
+ auto selected_item = *iter;
if(!selected_item)
continue;
@@ -1166,7 +1166,7 @@ void Window_PrintLayout_Edit::on_menu_align_bottom()
for(auto iter = m_layout_items_selected.begin();
iter != m_layout_items_selected.end(); ++iter)
{
- Glib::RefPtr<CanvasLayoutItem> selected_item = *iter;
+ auto selected_item = *iter;
if(!selected_item)
continue;
@@ -1212,7 +1212,7 @@ void Window_PrintLayout_Edit::on_menu_align_left()
for(auto iter = m_layout_items_selected.begin();
iter != m_layout_items_selected.end(); ++iter)
{
- Glib::RefPtr<CanvasLayoutItem> selected_item = *iter;
+ auto selected_item = *iter;
if(!selected_item)
continue;
@@ -1246,7 +1246,7 @@ void Window_PrintLayout_Edit::on_menu_align_right()
for(auto iter = m_layout_items_selected.begin();
iter != m_layout_items_selected.end(); ++iter)
{
- Glib::RefPtr<CanvasLayoutItem> selected_item = *iter;
+ auto selected_item = *iter;
if(!selected_item)
continue;
@@ -1406,7 +1406,7 @@ void Window_PrintLayout_Edit::on_canvas_selection_changed()
for(auto iter = items.begin();
iter != items.end(); ++iter)
{
- Glib::RefPtr<CanvasLayoutItem> item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(*iter);
+ auto item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(*iter);
if(!item)
continue;
@@ -1562,7 +1562,7 @@ void Window_PrintLayout_Edit::on_spinbutton_width()
if(m_layout_items_selected.empty())
return;
- Glib::RefPtr<CanvasLayoutItem> item = m_layout_items_selected[0];
+ auto item = m_layout_items_selected[0];
double width = 0;
double height = 0;
@@ -1581,7 +1581,7 @@ void Window_PrintLayout_Edit::on_spinbutton_height()
if(m_layout_items_selected.empty())
return;
- Glib::RefPtr<CanvasLayoutItem> item = m_layout_items_selected[0];
+ auto item = m_layout_items_selected[0];
double width = 0;
double height = 0;
diff --git a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
index 5325298..5f8e8fc 100644
--- a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
+++ b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
@@ -50,7 +50,7 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
m_table_height = field_height * (fields.size() + 1);
- Glib::RefPtr<CanvasRectMovable> rect = CanvasRectMovable::create(x, y, m_table_width, m_table_height);
+ auto rect = CanvasRectMovable::create(x, y, m_table_width, m_table_height);
rect->property_line_width() = 2.0;
rect->property_radius_x() = 4.0,
rect->property_radius_y() = 4.0;
@@ -60,7 +60,7 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
add_child(rect);
const Glib::ustring title = "<b>" + table_title + "</b>";
- Glib::RefPtr<CanvasTextMovable> text = CanvasTextMovable::create(title,
+ auto text = CanvasTextMovable::create(title,
x + margin, y + margin, m_table_width - margin*2,
Goocanvas::ANCHOR_NORTH_WEST);
text->property_font() = "Sans 12"; //TODO: Let the user specify this.
@@ -68,7 +68,7 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
text->set_movement_allowed(false, false); //Move only as part of the parent group.
add_child(text);
- Glib::RefPtr<CanvasLineMovable> line = CanvasLineMovable::create();
+ auto line = CanvasLineMovable::create();
double points_coordinates[] = {x, y + field_height, x + m_table_width, y + field_height};
Goocanvas::Points points(2, points_coordinates);
line->property_points() = points;
@@ -89,7 +89,7 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
else
title_field = item_get_title_or_name(field);
- Glib::RefPtr<CanvasTextMovable> text_item = CanvasTextMovable::create(title_field,
+ auto text_item = CanvasTextMovable::create(title_field,
x + margin, y + margin + field_y, m_table_width - margin*2,
Goocanvas::ANCHOR_NORTH_WEST);
text_item->property_font() = "Sans 12"; //TODO: Let the user specify this.
diff --git a/glom/mode_design/relationships_overview/printoperation_relationshipsoverview.cc
b/glom/mode_design/relationships_overview/printoperation_relationshipsoverview.cc
index cc024d3..6417108 100644
--- a/glom/mode_design/relationships_overview/printoperation_relationshipsoverview.cc
+++ b/glom/mode_design/relationships_overview/printoperation_relationshipsoverview.cc
@@ -56,7 +56,7 @@ void PrintOperationRelationshipsOverview::on_draw_page(
double canvas_right = 0;
double canvas_bottom = 0;
- Glib::RefPtr<Goocanvas::Item> root_item = m_canvas->get_root_item();
+ auto root_item = m_canvas->get_root_item();
if(!root_item)
return;
diff --git a/glom/mode_design/relationships_overview/window_relationships_overview.cc
b/glom/mode_design/relationships_overview/window_relationships_overview.cc
index a421fc9..932e4f9 100644
--- a/glom/mode_design/relationships_overview/window_relationships_overview.cc
+++ b/glom/mode_design/relationships_overview/window_relationships_overview.cc
@@ -60,7 +60,7 @@ Window_RelationshipsOverview::Window_RelationshipsOverview(BaseObjectType* cobje
Gtk::Box* vbox = nullptr;
builder->get_widget("vbox_placeholder_menubar", vbox);
- Glib::RefPtr<Gio::SimpleActionGroup> action_group = Gio::SimpleActionGroup::create();
+ auto action_group = Gio::SimpleActionGroup::create();
add_action("pagesetup",
sigc::mem_fun(*this, &Window_RelationshipsOverview::on_menu_file_page_setup) );
@@ -76,9 +76,9 @@ Window_RelationshipsOverview::Window_RelationshipsOverview(BaseObjectType* cobje
insert_action_group("relationshipsoverview", action_group);
//Get the menu:
- Glib::RefPtr<Glib::Object> object =
+ auto object =
builder->get_object("Overview_MainMenu");
- Glib::RefPtr<Gio::Menu> gmenu =
+ auto gmenu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!gmenu)
g_warning("GMenu not found");
@@ -180,7 +180,7 @@ void Window_RelationshipsOverview::draw_tables()
Document::type_vec_fields fields = document->get_table_fields(table_name);
- Glib::RefPtr<CanvasGroupDbTable> table_group =
+ auto table_group =
CanvasGroupDbTable::create(info->get_name(), item_get_title_or_name(info), fields, table_x, table_y);
m_group_tables->add_child(table_group);
m_canvas.associate_with_grid(table_group); //Make snapping work.
@@ -227,7 +227,7 @@ void Window_RelationshipsOverview::draw_lines()
if(!relationship)
continue;
- Glib::RefPtr<CanvasGroupDbTable> group_from = get_table_group(relationship->get_from_table());
+ auto group_from = get_table_group(relationship->get_from_table());
double from_field_x = 0.0;
double from_field_y = 0.0;
@@ -245,7 +245,7 @@ void Window_RelationshipsOverview::draw_lines()
//Only primary keys can be to fields:
if(true) //document->get_field(relationship->get_to_table(),
relationship->get_to_field())->get_primary_key())
{
- Glib::RefPtr<CanvasGroupDbTable> group_to = get_table_group(relationship->get_to_table());
+ auto group_to = get_table_group(relationship->get_to_table());
double to_field_x = 0.0;
double to_field_y = 0.0;
@@ -273,7 +273,7 @@ void Window_RelationshipsOverview::draw_lines()
}
//Create the line:
- Glib::RefPtr<CanvasLineMovable> line = CanvasLineMovable::create();
+ auto line = CanvasLineMovable::create();
double points_coordinates[] = {from_field_x, from_field_y,
from_field_x + extra_line, from_field_y,
to_field_x - extra_line, to_field_y,
@@ -300,7 +300,7 @@ void Window_RelationshipsOverview::draw_lines()
const double text_x = (from_field_x + to_field_x) / 2;
const auto text_y = ((from_field_y + to_field_y) / 2) + y_offset;
- Glib::RefPtr<CanvasTextMovable> text =
CanvasTextMovable::create(item_get_title_or_name(relationship),
+ auto text = CanvasTextMovable::create(item_get_title_or_name(relationship),
text_x, text_y, -1, //TODO: Calc a suitable width.
Goocanvas::ANCHOR_CENTER);
text->property_font() = "Sans 10";
@@ -331,7 +331,7 @@ void Window_RelationshipsOverview::on_menu_file_print()
void Window_RelationshipsOverview::on_menu_file_page_setup()
{
//Show the page setup dialog, asking it to start with the existing settings:
- Glib::RefPtr<Gtk::PageSetup> new_page_setup =
+ auto new_page_setup =
Gtk::run_page_setup_dialog(*this, m_refPageSetup, m_refSettings);
//Save the chosen page setup dialog for use when printing, previewing, or
@@ -367,7 +367,7 @@ void Window_RelationshipsOverview::print_or_preview(Gtk::PrintOperationAction pr
{
//Create a new PrintOperation with our PageSetup and PrintSettings:
//(We use our derived PrintOperation class)
- Glib::RefPtr<PrintOperationRelationshipsOverview> print = PrintOperationRelationshipsOverview::create();
+ auto print = PrintOperationRelationshipsOverview::create();
print->set_canvas(&m_canvas);
print->set_track_print_status();
@@ -394,8 +394,8 @@ Glib::RefPtr<CanvasGroupDbTable> Window_RelationshipsOverview::get_table_group(c
const auto count = m_group_tables->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> item = m_group_tables->get_child(i);
- Glib::RefPtr<CanvasGroupDbTable> table_item = Glib::RefPtr<CanvasGroupDbTable>::cast_dynamic(item);
+ auto item = m_group_tables->get_child(i);
+ auto table_item = Glib::RefPtr<CanvasGroupDbTable>::cast_dynamic(item);
if(table_item && (table_item->get_table_name() == table_name))
{
return table_item;
@@ -408,7 +408,7 @@ Glib::RefPtr<CanvasGroupDbTable> Window_RelationshipsOverview::get_table_group(c
void Window_RelationshipsOverview::on_table_moved(const Glib::RefPtr<CanvasItemMovable>& item, double /*
x_offset */, double /* y_offset */)
{
- Glib::RefPtr<CanvasGroupDbTable> table =
+ auto table =
Glib::RefPtr<CanvasGroupDbTable>::cast_dynamic(item);
if(!table)
return;
@@ -450,7 +450,7 @@ void Window_RelationshipsOverview::on_table_show_context(guint button, guint32 a
void Window_RelationshipsOverview::setup_context_menu()
{
- Glib::RefPtr<Gio::SimpleActionGroup> action_group = Gio::SimpleActionGroup::create();
+ auto action_group = Gio::SimpleActionGroup::create();
m_action_edit_fields = action_group->add_action("edit-fields");
m_action_edit_relationships = action_group->add_action("edit-relationships");
@@ -458,9 +458,9 @@ void Window_RelationshipsOverview::setup_context_menu()
insert_action_group("context", action_group);
//Get the menu:
- Glib::RefPtr<Glib::Object> object =
+ auto object =
m_builder->get_object("ContextMenu");
- Glib::RefPtr<Gio::Menu> gmenu =
+ auto gmenu =
Glib::RefPtr<Gio::Menu>::cast_dynamic(object);
if(!gmenu)
g_warning("GMenu not found");
diff --git a/glom/mode_design/report_layout/dialog_layout_report.cc
b/glom/mode_design/report_layout/dialog_layout_report.cc
index 3093157..e1d4b0d 100644
--- a/glom/mode_design/report_layout/dialog_layout_report.cc
+++ b/glom/mode_design/report_layout/dialog_layout_report.cc
@@ -162,7 +162,7 @@ Dialog_Layout_Report::Dialog_Layout_Report(BaseObjectType* cobject, const Glib::
m_treeview_available_parts->set_headers_visible(false); //There's only one column, so this is not useful.
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_available_parts->get_selection();
+ auto refSelection = m_treeview_available_parts->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_Layout_Report::on_treeview_available_parts_selection_changed) );
@@ -226,7 +226,7 @@ void Dialog_Layout_Report::setup_model(Gtk::TreeView& treeview, Glib::RefPtr<typ
// sigc::bind( sigc::mem_fun(*this, &Dialog_Layout_Report::on_treeview_cell_edited_numeric),
m_model_parts_main->m_columns.m_col_columns_count) );
//Respond to changes of selection:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview.get_selection();
+ auto refSelection = treeview.get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_Layout_Report::on_treeview_parts_selection_changed) );
@@ -391,7 +391,7 @@ void Dialog_Layout_Report::enable_buttons()
bool enable_add = false;
//Available Parts:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelectionAvailable = m_treeview_available_parts->get_selection();
+ auto refSelectionAvailable = m_treeview_available_parts->get_selection();
if(refSelectionAvailable)
{
auto iter = refSelectionAvailable->get_selected();
@@ -413,10 +413,10 @@ void Dialog_Layout_Report::enable_buttons()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
//Parts:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview->get_selection();
+ auto refSelection = treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -537,9 +537,9 @@ void Dialog_Layout_Report::on_button_delete()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview->get_selection();
+ auto refTreeSelection = treeview->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -558,9 +558,9 @@ void Dialog_Layout_Report::on_button_up()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview->get_selection();
+ auto refSelection = treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -595,9 +595,9 @@ void Dialog_Layout_Report::on_button_down()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = treeview->get_selection();
+ auto refSelection = treeview->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -633,8 +633,8 @@ void Dialog_Layout_Report::on_button_add()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
- Glib::RefPtr<type_model> model_available =
Glib::RefPtr<type_model>::cast_dynamic(m_treeview_available_parts->get_model());
+ auto model = get_selected_model();
+ auto model_available = Glib::RefPtr<type_model>::cast_dynamic(m_treeview_available_parts->get_model());
auto parent = get_selected_group_parent();
std::shared_ptr<const LayoutItem> pParentPart;
@@ -728,7 +728,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Report::get_selected_group_parent() const
Glib::RefPtr<const type_model> model = get_selected_model();
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview->get_selection();
+ auto refTreeSelection = treeview->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -758,7 +758,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Report::get_selected_available() const
Gtk::TreeModel::iterator iter;
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_available_parts->get_selection();
+ auto refTreeSelection = m_treeview_available_parts->get_selection();
if(refTreeSelection)
{
iter = refTreeSelection->get_selected();
@@ -774,10 +774,10 @@ void Dialog_Layout_Report::on_button_formatting()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview->get_selection();
+ auto refTreeSelection = treeview->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -806,10 +806,10 @@ void Dialog_Layout_Report::on_button_edit()
if(!treeview)
return;
- Glib::RefPtr<type_model> model = get_selected_model();
+ auto model = get_selected_model();
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview->get_selection();
+ auto refTreeSelection = treeview->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -992,7 +992,7 @@ void Dialog_Layout_Report::on_cell_data_available_part(Gtk::CellRenderer* render
if(iter)
{
Gtk::TreeModel::Row row = *iter;
- Glib::RefPtr<type_model> model =
Glib::RefPtr<type_model>::cast_dynamic(m_treeview_available_parts->get_model());
+ auto model = Glib::RefPtr<type_model>::cast_dynamic(m_treeview_available_parts->get_model());
std::shared_ptr<LayoutItem> pItem = row[model->m_columns.m_col_item];
Glib::ustring part = pItem->get_part_type_name();
diff --git a/glom/mode_design/report_layout/treestore_report_layout.cc
b/glom/mode_design/report_layout/treestore_report_layout.cc
index 908a7fc..defd380 100644
--- a/glom/mode_design/report_layout/treestore_report_layout.cc
+++ b/glom/mode_design/report_layout/treestore_report_layout.cc
@@ -58,7 +58,7 @@ bool TreeStore_ReportLayout::row_drop_possible_vfunc(const Gtk::TreeModel::Path&
{
//Get the Row that is being dragged:
//TODO: Add const version of get_from_selection_data(): Glib::RefPtr<const Gtk::TreeModel> refThis =
Glib::RefPtr<const Gtk::TreeModel>(this);
- Glib::RefPtr<Gtk::TreeModel> refThis =
Glib::RefPtr<Gtk::TreeModel>(const_cast<TreeStore_ReportLayout*>(this));
+ auto refThis = Glib::RefPtr<Gtk::TreeModel>(const_cast<TreeStore_ReportLayout*>(this));
refThis->reference(); //, true /* take_copy */)
Gtk::TreeModel::Path path_dragged_row;
Gtk::TreeModel::Path::get_from_selection_data(selection_data, refThis, path_dragged_row);
diff --git a/glom/mode_design/script_library/dialog_script_library.cc
b/glom/mode_design/script_library/dialog_script_library.cc
index efcbbb4..c9d6588 100644
--- a/glom/mode_design/script_library/dialog_script_library.cc
+++ b/glom/mode_design/script_library/dialog_script_library.cc
@@ -58,13 +58,13 @@ Dialog_ScriptLibrary::Dialog_ScriptLibrary(BaseObjectType* cobject, const Glib::
//Dialog_Properties::set_modified(false);
//Set the SourceView to do syntax highlighting for Python:
- Glib::RefPtr<Gsv::LanguageManager> languages_manager = Gsv::LanguageManager::get_default();
+ auto languages_manager = Gsv::LanguageManager::get_default();
- Glib::RefPtr<Gsv::Language> language = languages_manager->get_language("python"); //This is the
GtkSourceView language ID.
+ auto language = languages_manager->get_language("python"); //This is the GtkSourceView language ID.
if(language)
{
//Create a new buffer and set it, instead of getting the default buffer, in case libglade has tried to
set it, using the wrong buffer type:
- Glib::RefPtr<Gsv::Buffer> buffer = Gsv::Buffer::create(language);
+ auto buffer = Gsv::Buffer::create(language);
buffer->set_highlight_syntax();
m_text_view->set_buffer(buffer);
}
diff --git a/glom/mode_design/translation/combobox_locale.cc b/glom/mode_design/translation/combobox_locale.cc
index b3faf83..640b64d 100644
--- a/glom/mode_design/translation/combobox_locale.cc
+++ b/glom/mode_design/translation/combobox_locale.cc
@@ -70,7 +70,7 @@ Glib::ustring ComboBox_Locale::get_selected_locale() const
void ComboBox_Locale::set_selected_locale(const Glib::ustring& locale)
{
//Look for the row with this text, and activate it:
- Glib::RefPtr<Gtk::TreeModel> model = get_model();
+ auto model = get_model();
if(model)
{
for(const auto& row : model->children())
diff --git a/glom/mode_design/translation/window_translations.cc
b/glom/mode_design/translation/window_translations.cc
index 365c4a2..aac7174 100644
--- a/glom/mode_design/translation/window_translations.cc
+++ b/glom/mode_design/translation/window_translations.cc
@@ -345,7 +345,7 @@ void Window_Translations::on_button_export()
file_dlg.set_do_overwrite_confirmation();
// Only po files
- Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
+ auto filter = Gtk::FileFilter::create();
filter->set_name(_("Po files"));
filter->add_pattern("*.po");
file_dlg.add_filter(filter);
@@ -384,7 +384,7 @@ void Window_Translations::on_button_import()
file_dlg.set_transient_for(*this);
// Only po files
- Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
+ auto filter = Gtk::FileFilter::create();
filter->set_name(_("Po files"));
filter->add_pattern("*.po");
file_dlg.add_filter(filter);
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index e5e4c81..7ea4cea 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -86,7 +86,7 @@ Dialog_GroupsList::Dialog_GroupsList(BaseObjectType* cobject, const Glib::RefPtr
sigc::mem_fun( *this, &Dialog_GroupsList::on_treeview_tables_toggled_delete) );
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_groups->get_selection();
+ auto refSelection = m_treeview_groups->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_GroupsList::on_treeview_groups_selection_changed) );
@@ -176,7 +176,7 @@ void Dialog_GroupsList::enable_buttons()
if(!m_button_group_users)
return;
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_groups->get_selection();
+ auto refSelection = m_treeview_groups->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -197,7 +197,7 @@ void Dialog_GroupsList::enable_buttons()
void Dialog_GroupsList::on_button_group_delete()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_groups->get_selection();
+ auto refTreeSelection = m_treeview_groups->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -267,7 +267,7 @@ void Dialog_GroupsList::on_button_group_users()
{
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_groups->get_selection();
+ auto refTreeSelection = m_treeview_groups->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -314,7 +314,7 @@ void Dialog_GroupsList::on_treeview_tables_selection_changed()
Glib::ustring Dialog_GroupsList::get_selected_group() const
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_groups->get_selection();
+ auto refSelection = m_treeview_groups->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -357,7 +357,7 @@ void Dialog_GroupsList::fill_group_list()
if(m_treeview_groups && m_treeview_groups->get_model()) //Avoid a warning.
{
//Select the first item, so that there is always something in the tables TreeView:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_groups->get_selection();
+ auto refSelection = m_treeview_groups->get_selection();
if(refSelection)
{
auto iterFirst = m_model_groups->children().begin();
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index d1aee1d..4b55b76 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -51,7 +51,7 @@ Dialog_UsersList::Dialog_UsersList(BaseObjectType* cobject, const Glib::RefPtr<G
builder->get_widget("treeview_users", m_treeview_users);
if(m_treeview_users)
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_users->get_selection();
+ auto refSelection = m_treeview_users->get_selection();
if(refSelection)
{
refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_UsersList::on_treeview_users_selection_changed) );
@@ -93,7 +93,7 @@ void Dialog_UsersList::enable_buttons()
return;
//Fields:
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_treeview_users->get_selection();
+ auto refSelection = m_treeview_users->get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -114,7 +114,7 @@ void Dialog_UsersList::enable_buttons()
void Dialog_UsersList::on_button_user_remove()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_users->get_selection();
+ auto refTreeSelection = m_treeview_users->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -141,7 +141,7 @@ void Dialog_UsersList::on_button_user_remove()
void Dialog_UsersList::on_button_user_delete()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_users->get_selection();
+ auto refTreeSelection = m_treeview_users->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
@@ -270,7 +270,7 @@ void Dialog_UsersList::on_button_user_new()
void Dialog_UsersList::on_button_user_edit()
{
//Get the selected item:
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview_users->get_selection();
+ auto refTreeSelection = m_treeview_users->get_selection();
if(refTreeSelection)
{
auto iter = refTreeSelection->get_selected();
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 69f6bff..8a821e9 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -154,7 +154,7 @@ bool Box_Tables::fill_from_database()
if(sharedconnection)
{
m_AddDel.remove_all();
- Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
+ auto connection = sharedconnection->get_gda_connection();
const auto vecTables = DbUtils::get_table_names_from_database();
@@ -373,7 +373,7 @@ void Box_Tables::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint co
if(is_default)
{
//Set all the other rows to false:
- Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
+ auto model = m_AddDel.get_model();
for(const auto& child_row : model->children())
{
m_AddDel.set_value(child_row, m_colDefault, false);
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index bb0cbc8..49fa28e 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -104,7 +104,7 @@ void CanvasLayoutItem::apply_formatting(const Glib::RefPtr<CanvasTextMovable>& c
void CanvasLayoutItem::on_resized()
{
- Glib::RefPtr<CanvasImageMovable> canvas_image =
Glib::RefPtr<CanvasImageMovable>::cast_dynamic(get_child());
+ auto canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(get_child());
if(canvas_image)
canvas_image->scale_to_size();
}
@@ -123,7 +123,7 @@ void CanvasLayoutItem::set_layout_item(const std::shared_ptr<LayoutItem>& layout
if(!m_layout_item)
std::cerr << G_STRFUNC << ": item was NULL." << std::endl;
- Glib::RefPtr<CanvasItemMovable> child_item = create_canvas_item_for_layout_item(m_layout_item);
+ auto child_item = create_canvas_item_for_layout_item(m_layout_item);
if(child_item)
{
@@ -146,7 +146,7 @@ void CanvasLayoutItem::set_layout_item(const std::shared_ptr<LayoutItem>& layout
//Scale images.
//This can only be done after setting the size:
- Glib::RefPtr<CanvasImageMovable> canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child_item);
+ auto canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child_item);
if(canvas_image)
{
canvas_image->scale_to_size();
@@ -160,7 +160,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
auto text = std::dynamic_pointer_cast<LayoutItem_Text>(layout_item);
if(text)
{
- Glib::RefPtr<CanvasTextMovable> canvas_item = CanvasTextMovable::create();
+ auto canvas_item = CanvasTextMovable::create();
canvas_item->property_line_width() = 0;
apply_formatting(canvas_item, text);
@@ -174,8 +174,8 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
auto image = std::dynamic_pointer_cast<LayoutItem_Image>(layout_item);
if(image)
{
- Glib::RefPtr<CanvasImageMovable> canvas_item = CanvasImageMovable::create();
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(image->m_image);
+ auto canvas_item = CanvasImageMovable::create();
+ auto pixbuf = UiUtils::get_pixbuf_for_gda_value(image->m_image);
if(pixbuf)
canvas_item->set_image(pixbuf);
else
@@ -198,7 +198,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
double end_y = 0;
line->get_coordinates(start_x, start_y, end_x, end_y);
- Glib::RefPtr<CanvasLineMovable> canvas_item = CanvasLineMovable::create();
+ auto canvas_item = CanvasLineMovable::create();
canvas_item->property_line_width() = line->get_line_width();
canvas_item->property_stroke_color() = line->get_line_color();
@@ -217,7 +217,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
//Create an appropriate canvas item for the field type:
if(field->get_glom_type() == Field::glom_field_type::IMAGE)
{
- Glib::RefPtr<CanvasImageMovable> canvas_item = CanvasImageMovable::create();
+ auto canvas_item = CanvasImageMovable::create();
canvas_item->set_image_empty();
child = canvas_item;
@@ -225,7 +225,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
}
else //text, numbers, date, time, boolean:
{
- Glib::RefPtr<CanvasTextMovable> canvas_item = CanvasTextMovable::create();
+ auto canvas_item = CanvasTextMovable::create();
canvas_item->property_line_width() = 0;
apply_formatting(canvas_item, field);
@@ -244,7 +244,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
auto portal = std::dynamic_pointer_cast<LayoutItem_Portal>(layout_item);
if(portal)
{
- Glib::RefPtr<CanvasTableMovable> canvas_item = CanvasTableMovable::create();
+ auto canvas_item = CanvasTableMovable::create();
canvas_item->set_lines_details(
portal->get_print_layout_row_line_width(),
@@ -286,7 +286,7 @@ Glib::RefPtr<Goocanvas::Item> CanvasLayoutItem::get_canvas_table_cell_child(cons
const auto count = table->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = table->get_child(i);
+ auto child = table->get_child(i);
if(!child)
continue;
@@ -308,8 +308,8 @@ Glib::RefPtr<Goocanvas::Item> CanvasLayoutItem::get_canvas_table_cell_child(cons
void CanvasLayoutItem::add_portal_rows_if_necessary(guint rows_count)
{
- Glib::RefPtr<CanvasItemMovable> child = get_child();
- Glib::RefPtr<CanvasTableMovable> canvas_table =
+ auto child = get_child();
+ auto canvas_table =
Glib::RefPtr<CanvasTableMovable>::cast_dynamic(child);
if(!canvas_table)
return;
@@ -340,7 +340,7 @@ void CanvasLayoutItem::add_portal_rows_if_necessary(const Glib::RefPtr<CanvasTab
//std::cout << " row=" << row << ", col=" << col << std::endl;
//Check if a child already exists:
- Glib::RefPtr<Goocanvas::Item> existing_child =
+ auto existing_child =
get_canvas_table_cell_child(canvas_table, row, col);
if(existing_child)
{
@@ -353,8 +353,8 @@ void CanvasLayoutItem::add_portal_rows_if_necessary(const Glib::RefPtr<CanvasTab
//creating another CanvasLayoutItem, because that would be a group,
//but goocanvas cannot yet support Groups inside Tables. murrayc.
//TODO: Bug number.
- Glib::RefPtr<CanvasItemMovable> cell = create_canvas_item_for_layout_item(layout_item);
- Glib::RefPtr<Goocanvas::Item> cell_as_item = CanvasItemMovable::cast_to_item(cell);
+ auto cell = create_canvas_item_for_layout_item(layout_item);
+ auto cell_as_item = CanvasItemMovable::cast_to_item(cell);
if(cell && cell_as_item)
{
@@ -395,7 +395,7 @@ void CanvasLayoutItem::add_portal_rows_if_necessary(const Glib::RefPtr<CanvasTab
(Gtk::FILL), (Gtk::AttachOptions)(Gtk::FILL | Gtk::EXPAND));
//Add a second item (an invisible rect) to make sure that the size is really used:
- Glib::RefPtr<Goocanvas::Rect> rect =
+ auto rect =
Goocanvas::Rect::create(0, 0, width, row_height);
//TODO: Find out why this doesn't work: rect->property_stroke_pattern() =
Cairo::RefPtr<Cairo::Pattern>();
g_object_set(rect->gobj(), "stroke-pattern", (void*)0, (void*)0);
@@ -418,7 +418,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
if(!field)
return;
- Glib::RefPtr<CanvasItemMovable> child = get_child();
+ auto child = get_child();
if(!child)
return;
@@ -431,7 +431,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
case(Field::glom_field_type::TIME):
case(Field::glom_field_type::DATE):
{
- Glib::RefPtr<CanvasTextMovable> canvas_item = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(child);
+ auto canvas_item = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(child);
if(!canvas_item)
return;
@@ -450,7 +450,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
}
case(Field::glom_field_type::IMAGE):
{
- Glib::RefPtr<CanvasImageMovable> canvas_item = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child);
+ auto canvas_item = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child);
if(!canvas_item)
return;
@@ -460,7 +460,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
double height = 0;
canvas_item->get_width_height(width, height);
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
+ auto pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
if(pixbuf)
canvas_item->set_image(pixbuf);
else
@@ -476,8 +476,8 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
void CanvasLayoutItem::remove_empty_indicators()
{
- Glib::RefPtr<CanvasItemMovable> child = get_child();
- Glib::RefPtr<CanvasImageMovable> canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child);
+ auto child = get_child();
+ auto canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child);
if(canvas_image)
{
//Clear the no-image pixbuf from images:
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 9708730..c2df05e 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -59,11 +59,11 @@ Canvas_PrintLayout::Canvas_PrintLayout()
m_items_group = Goocanvas::Group::create();
//m_items_group->signal_button_press_event().connect( sigc::ptr_fun(&on_group_button_press_event), false );
//TODO: How does this have any effect?: m_items_group->property_pointer_events() = Goocanvas::EVENTS_NONE;
- Glib::RefPtr<Goocanvas::Item> root = get_root_item();
+ auto root = get_root_item();
if(root)
root->add_child(m_items_group);
- Glib::RefPtr<Gtk::PageSetup> page_setup = Gtk::PageSetup::create(); //start with something sensible.
+ auto page_setup = Gtk::PageSetup::create(); //start with something sensible.
set_page_setup(page_setup);
}
@@ -84,7 +84,7 @@ void Canvas_PrintLayout::set_print_layout(const Glib::ustring& table_name, const
//TODO: Catch an exception
key_file.load_from_data(key_file_text);
- Glib::RefPtr<Gtk::PageSetup> page_setup =
+ auto page_setup =
Gtk::PageSetup::create_from_key_file(key_file);
set_page_setup(page_setup);
}
@@ -141,7 +141,7 @@ std::shared_ptr<PrintLayout> Canvas_PrintLayout::get_print_layout()
/*
Glib::RefPtr<CanvasLayoutItem> Canvas_PrintLayout::create_canvas_item(const std::shared_ptr<LayoutItem>&
item)
{
- Glib::RefPtr<CanvasLayoutItem> result = CanvasLayoutItem::create();
+ auto result = CanvasLayoutItem::create();
//TODO: Add to the canvas.
result->set_layout_item(item);
@@ -173,7 +173,7 @@ void Canvas_PrintLayout::add_layout_group_children(const std::shared_ptr<LayoutG
void Canvas_PrintLayout::create_canvas_layout_item_and_add(const std::shared_ptr<LayoutItem>& layout_item)
{
- Glib::RefPtr<CanvasLayoutItem> canvas_item = CanvasLayoutItem::create();
+ auto canvas_item = CanvasLayoutItem::create();
add_canvas_layout_item(canvas_item);
canvas_item->set_layout_item(layout_item);
@@ -233,8 +233,8 @@ void Canvas_PrintLayout::fill_layout_group(const std::shared_ptr<LayoutGroup>& g
const int count = m_items_group->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> base_canvas_item = m_items_group->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> canvas_item =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
+ auto base_canvas_item = m_items_group->get_child(i);
+ auto canvas_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
if(canvas_item)
{
//Get the actual position:
@@ -264,7 +264,7 @@ void Canvas_PrintLayout::setup_context_menu()
m_context_menu_action_group = Gio::SimpleActionGroup::create();
/*
- Glib::RefPtr<Gtk::Action> action = Gtk::Action::create("ContextInsertField", _("Field"));
+ auto action = Gtk::Action::create("ContextInsertField", _("Field"));
m_context_menu_action_group->add(action,
sigc::mem_fun(*this, &Canvas_PrintLayout::on_context_menu_insert_field) );
@@ -282,7 +282,7 @@ void Canvas_PrintLayout::setup_context_menu()
insert_action_group("context", m_context_menu_action_group);
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Edit"), "context.edit");
menu->append(_("_Formatting"), "context.formatting");
menu->append(_("_Delete"), "context.delete");
@@ -543,7 +543,7 @@ void Canvas_PrintLayout::on_dialog_format_hide()
Glib::RefPtr<Goocanvas::Polyline> Canvas_PrintLayout::create_margin_line(double x1, double y1, double x2,
double y2)
{
- Glib::RefPtr<Goocanvas::Polyline> line =
+ auto line =
Goocanvas::Polyline::create(x1, y1, x2, y2);
line->property_line_width() = 0.5;
line->property_stroke_color() = "light gray";
@@ -594,7 +594,7 @@ void Canvas_PrintLayout::update_page_bounds()
m_bounds_group.reset();
}
- Glib::RefPtr<Goocanvas::Item> root = get_root_item();
+ auto root = get_root_item();
m_bounds_group = Goocanvas::Group::create();
root->add_child(m_bounds_group);
@@ -619,13 +619,13 @@ void Canvas_PrintLayout::update_page_bounds()
for(guint page = 0; page < m_page_count; ++page)
{
const double top_y = paper_size.get_height(units) * page + m_page_setup->get_top_margin(units);
- Glib::RefPtr<Goocanvas::Polyline> margin_top =
+ auto margin_top =
create_margin_line(
bounds.get_x1(), top_y, bounds.get_x2(), top_y);
m_vec_margin_tops.push_back(margin_top);
const double bottom_y = paper_size.get_height(units) * (page + 1) -
m_page_setup->get_bottom_margin(units);
- Glib::RefPtr<Goocanvas::Polyline> margin_bottom =
+ auto margin_bottom =
create_margin_line(
bounds.get_x1(), bottom_y, bounds.get_x2(), bottom_y);
m_vec_margin_bottoms.push_back(margin_bottom);
@@ -749,8 +749,8 @@ void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& ca
guint field_i = 0;
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> base_canvas_item = canvas_group->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> canvas_item =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
+ auto base_canvas_item = canvas_group->get_child(i);
+ auto canvas_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
if(!canvas_item)
continue;
@@ -824,8 +824,8 @@ void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& ca
//(and clear the no-image pixbuf from images):
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> base_canvas_item = canvas_group->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> canvas_item =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
+ auto base_canvas_item = canvas_group->get_child(i);
+ auto canvas_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(base_canvas_item);
if(!canvas_item)
continue;
@@ -885,7 +885,7 @@ void Canvas_PrintLayout::fill_with_data_portal(const Glib::RefPtr<CanvasLayoutIt
if(!portal)
return;
- Glib::RefPtr<CanvasTableMovable> canvas_table =
Glib::RefPtr<CanvasTableMovable>::cast_dynamic(canvas_item->get_child());
+ auto canvas_table = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(canvas_item->get_child());
if(!canvas_table)
return;
@@ -950,7 +950,7 @@ void Canvas_PrintLayout::fill_with_data_portal(const Glib::RefPtr<CanvasLayoutIt
for(int col = 0; col < cols_count; ++col)
{
//Glib::RefPtr<Goocanvas::Item> canvas_child = base_item->get_cell_child(row, col); //TODO: Add this
to Goocanvas::Table.
- Glib::RefPtr<Goocanvas::Item> canvas_child =
+ auto canvas_child =
CanvasLayoutItem::get_canvas_table_cell_child(canvas_table, row, col); //TODO: Add this to
Goocanvas::Table.
if(!canvas_child)
{
@@ -989,16 +989,16 @@ void Canvas_PrintLayout::set_canvas_item_field_value(const Glib::RefPtr<Goocanva
//Expect the appropriate canvas item, depending on the field type:
if(field->get_glom_type() == Field::glom_field_type::IMAGE)
{
- Glib::RefPtr<CanvasImageMovable> canvas_image =
Glib::RefPtr<CanvasImageMovable>::cast_dynamic(canvas_item);
+ auto canvas_image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(canvas_item);
if(!canvas_image)
return;
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
+ auto pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
canvas_image->property_pixbuf() = pixbuf;
}
else //text, numbers, date, time, boolean:
{
- Glib::RefPtr<CanvasTextMovable> canvas_text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(canvas_item);
+ auto canvas_text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(canvas_item);
if(!canvas_text)
{
std::cerr << G_STRFUNC << ": The canvas item is not of the expected type. Instead it is of type." <<
std::endl;
@@ -1096,15 +1096,15 @@ Canvas_PrintLayout::type_vec_items Canvas_PrintLayout::get_selected_items()
type_vec_items result;
//TODO: Do this recursively.
- Glib::RefPtr<Goocanvas::Item> root = m_items_group;
+ auto root = m_items_group;
if(!root)
return result;
const int count = root->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = root->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> derived =
+ auto child = root->get_child(i);
+ auto derived =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(child);
if(!derived)
continue;
@@ -1122,15 +1122,15 @@ void Canvas_PrintLayout::set_outlines_visibility(bool visible)
m_outline_visibility = visible;
//TODO: Do this recursively.
- Glib::RefPtr<Goocanvas::Item> root = m_items_group;
+ auto root = m_items_group;
if(!root)
return;
const int count = root->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = root->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> derived =
+ auto child = root->get_child(i);
+ auto derived =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(child);
if(!derived)
continue;
@@ -1141,15 +1141,15 @@ void Canvas_PrintLayout::set_outlines_visibility(bool visible)
void Canvas_PrintLayout::select_all(bool selected)
{
- Glib::RefPtr<Goocanvas::Item> root = m_items_group;
+ auto root = m_items_group;
if(!root)
return;
const int count = root->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = root->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> derived =
+ auto child = root->get_child(i);
+ auto derived =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(child);
if(!derived)
continue;
@@ -1198,7 +1198,7 @@ Glib::RefPtr<CanvasLayoutItem> Canvas_PrintLayout::move_items_down(double y_star
double y_needs_moving_top = 0;
double needs_moving_top_height = 0;
- Glib::RefPtr<Goocanvas::Item> root = m_items_group;
+ auto root = m_items_group;
if(!root)
return needs_moving_top;
@@ -1209,8 +1209,8 @@ Glib::RefPtr<CanvasLayoutItem> Canvas_PrintLayout::move_items_down(double y_star
const int count = root->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = root->get_child(i);
- Glib::RefPtr<CanvasLayoutItem> derived =
+ auto child = root->get_child(i);
+ auto derived =
Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(child);
if(!derived)
{
diff --git a/glom/print_layout/print_layout_utils.cc b/glom/print_layout/print_layout_utils.cc
index 69cc6f0..3f2c46f 100644
--- a/glom/print_layout/print_layout_utils.cc
+++ b/glom/print_layout/print_layout_utils.cc
@@ -400,7 +400,7 @@ void do_print_layout(const std::shared_ptr<const PrintLayout>& print_layout, con
//Create a new PrintOperation with our PageSetup and PrintSettings:
//(We use our derived PrintOperation class)
- Glib::RefPtr<PrintOperationPrintLayout> print = PrintOperationPrintLayout::create();
+ auto print = PrintOperationPrintLayout::create();
print->set_canvas(&canvas);
print->set_track_print_status();
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index dbb96ad..f4b3fe9 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -161,7 +161,7 @@ void AddDel::warn_about_duplicate()
void
AddDel::on_MenuPopup_activate_Edit()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -207,7 +207,7 @@ void AddDel::on_MenuPopup_activate_Delete()
{
finish_editing();
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(refSelection)
{
auto iter = refSelection->get_selected();
@@ -237,7 +237,7 @@ void AddDel::setup_menu(Gtk::Widget* /* widget */)
//TODO: add_accel_group(builder->get_accel_group());
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Edit"), "context.edit");
menu->append(_("_Delete"), "context.delete");
@@ -378,7 +378,7 @@ Glib::ustring AddDel::get_value_selected(guint col)
Gtk::TreeModel::iterator AddDel::get_item_selected()
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
return refTreeSelection->get_selected();
@@ -419,7 +419,7 @@ bool AddDel::select_item(const Gtk::TreeModel::iterator& iter, guint column, boo
if(iter)
{
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
refTreeSelection->select(iter);
@@ -1219,7 +1219,7 @@ void AddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const Gli
{
//Reactivate the cell so that the data can be corrected.
- Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
+ auto refTreeSelection = m_TreeView.get_selection();
if(refTreeSelection)
{
refTreeSelection->select(row); //TODO: This does not seem to work.
diff --git a/glom/utility_widgets/adddel/adddel_withbuttons.cc
b/glom/utility_widgets/adddel/adddel_withbuttons.cc
index 276e267..981bcf8 100644
--- a/glom/utility_widgets/adddel/adddel_withbuttons.cc
+++ b/glom/utility_widgets/adddel/adddel_withbuttons.cc
@@ -97,7 +97,7 @@ void AddDel_WithButtons::on_button_edit()
void AddDel_WithButtons::on_button_extra()
{
- Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
+ auto refSelection = m_TreeView.get_selection();
if(!refSelection)
return;
diff --git a/glom/utility_widgets/canvas/canvas_editable.cc b/glom/utility_widgets/canvas/canvas_editable.cc
index 26bc416..8e85134 100644
--- a/glom/utility_widgets/canvas/canvas_editable.cc
+++ b/glom/utility_widgets/canvas/canvas_editable.cc
@@ -37,8 +37,8 @@ CanvasEditable::CanvasEditable()
void CanvasEditable::add_item(const Glib::RefPtr<Goocanvas::Item>& item, bool resizable)
{
- Glib::RefPtr<Goocanvas::Item> root = get_root_item();
- Glib::RefPtr<Goocanvas::Group> root_group = Glib::RefPtr<Goocanvas::Group>::cast_dynamic(root);
+ auto root = get_root_item();
+ auto root_group = Glib::RefPtr<Goocanvas::Group>::cast_dynamic(root);
if(!root_group)
return;
@@ -55,10 +55,10 @@ void CanvasEditable::add_item(const Glib::RefPtr<Goocanvas::Item>& item, const G
//Add it inside a manipulatable group, if requested:
if(resizable)
{
- Glib::RefPtr<CanvasItemMovable> movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(item);
+ auto movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(item);
if(movable)
{
- Glib::RefPtr<CanvasGroupResizable> resizable_item = CanvasGroupResizable::create();
+ auto resizable_item = CanvasGroupResizable::create();
resizable_item->set_grid(m_grid);
//Specify the resizable's position, using the child's position:
@@ -83,7 +83,7 @@ void CanvasEditable::add_item(const Glib::RefPtr<Goocanvas::Item>& item, const G
group->add_child(item);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(item);
+ auto movable = CanvasItemMovable::cast_to_movable(item);
if(movable)
{
movable->set_grid(m_grid);
@@ -102,7 +102,7 @@ void CanvasEditable::remove_item(const Glib::RefPtr<Goocanvas::Item>& item , con
//TODO: Remove resizable=true items via their parent item.
item->remove();
- Glib::RefPtr<CanvasItemMovable> movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(item);
+ auto movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(item);
if(movable && movable->get_selected())
m_signal_selection_changed.emit();
}
@@ -111,8 +111,8 @@ void CanvasEditable::remove_all_items()
{
const auto some_selected = !(get_selected_items().empty());
- Glib::RefPtr<Goocanvas::Item> root = get_root_item();
- Glib::RefPtr<Goocanvas::Group> root_group = Glib::RefPtr<Goocanvas::Group>::cast_dynamic(root);
+ auto root = get_root_item();
+ auto root_group = Glib::RefPtr<Goocanvas::Group>::cast_dynamic(root);
while(root_group && root_group->get_n_children())
root_group->remove_child(0);
@@ -177,7 +177,7 @@ void CanvasEditable::remove_grid()
void CanvasEditable::associate_with_grid(const Glib::RefPtr<Goocanvas::Item>& item)
{
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(item);
+ auto movable = CanvasItemMovable::cast_to_movable(item);
if(movable)
movable->set_grid(m_grid);
}
diff --git a/glom/utility_widgets/canvas/canvas_group_grid.cc
b/glom/utility_widgets/canvas/canvas_group_grid.cc
index f92318c..69a0706 100644
--- a/glom/utility_widgets/canvas/canvas_group_grid.cc
+++ b/glom/utility_widgets/canvas/canvas_group_grid.cc
@@ -180,7 +180,7 @@ Glib::RefPtr<CanvasLineMovable> CanvasGroupGrid::create_rule_line(double pos, bo
if(canvas)
canvas->get_bounds(left, top, right, bottom);
- Glib::RefPtr<CanvasLineMovable> line = CanvasLineMovable::create();
+ auto line = CanvasLineMovable::create();
if(horizontal)
{
@@ -209,14 +209,14 @@ Glib::RefPtr<CanvasLineMovable> CanvasGroupGrid::create_rule_line(double pos, bo
void CanvasGroupGrid::add_vertical_rule(double x)
{
- Glib::RefPtr<CanvasLineMovable> line = create_rule_line(x, false);
+ auto line = create_rule_line(x, false);
m_rules_x.push_back(line);
m_grid_rules_group->add_child(line);
}
void CanvasGroupGrid::add_horizontal_rule(double y)
{
- Glib::RefPtr<CanvasLineMovable> line = create_rule_line(y, true);
+ auto line = create_rule_line(y, true);
m_rules_y.push_back(line);
m_grid_rules_group->add_child(line);
}
diff --git a/glom/utility_widgets/canvas/canvas_group_movable.cc
b/glom/utility_widgets/canvas/canvas_group_movable.cc
index 1997ed5..857eb84 100644
--- a/glom/utility_widgets/canvas/canvas_group_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_movable.cc
@@ -81,8 +81,8 @@ void CanvasGroupMovable::set_xy(double x, double y)
const auto count = get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = get_child(i);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(child);
+ auto child = get_child(i);
+ auto movable = CanvasItemMovable::cast_to_movable(child);
if(movable)
{
double this_x = 0;
@@ -125,11 +125,11 @@ void CanvasGroupMovable::set_width_height(double width, double height)
m_width = width;
m_height = height;
- Glib::RefPtr<Goocanvas::Item> first_child = get_child(0);
+ auto first_child = get_child(0);
if(!first_child)
return;
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(first_child);
+ auto movable = CanvasItemMovable::cast_to_movable(first_child);
if(movable)
movable->set_width_height(width, height);
}
@@ -145,8 +145,8 @@ void CanvasGroupMovable::set_grid(const Glib::RefPtr<const CanvasGroupGrid>& gri
const auto count = get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = get_child(i);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(child);
+ auto child = get_child(i);
+ auto movable = CanvasItemMovable::cast_to_movable(child);
if(movable)
{
movable->set_grid(grid);
diff --git a/glom/utility_widgets/canvas/canvas_group_resizable.cc
b/glom/utility_widgets/canvas/canvas_group_resizable.cc
index 0466e25..e5985a4 100644
--- a/glom/utility_widgets/canvas/canvas_group_resizable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_resizable.cc
@@ -174,7 +174,7 @@ void CanvasGroupResizable::create_line_manipulators()
Glib::RefPtr<CanvasLineMovable> CanvasGroupResizable::create_outline_line(double x1, double y1, double x2,
double y2)
{
- Glib::RefPtr<CanvasLineMovable> line = Glom::CanvasLineMovable::create();
+ auto line = Glom::CanvasLineMovable::create();
line->property_line_width() = OUTLINE_STROKE_WIDTH;
line->property_stroke_color() = OUTLINE_STROKE_COLOR;
line->set_movement_allowed(false, false);
@@ -273,7 +273,7 @@ void CanvasGroupResizable::position_rect_manipulators()
const double x2 = child_x + child_width;
const double y2 = child_y + child_height;
- Glib::RefPtr<Goocanvas::Item> item = CanvasItemMovable::cast_to_item(m_child);
+ auto item = CanvasItemMovable::cast_to_item(m_child);
m_manipulator_corner_top_left->set_xy(x1, y1);
m_manipulator_corner_top_right->set_xy(x2 - MANIPULATOR_CORNER_SIZE, y1);
@@ -301,7 +301,7 @@ void CanvasGroupResizable::position_rect_manipulators()
void CanvasGroupResizable::position_line_manipulators()
{
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
if(!line)
return;
@@ -347,7 +347,7 @@ void CanvasGroupResizable::position_outline()
const double x2 = x1 + child_width;
const double y2 = y1 + child_height;
- Glib::RefPtr<Goocanvas::Item> item = CanvasItemMovable::cast_to_item(m_child);
+ auto item = CanvasItemMovable::cast_to_item(m_child);
set_edge_points(m_outline_top, x1, y1, x2, y1);
set_edge_points(m_outline_bottom, x1, y2, x2, y2);
@@ -376,7 +376,7 @@ void CanvasGroupResizable::set_child(const Glib::RefPtr<CanvasItemMovable>& chil
//Remove the previous child, if any:
if(m_child)
{
- Glib::RefPtr<Goocanvas::Item> item = CanvasItemMovable::cast_to_item(m_child);
+ auto item = CanvasItemMovable::cast_to_item(m_child);
item->remove();
}
@@ -384,7 +384,7 @@ void CanvasGroupResizable::set_child(const Glib::RefPtr<CanvasItemMovable>& chil
if(!child)
return;
- Glib::RefPtr<Goocanvas::Item> item = CanvasItemMovable::cast_to_item(child);
+ auto item = CanvasItemMovable::cast_to_item(child);
if(!item)
return;
@@ -443,7 +443,7 @@ void CanvasGroupResizable::manipulator_connect_signals(const Glib::RefPtr<Goocan
//TODO: Use x and y property notification.
- Glib::RefPtr<CanvasRectMovable> rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator);
+ auto rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator);
if(rect)
{
if(get_is_line())
@@ -459,7 +459,7 @@ void CanvasGroupResizable::manipulator_connect_signals(const Glib::RefPtr<Goocan
}
else
{
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(manipulator);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(manipulator);
if(line)
{
line->signal_moved().connect(
@@ -528,8 +528,8 @@ void CanvasGroupResizable::on_manipulator_corner_moved(const Glib::RefPtr<Canvas
//(if the user moves too fast then we get a leave-notify-event on the manipulator, rect, or item):
set_manipulators_visibility(Goocanvas::ITEM_VISIBLE);
- Glib::RefPtr<CanvasItemMovable> manipulator_base = get_manipulator(manipulator_id);
- Glib::RefPtr<CanvasRectMovable> manipulator =
Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator_base);
+ auto manipulator_base = get_manipulator(manipulator_id);
+ auto manipulator = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator_base);
if(!manipulator)
return;
@@ -601,14 +601,14 @@ void CanvasGroupResizable::on_manipulator_line_end_moved(const Glib::RefPtr<Canv
//(if the user moves too fast then we get a leave-notify-event on the manipulator, rect, or item):
set_manipulators_visibility(Goocanvas::ITEM_VISIBLE);
- Glib::RefPtr<CanvasItemMovable> manipulator_base = get_manipulator(manipulator_id);
- Glib::RefPtr<CanvasRectMovable> manipulator =
Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator_base);
+ auto manipulator_base = get_manipulator(manipulator_id);
+ auto manipulator = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(manipulator_base);
if(!manipulator)
return;
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
if(!line)
return;
@@ -651,8 +651,8 @@ void CanvasGroupResizable::on_manipulator_edge_moved(const Glib::RefPtr<CanvasIt
//(if the user moves too fast then we get a leave-notify-event on the manipulator, rect, or item):
set_manipulators_visibility(Goocanvas::ITEM_VISIBLE);
- Glib::RefPtr<CanvasItemMovable> manipulator_base = get_manipulator(manipulator_id);
- Glib::RefPtr<CanvasLineMovable> manipulator =
Glib::RefPtr<CanvasLineMovable>::cast_dynamic(manipulator_base);
+ auto manipulator_base = get_manipulator(manipulator_id);
+ auto manipulator = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(manipulator_base);
//std::cout << "debug: " << G_STRFUNC << ": manipulator=" << manipulator_id << std::endl;
@@ -777,7 +777,7 @@ void CanvasGroupResizable::set_manipulators_visibility(Goocanvas::ItemVisibility
//Also show grid lines in the portal table,
//though these are not actually manipulatable.
- Glib::RefPtr<CanvasTableMovable> table =
+ auto table =
Glib::RefPtr<CanvasTableMovable>::cast_dynamic(get_child());
if(table)
{
@@ -835,7 +835,7 @@ bool CanvasGroupResizable::on_resizer_leave_notify_event(const Glib::RefPtr<Gooc
Glib::RefPtr<CanvasRectMovable> CanvasGroupResizable::create_corner_manipulator()
{
- Glib::RefPtr<CanvasRectMovable> result = CanvasRectMovable::create();
+ auto result = CanvasRectMovable::create();
result->property_fill_color() = MANIPULATOR_CORNER_FILL_COLOR; //This makes the whole area clickable, not
just the outline stroke:
result->property_line_width() = MANIPULATOR_STROKE_WIDTH;
result->property_stroke_color() = MANIPULATOR_STROKE_COLOR;
@@ -847,7 +847,7 @@ Glib::RefPtr<CanvasRectMovable> CanvasGroupResizable::create_corner_manipulator(
Glib::RefPtr<CanvasLineMovable> CanvasGroupResizable::create_edge_manipulator()
{
- Glib::RefPtr<Glom::CanvasLineMovable> line = Glom::CanvasLineMovable::create();
+ auto line = Glom::CanvasLineMovable::create();
line->property_line_width() = MANIPULATOR_STROKE_WIDTH;
line->property_stroke_color() = MANIPULATOR_STROKE_COLOR;
return line;
@@ -998,7 +998,7 @@ Goocanvas::Canvas* CanvasGroupResizable::get_parent_canvas_widget()
bool CanvasGroupResizable::get_is_line() const
{
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
return line;
}
@@ -1019,8 +1019,8 @@ void CanvasGroupResizable::set_grid(const Glib::RefPtr<const CanvasGroupGrid>& g
int count = m_group_edge_manipulators->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = m_group_edge_manipulators->get_child(i);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(child);
+ auto child = m_group_edge_manipulators->get_child(i);
+ auto movable = CanvasItemMovable::cast_to_movable(child);
if(movable)
{
movable->set_grid(grid);
@@ -1030,8 +1030,8 @@ void CanvasGroupResizable::set_grid(const Glib::RefPtr<const CanvasGroupGrid>& g
count = m_group_corner_manipulators->get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = m_group_corner_manipulators->get_child(i);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(child);
+ auto child = m_group_corner_manipulators->get_child(i);
+ auto movable = CanvasItemMovable::cast_to_movable(child);
if(movable)
{
movable->set_grid(grid);
diff --git a/glom/utility_widgets/canvas/canvas_image_movable.cc
b/glom/utility_widgets/canvas/canvas_image_movable.cc
index 2c5f849..b9078d5 100644
--- a/glom/utility_widgets/canvas/canvas_image_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_image_movable.cc
@@ -182,7 +182,7 @@ void CanvasImageMovable::scale_to_size()
if(width_pixels && height_pixels)
{
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::image_scale_keeping_ratio(m_pixbuf, (int)height_pixels,
(int)width_pixels);
+ auto pixbuf = UiUtils::image_scale_keeping_ratio(m_pixbuf, (int)height_pixels, (int)width_pixels);
property_pixbuf() = pixbuf;
}
@@ -208,7 +208,7 @@ void CanvasImageMovable::set_image_empty()
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
if(widget)
{
- Glib::RefPtr<Gtk::IconTheme> theme = Gtk::IconTheme::get_default();
+ auto theme = Gtk::IconTheme::get_default();
try
{
diff --git a/glom/utility_widgets/canvas/canvas_item_movable.cc
b/glom/utility_widgets/canvas/canvas_item_movable.cc
index 07d5feb..b1bfb22 100644
--- a/glom/utility_widgets/canvas/canvas_item_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_item_movable.cc
@@ -36,8 +36,8 @@ namespace {
static Glib::RefPtr<Gdk::Cursor> create_drag_cursor(GdkEventAny* event, Gdk::CursorType cursor_type)
{
- Glib::RefPtr<Gdk::Window> window = Glib::wrap(event->window, true);
- Glib::RefPtr<Gdk::Display> display = window->get_display();
+ auto window = Glib::wrap(event->window, true);
+ auto display = window->get_display();
return Gdk::Cursor::create(display, cursor_type);
}
@@ -82,7 +82,7 @@ bool CanvasItemMovable::on_button_press_event(const Glib::RefPtr<Goocanvas::Item
if(!m_allow_vertical_movement && !m_allow_horizontal_movement)
return false; // Not handled. Let it be handled by an item lower in the z order, or a parent group,
if any.
- Glib::RefPtr<Goocanvas::Item> item = target;
+ auto item = target;
m_drag_start_cursor_x = event->x;
m_drag_start_cursor_y = event->y;
@@ -127,7 +127,7 @@ bool CanvasItemMovable::on_motion_notify_event(const Glib::RefPtr<Goocanvas::Ite
if(!m_allow_vertical_movement && !m_allow_horizontal_movement)
return false; // Not handled. Let it be handled by an item lower in the z order, or a parent group, if
any.
- Glib::RefPtr<Goocanvas::Item> item = target;
+ auto item = target;
if(item && m_dragging && (event->state & Gdk::BUTTON1_MASK))
{
@@ -283,7 +283,7 @@ void CanvasItemMovable::set_cursor(const Glib::RefPtr<Gdk::Cursor>& cursor)
if(!canvas)
return;
- Glib::RefPtr<Gdk::Window> window = canvas->get_window();
+ auto window = canvas->get_window();
if(window)
window->set_cursor(cursor);
}
@@ -293,7 +293,7 @@ void CanvasItemMovable::unset_cursor()
auto canvas = get_parent_canvas_widget();
if(canvas)
{
- Glib::RefPtr<Gdk::Window> window = canvas->get_window();
+ auto window = canvas->get_window();
if(window)
window->set_cursor();
}
@@ -332,37 +332,37 @@ Glib::RefPtr<CanvasItemMovable> CanvasItemMovable::cast_to_movable(const Glib::R
//We can't cast directly to CanvasItemMovable because each class derives from it separately,
//instead of it being a base class of Goocanvas::Item (the common base class):
- Glib::RefPtr<CanvasRectMovable> rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(item);
+ auto rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(item);
if(rect)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(rect);
else
{
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(item);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(item);
if(line)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(line);
else
{
- Glib::RefPtr<CanvasTextMovable> text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(item);
+ auto text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(item);
if(text)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(text);
else
{
- Glib::RefPtr<CanvasImageMovable> image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(item);
+ auto image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(item);
if(image)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(image);
else
{
- Glib::RefPtr<CanvasGroupMovable> group = Glib::RefPtr<CanvasGroupMovable>::cast_dynamic(item);
+ auto group = Glib::RefPtr<CanvasGroupMovable>::cast_dynamic(item);
if(group)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(group);
else
{
- Glib::RefPtr<CanvasTableMovable> table = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(item);
+ auto table = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(item);
if(table)
movable = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(table);
else
{
- Glib::RefPtr<CanvasGroupResizable> group_resizable =
Glib::RefPtr<CanvasGroupResizable>::cast_dynamic(item);
+ auto group_resizable = Glib::RefPtr<CanvasGroupResizable>::cast_dynamic(item);
if(group_resizable)
movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(group_resizable);
}
@@ -381,7 +381,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasItemMovable::cast_to_movable(const Glib::R
//static:
Glib::RefPtr<const CanvasItemMovable> CanvasItemMovable::cast_const_to_movable(const Glib::RefPtr<const
Goocanvas::Item>& item)
{
- Glib::RefPtr<Goocanvas::Item> unconst = Glib::RefPtr<Goocanvas::Item>::cast_const(item);
+ auto unconst = Glib::RefPtr<Goocanvas::Item>::cast_const(item);
return cast_to_movable(unconst);
}
@@ -394,37 +394,37 @@ Glib::RefPtr<Goocanvas::Item> CanvasItemMovable::cast_to_item(const Glib::RefPtr
return result;
//We can't cast directly to Item because each class derives from it separately.
- Glib::RefPtr<CanvasRectMovable> rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(item);
+ auto rect = Glib::RefPtr<CanvasRectMovable>::cast_dynamic(item);
if(rect)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(rect);
else
{
- Glib::RefPtr<CanvasLineMovable> line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(item);
+ auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(item);
if(line)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(line);
else
{
- Glib::RefPtr<CanvasTextMovable> text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(item);
+ auto text = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(item);
if(text)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(text);
else
{
- Glib::RefPtr<CanvasImageMovable> image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(item);
+ auto image = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(item);
if(image)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(image);
else
{
- Glib::RefPtr<CanvasGroupMovable> group = Glib::RefPtr<CanvasGroupMovable>::cast_dynamic(item);
+ auto group = Glib::RefPtr<CanvasGroupMovable>::cast_dynamic(item);
if(group)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(group);
else
{
- Glib::RefPtr<CanvasTableMovable> table = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(item);
+ auto table = Glib::RefPtr<CanvasTableMovable>::cast_dynamic(item);
if(table)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(table);
else
{
- Glib::RefPtr<CanvasGroupResizable> group_resizable =
Glib::RefPtr<CanvasGroupResizable>::cast_dynamic(item);
+ auto group_resizable = Glib::RefPtr<CanvasGroupResizable>::cast_dynamic(item);
if(group_resizable)
result = Glib::RefPtr<Goocanvas::Item>::cast_dynamic(group_resizable);
}
diff --git a/glom/utility_widgets/canvas/canvas_table_movable.cc
b/glom/utility_widgets/canvas/canvas_table_movable.cc
index 120d28e..fea7836 100644
--- a/glom/utility_widgets/canvas/canvas_table_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_table_movable.cc
@@ -90,8 +90,8 @@ void CanvasTableMovable::set_grid(const Glib::RefPtr<const CanvasGroupGrid>& gri
const auto count = get_n_children();
for(int i = 0; i < count; ++i)
{
- Glib::RefPtr<Goocanvas::Item> child = get_child(i);
- Glib::RefPtr<CanvasItemMovable> movable = CanvasItemMovable::cast_to_movable(child);
+ auto child = get_child(i);
+ auto movable = CanvasItemMovable::cast_to_movable(child);
if(movable)
{
movable->set_grid(grid);
diff --git a/glom/utility_widgets/canvas/test_canvas_editable.cc
b/glom/utility_widgets/canvas/test_canvas_editable.cc
index 3cfe057..97343d6 100644
--- a/glom/utility_widgets/canvas/test_canvas_editable.cc
+++ b/glom/utility_widgets/canvas/test_canvas_editable.cc
@@ -48,29 +48,29 @@ public:
/*
//Doesn't work until we fix the goocanvas _new() methods: Glib::RefPtr<Goocanvas::Rect> rect =
Glib::wrap( goo_canvas_rect_new()
//Glib::RefPtr<Goocanvas::Rect> rect = Goocanvas::Rect::create(10, 10, 110, 110);
- Glib::RefPtr<Glom::CanvasRectMovable> rect = Glom::CanvasRectMovable::create(10, 10, 110, 110);
+ auto rect = Glom::CanvasRectMovable::create(10, 10, 110, 110);
rect->property_fill_color() = "white"; //This makes the whole area clickable, not just the outline
stroke:
rect->property_line_width() = 2.0f;
rect->property_stroke_color() = "blue";
add_item(rect, true);
- Glib::RefPtr<Glom::CanvasTextMovable> text = Glom::CanvasTextMovable::create("yadda2 yadda2");
+ auto text = Glom::CanvasTextMovable::create("yadda2 yadda2");
text->set_xy(10, 10);
text->set_width_height(40, 40);
add_item(text, true);
- Glib::RefPtr<Glom::CanvasGroupResizable> resizable = Glom::CanvasGroupResizable::create();
- Glib::RefPtr<Glom::CanvasTextMovable> resizable_inner = Glom::CanvasTextMovable::create("yadda3 yadda3");
+ auto resizable = Glom::CanvasGroupResizable::create();
+ auto resizable_inner = Glom::CanvasTextMovable::create("yadda3 yadda3");
resizable->set_child(resizable_inner);
resizable->set_xy(50, 50);
resizable->set_width_height(40, 40);
add_item(resizable, false); //This doesn't seem to work if we use true (a resizable inside a resizable)
// Test replacement of the child (should remove the old child):
- Glib::RefPtr<Glom::CanvasTextMovable> resizable_inner2 = Glom::CanvasTextMovable::create("yadda3.1
yadda3.1");
+ auto resizable_inner2 = Glom::CanvasTextMovable::create("yadda3.1 yadda3.1");
resizable->set_child(resizable_inner2);
- Glib::RefPtr<Glom::CanvasLineMovable> line = Glom::CanvasLineMovable::create();
+ auto line = Glom::CanvasLineMovable::create();
double points_coordinates[] = {20.0, 20.0, 100.0, 40.0};
Goocanvas::Points points(2, points_coordinates);
line->property_points() = points;
@@ -81,7 +81,7 @@ public:
line->signal_show_context().connect( sigc::mem_fun(*this, &MyCanvas::on_show_context_menu) );
- Glib::RefPtr<Glom::CanvasLineMovable> line2 = Glom::CanvasLineMovable::create();
+ auto line2 = Glom::CanvasLineMovable::create();
double points_coordinatess[] = {120.0, 120.0, 150.0, 150.0};
Goocanvas::Points points2(2, points_coordinatess);
line2->property_points() = points2;
@@ -90,8 +90,8 @@ public:
add_item(line2, true);
- Glib::RefPtr<Glom::CanvasGroupMovable> group = Glom::CanvasGroupMovable::create();
- Glib::RefPtr<Glom::CanvasRectMovable> rect_inner = Glom::CanvasRectMovable::create(70, 70, 90, 90);
+ auto group = Glom::CanvasGroupMovable::create();
+ auto rect_inner = Glom::CanvasRectMovable::create(70, 70, 90, 90);
rect_inner->property_fill_color() = "blue"; //This makes the whole area clickable, not just the outline
stroke:
rect_inner->property_line_width() = 1.0f;
rect_inner->property_stroke_color() = "red";
@@ -100,10 +100,10 @@ public:
add_item(group, true);
*/
- Glib::RefPtr<Glom::CanvasTableMovable> table = Glom::CanvasTableMovable::create();
+ auto table = Glom::CanvasTableMovable::create();
table->set_xy(100, 100);
table->set_width_height(200, 200);
- Glib::RefPtr<Glom::CanvasRectMovable> innerrect1 = Glom::CanvasRectMovable::create();
+ auto innerrect1 = Glom::CanvasRectMovable::create();
innerrect1->property_fill_color() = "blue"; //This makes the whole area clickable, not just the outline
stroke.
innerrect1->property_line_width() = 1;
innerrect1->property_stroke_color() = "black";
@@ -115,7 +115,7 @@ public:
"x-fill", TRUE,
"x-expand", TRUE,
(void*)0);
- Glib::RefPtr<Glom::CanvasRectMovable> innerrect2 = Glom::CanvasRectMovable::create();
+ auto innerrect2 = Glom::CanvasRectMovable::create();
innerrect2->property_fill_color() = "green"; //This makes the whole area clickable, not just the outline
stroke.
innerrect2->property_line_width() = 1;
innerrect2->property_stroke_color() = "black";
@@ -127,7 +127,7 @@ public:
"x-fill", TRUE,
"x-expand", TRUE,
(void*)0);
- Glib::RefPtr<Goocanvas::Text> innerrect3 = Goocanvas::Text::create();
+ auto innerrect3 = Goocanvas::Text::create();
innerrect3->property_fill_color() = "yellow"; //This makes the whole area clickable, not just the
outline stroke.
innerrect3->property_line_width() = 1;
innerrect3->property_stroke_color() = "black";
@@ -171,7 +171,7 @@ private:
m_context_menu_action_group->add(Gtk::Action::create("ContextMenu", "Context Menu") );
- Glib::RefPtr<Gtk::Action> action = Gtk::Action::create("ContextEdit", _("_Edit"));
+ auto action = Gtk::Action::create("ContextEdit", _("_Edit"));
m_context_menu_action_group->add(action,
sigc::mem_fun(*this, &MyCanvas::on_context_menu_edit) );
@@ -179,7 +179,7 @@ private:
m_context_menu_action_group->add(action,
sigc::mem_fun(*this, &MyCanvas::on_context_menu_delete) );
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Edit"), "context.edit");
menu->append(_("_Delete"), "context.delete");
diff --git a/glom/utility_widgets/combo_textglade.cc b/glom/utility_widgets/combo_textglade.cc
index 027f9b1..97328fb 100644
--- a/glom/utility_widgets/combo_textglade.cc
+++ b/glom/utility_widgets/combo_textglade.cc
@@ -37,7 +37,7 @@ Combo_TextGlade::Combo_TextGlade(BaseObjectType* cobject, const Glib::RefPtr<Gtk
void Combo_TextGlade::set_first_active()
{
- Glib::RefPtr<Gtk::TreeModel> model = get_model();
+ auto model = get_model();
if(!model)
return;
diff --git a/glom/utility_widgets/dialog_image_load_progress.cc
b/glom/utility_widgets/dialog_image_load_progress.cc
index 7f4142c..d094633 100644
--- a/glom/utility_widgets/dialog_image_load_progress.cc
+++ b/glom/utility_widgets/dialog_image_load_progress.cc
@@ -99,7 +99,7 @@ void DialogImageLoadProgress::on_query_info(const Glib::RefPtr<Gio::AsyncResult>
{
try
{
- Glib::RefPtr<Gio::FileInfo> info = m_stream->query_info_finish(result);
+ auto info = m_stream->query_info_finish(result);
m_data->binary_length = info->get_size();
// We need to use the glib allocator here:
diff --git a/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
b/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
index 3a3955d..f2885f5 100644
--- a/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
+++ b/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
@@ -354,7 +354,7 @@ create_window()
int
main(int argc, char *argv[])
{
- Glib::RefPtr<Gtk::Application> app =
+ auto app =
Gtk::Application::create(argc, argv, "org.glom.test_spreadtablednd");
auto window = create_window();
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 791004e..ba76c18 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -416,7 +416,7 @@ void ImageGlom::show_image_data()
if(m_pixbuf_original)
{
- Glib::RefPtr<Gdk::Pixbuf> pixbuf_scaled = get_scaled_image();
+ auto pixbuf_scaled = get_scaled_image();
m_image.set(pixbuf_scaled);
}
else if(icon)
@@ -432,7 +432,7 @@ void ImageGlom::show_image_data()
Glib::RefPtr<Gdk::Pixbuf> ImageGlom::get_scaled_image()
{
- Glib::RefPtr<Gdk::Pixbuf> pixbuf = m_pixbuf_original;
+ auto pixbuf = m_pixbuf_original;
if(!pixbuf)
return pixbuf;
@@ -452,7 +452,7 @@ Glib::RefPtr<Gdk::Pixbuf> ImageGlom::get_scaled_image()
{
if(true) //allocation_height > 10 || allocation_width > 10)
{
- Glib::RefPtr<Gdk::Pixbuf> pixbuf_scaled = UiUtils::image_scale_keeping_ratio(pixbuf,
allocation_height, allocation_width);
+ auto pixbuf_scaled = UiUtils::image_scale_keeping_ratio(pixbuf, allocation_height, allocation_width);
//Don't set a new pixbuf if the dimensions have not changed:
Glib::RefPtr<Gdk::Pixbuf> pixbuf_in_image;
@@ -509,7 +509,7 @@ void ImageGlom::on_menupopup_activate_open_file_with()
if(dialog.run() != Gtk::RESPONSE_OK)
return;
- Glib::RefPtr<Gio::AppInfo> app_info = dialog.get_app_info();
+ auto app_info = dialog.get_app_info();
if(!app_info)
{
std::cerr << G_STRFUNC << ": app_info was null." << std::endl;
@@ -546,7 +546,7 @@ static void make_file_read_only(const Glib::ustring& uri)
//Setting the attribute via gio gives us this exception:
//"Setting attribute access::can-write not supported"
/*
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
Glib::RefPtr<Gio::FileInfo> file_info;
@@ -644,7 +644,7 @@ void ImageGlom::open_with(const Glib::RefPtr<Gio::AppInfo>& app_info)
static void set_file_filter_images(Gtk::FileChooser& file_chooser)
{
//Get image formats only:
- Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
+ auto filter = Gtk::FileFilter::create();
filter->set_name(_("Images"));
filter->add_pixbuf_formats();
file_chooser.add_filter(filter);
@@ -853,7 +853,7 @@ void ImageGlom::on_menupopup_activate_copy()
else
m_pixbuf_clipboard.reset();
- Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+ auto refClipboard = Gtk::Clipboard::get();
//Targets:
const auto mime_type = get_mime_type();
@@ -892,7 +892,7 @@ void ImageGlom::on_menupopup_activate_paste()
return;
//Tell the clipboard to call our method when it is ready:
- Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get();
+ auto refClipboard = Gtk::Clipboard::get();
if(refClipboard)
refClipboard->request_image( sigc::mem_fun(*this, &ImageGlom::on_clipboard_received_image) );
@@ -940,7 +940,7 @@ void ImageGlom::setup_menu_usermode()
//Create the UI for the menu whose items will activate the actions,
//when this UI (a GtkMenu) is added and shown:
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("_Open File"), "context.open-file");
menu->append(_("Open File With"), "context.open-file-with");
menu->append(_("Select File"), "context.select-file");
diff --git a/glom/utility_widgets/layoutwidgetmenu.cc b/glom/utility_widgets/layoutwidgetmenu.cc
index 3554f64..cc22e34 100644
--- a/glom/utility_widgets/layoutwidgetmenu.cc
+++ b/glom/utility_widgets/layoutwidgetmenu.cc
@@ -111,7 +111,7 @@ void LayoutWidgetMenu::setup_menu(Gtk::Widget* widget)
pApp->update_userlevel_ui(); //Update our action's sensitivity.
}
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("Choose Field"), "context.choose-field");
menu->append(_("Field Layout Properties"), "context.field-layout-properties");
menu->append(_("Add Related Records"), "context.add-related-records");
diff --git a/glom/utility_widgets/layoutwidgetutils.cc b/glom/utility_widgets/layoutwidgetutils.cc
index b4e2087..73844df 100644
--- a/glom/utility_widgets/layoutwidgetutils.cc
+++ b/glom/utility_widgets/layoutwidgetutils.cc
@@ -49,7 +49,7 @@ void LayoutWidgetUtils::setup_util_menu(Gtk::Widget* widget)
widget->insert_action_group("utility", m_refActionGroup);
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("Properties"), "context.properties");
menu->append(_("_Delete"), "context.delete");
diff --git a/glom/utility_widgets/notebooklabelglom.cc b/glom/utility_widgets/notebooklabelglom.cc
index 5b86e0e..b1da6d8 100644
--- a/glom/utility_widgets/notebooklabelglom.cc
+++ b/glom/utility_widgets/notebooklabelglom.cc
@@ -115,7 +115,7 @@ void NotebookLabel::setup_menu(Gtk::Widget* /* widget */)
insert_action_group("context", m_refActionGroup);
- Glib::RefPtr<Gio::Menu> menu = Gio::Menu::create();
+ auto menu = Gio::Menu::create();
menu->append(_("New Group"), "context.new-group");
menu->append(_("_Delete"), "context.delete");
diff --git a/glom/utility_widgets/test_flowtable.cc b/glom/utility_widgets/test_flowtable.cc
index db38df2..e4c5573 100644
--- a/glom/utility_widgets/test_flowtable.cc
+++ b/glom/utility_widgets/test_flowtable.cc
@@ -99,7 +99,7 @@ static void clear_flowtable(Glom::FlowTable& flowtable)
int
main(int argc, char* argv[])
{
- Glib::RefPtr<Gtk::Application> app =
+ auto app =
Gtk::Application::create(argc, argv, "org.glom.test_flowtable");
Gtk::Window window;
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index bde736c..bd915d6 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -78,9 +78,9 @@ static Glib::RefPtr<Gtk::CssProvider> create_css_provider(Gtk::Widget& widget)
{
// Add a StyleProvider so we can change the color, background color, and font.
// This was easier before Gtk::Widget::override_color() was deprecated.
- Glib::RefPtr<Gtk::CssProvider> css_provider = Gtk::CssProvider::create();
+ auto css_provider = Gtk::CssProvider::create();
- Glib::RefPtr<Gtk::StyleContext> refStyleContext = widget.get_style_context();
+ auto refStyleContext = widget.get_style_context();
if(refStyleContext)
refStyleContext->add_provider(css_provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
@@ -225,7 +225,7 @@ void UiUtils::show_window_until_hide(Gtk::Window* window)
if(!window)
return;
- Glib::RefPtr<Glib::MainLoop> main_loop = Glib::MainLoop::create(false /* not running */);
+ auto main_loop = Glib::MainLoop::create(false /* not running */);
//Stop the main_loop when the window is hidden:
sigc::connection handler_connection; //TODO: There seems to be a crash if this is on the same line.
@@ -326,7 +326,7 @@ namespace {
static int get_width_for_text(Gtk::Widget& widget, const Glib::ustring& text)
{
//Get the width required for this string in the current font:
- Glib::RefPtr<Pango::Layout> refLayout = widget.create_pango_layout(text);
+ auto refLayout = widget.create_pango_layout(text);
int width = 0;
int height = 0;
refLayout->get_pixel_size(width, height);
@@ -625,7 +625,7 @@ void UiUtils::container_remove_all(Gtk::Container& container)
void UiUtils::load_font_into_css_provider(Gtk::Widget& widget, const Glib::ustring& font)
{
- Glib::RefPtr<Gtk::CssProvider> css_provider = create_css_provider(widget);
+ auto css_provider = create_css_provider(widget);
try
{
@@ -645,7 +645,7 @@ void UiUtils::load_font_into_css_provider(Gtk::Widget& widget, const Glib::ustri
void UiUtils::load_color_into_css_provider(Gtk::Widget& widget, const Glib::ustring& color)
{
- Glib::RefPtr<Gtk::CssProvider> css_provider = create_css_provider(widget);
+ auto css_provider = create_css_provider(widget);
try
{
@@ -665,7 +665,7 @@ void UiUtils::load_color_into_css_provider(Gtk::Widget& widget, const Glib::ustr
void UiUtils::load_background_color_into_css_provider(Gtk::Widget& widget, const Glib::ustring& color)
{
- Glib::RefPtr<Gtk::CssProvider> css_provider = create_css_provider(widget);
+ auto css_provider = create_css_provider(widget);
try
{
diff --git a/tests/glade_toplevels_instantiation.cc b/tests/glade_toplevels_instantiation.cc
index 4c72754..60bf24e 100644
--- a/tests/glade_toplevels_instantiation.cc
+++ b/tests/glade_toplevels_instantiation.cc
@@ -63,7 +63,7 @@ static bool attempt_instantiation(const std::string& filepath, const xmlpp::Elem
std::cerr << G_STRFUNC << ": Non-window top-level object in Glade file (unexpected by Glom): id=" << id
<< " from file " << filepath << std::endl;
//But let's try this anyway:
- Glib::RefPtr<Glib::Object> object = builder->get_object(id);
+ auto object = builder->get_object(id);
return false;
}
@@ -90,7 +90,7 @@ static bool attempt_instantiation(const std::string& filepath, const xmlpp::Elem
int main(int argc, char* argv[])
{
- Glib::RefPtr<Gtk::Application> app =
+ auto app =
Gtk::Application::create(argc, argv, "org.glom.test_glade_toplevels_instantiation");
Gsv::init(); //Our .glade files contain gtksourceview widgets too.
diff --git a/tests/import/utils.cc b/tests/import/utils.cc
index ee06fcc..166cc4e 100644
--- a/tests/import/utils.cc
+++ b/tests/import/utils.cc
@@ -28,7 +28,7 @@ static Glib::ustring create_file_from_buffer(const char* input, guint input_size
return std::string();
}
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(file_uri);
+ auto file = Gio::File::create_for_uri(file_uri);
gssize result = 0;
@@ -85,7 +85,7 @@ bool run_parser_from_buffer(const FuncConnectParserSignals& connect_parser_signa
//Start a mainloop because the parser uses an idle handler.
//TODO: Stop the parser from doing that.
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create();
+ auto mainloop = Glib::MainLoop::create();
Glom::CsvParser parser("UTF-8");
parser.signal_encoding_error().connect(sigc::bind(&on_parser_encoding_error, mainloop));
@@ -105,7 +105,7 @@ bool run_parser_from_buffer(const FuncConnectParserSignals& connect_parser_signa
mainloop->run();
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(file_uri);
+ auto file = Gio::File::create_for_uri(file_uri);
try
{
@@ -127,7 +127,7 @@ bool run_parser_on_file(const FuncConnectParserSignals& connect_parser_signals,
//Start a mainloop because the parser uses an idle handler.
//TODO: Stop the parser from doing that.
- Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create();
+ auto mainloop = Glib::MainLoop::create();
Glom::CsvParser parser("UTF-8");
parser.signal_encoding_error().connect(sigc::bind(&on_parser_encoding_error, mainloop));
diff --git a/tests/python/test_python_execute_func_with_record.cc
b/tests/python/test_python_execute_func_with_record.cc
index f72d6c1..d3bdf01 100644
--- a/tests/python/test_python_execute_func_with_record.cc
+++ b/tests/python/test_python_execute_func_with_record.cc
@@ -82,7 +82,7 @@ int main()
auto connection = connection_pool->connect();
g_assert(connection);
- Glib::RefPtr<Gnome::Gda::Connection> gda_connection = connection->get_gda_connection();
+ auto gda_connection = connection->get_gda_connection();
g_assert(connection->get_gda_connection());
diff --git a/tests/test_document_autosave.cc b/tests/test_document_autosave.cc
index 3e7565d..e06e80a 100644
--- a/tests/test_document_autosave.cc
+++ b/tests/test_document_autosave.cc
@@ -32,7 +32,7 @@ void cleanup()
{
try
{
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(file_uri);
+ auto file = Gio::File::create_for_uri(file_uri);
//Ignore the return value because it will throw an exception instead.
file->remove(); //This should be OK because it is a file, not a directory.
diff --git a/tests/test_document_load_and_save.cc b/tests/test_document_load_and_save.cc
index fc5650d..fc59572 100644
--- a/tests/test_document_load_and_save.cc
+++ b/tests/test_document_load_and_save.cc
@@ -80,7 +80,7 @@ int main(int argc, char* argv[])
}
//Get a URI (file://something) from the filepath:
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(argv[1]);
+ auto file = Gio::File::create_for_commandline_arg(argv[1]);
const auto uri = file->get_uri();
const std::string dtd_filepath = argv[2];
diff --git a/tests/test_glade_derived_instantiation.cc b/tests/test_glade_derived_instantiation.cc
index a3b6081..eefce6a 100644
--- a/tests/test_glade_derived_instantiation.cc
+++ b/tests/test_glade_derived_instantiation.cc
@@ -129,7 +129,7 @@ bool instantiate_widget()
int main(int argc, char *argv[])
{
- Glib::RefPtr<Gtk::Application> app =
+ auto app =
Gtk::Application::create(argc, argv, "org.glom.test_glade_derived_instantiation");
Gsv::init(); //Our .glade files contain gtksourceview widgets too.
diff --git a/tests/test_selfhosting_new_then_change_columns.cc
b/tests/test_selfhosting_new_then_change_columns.cc
index 584b3dd..fa7d01a 100644
--- a/tests/test_selfhosting_new_then_change_columns.cc
+++ b/tests/test_selfhosting_new_then_change_columns.cc
@@ -159,7 +159,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
auto field_numeric = std::make_shared<Glom::Field>();
field_numeric->set_name("newfield");
field_numeric->set_glom_type(Glom::Field::glom_field_type::NUMERIC);
- Glib::RefPtr<Gnome::Gda::Column> field_info = field_numeric->get_field_info();
+ auto field_info = field_numeric->get_field_info();
field_info->set_g_type( Glom::Field::get_gda_type_for_glom_type(field_numeric->get_glom_type()) );
field_numeric->set_field_info(field_info);
diff --git a/tests/test_selfhosting_new_then_image.cc b/tests/test_selfhosting_new_then_image.cc
index 6298494..21bfb2f 100644
--- a/tests/test_selfhosting_new_then_image.cc
+++ b/tests/test_selfhosting_new_then_image.cc
@@ -83,7 +83,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
const Glib::RefPtr<const Gnome::Gda::SqlBuilder> builder_get =
Glom::Utils::build_sql_select_with_where_clause(table_name,
fieldsToGet, where_clause);
- Glib::RefPtr<Gnome::Gda::DataModel> data_model =
+ auto data_model =
Glom::DbUtils::query_execute_select(builder_get);
if(!test_model_expected_size(data_model, 1, 1))
{
diff --git a/tests/test_selfhosting_sqlinjection.cc b/tests/test_selfhosting_sqlinjection.cc
index 4b5bc18..44db92b 100644
--- a/tests/test_selfhosting_sqlinjection.cc
+++ b/tests/test_selfhosting_sqlinjection.cc
@@ -50,7 +50,7 @@ static bool check_get_extra_rows(const Glib::ustring& quote_char)
const Glib::RefPtr<const Gnome::Gda::SqlBuilder> builder =
Glom::Utils::build_sql_select_with_where_clause("albums",
fieldsToGet, where_clause);
- Glib::RefPtr<Gnome::Gda::DataModel> data_model =
+ auto data_model =
Glom::DbUtils::query_execute_select(builder);
if(!test_model_expected_size(data_model, 2, 0)) //No rows should be returned because the match value was
stupid, if escaped properly.
{
@@ -83,7 +83,7 @@ static bool check_drop_table(const Glib::ustring& quote_char)
const Glib::RefPtr<const Gnome::Gda::SqlBuilder> builder =
Glom::Utils::build_sql_select_with_where_clause("albums",
fieldsToGet, where_clause);
- Glib::RefPtr<Gnome::Gda::DataModel> data_model =
+ auto data_model =
Glom::DbUtils::query_execute_select(builder);
if(!test_model_expected_size(data_model, 2, 0)) //No rows should be returned because the match value was
stupid, if escaped properly.
{
diff --git a/tests/test_selfhosting_utils.cc b/tests/test_selfhosting_utils.cc
index 22a492a..77983fd 100644
--- a/tests/test_selfhosting_utils.cc
+++ b/tests/test_selfhosting_utils.cc
@@ -69,7 +69,7 @@ static bool check_directory_exists()
return false;
}
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(temp_filepath_dir);
+ auto file = Gio::File::create_for_path(temp_filepath_dir);
return file->query_exists();
}
@@ -83,12 +83,12 @@ static bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
//(Recursively) Delete any child files and directories,
//so we can delete this directory.
- Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
+ auto enumerator = directory->enumerate_children();
- Glib::RefPtr<Gio::FileInfo> info = enumerator->next_file();
+ auto info = enumerator->next_file();
while(info)
{
- Glib::RefPtr<Gio::File> child = directory->get_child(info->get_name());
+ auto child = directory->get_child(info->get_name());
bool removed_child = false;
if(child->query_file_type() == Gio::FILE_TYPE_DIRECTORY)
removed_child = delete_directory(child);
@@ -113,7 +113,7 @@ static bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
*/
static bool delete_directory(const std::string& uri)
{
- Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
+ auto file = Gio::File::create_for_uri(uri);
return delete_directory(file);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]