[glom] C++11: More use of auto.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: More use of auto.
- Date: Fri, 18 Sep 2015 08:27:15 +0000 (UTC)
commit b4539c953257d05560e7b487960e14e60f551bf0
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Sep 18 10:02:44 2015 +0200
C++11: More use of auto.
glom/appwindow.cc | 74 ++++++------
glom/base_db.cc | 30 +++---
glom/base_db_table_data.cc | 6 +-
glom/box_db_table.cc | 2 +-
glom/box_reports.cc | 6 +-
glom/box_withbuttons.cc | 6 +-
glom/dialog_connection.cc | 18 ++--
glom/dialog_existing_or_new.cc | 8 +-
glom/frame_glom.cc | 112 ++++++++++----------
glom/glom_create_from_example.cc | 8 +-
glom/glom_test_connection.cc | 6 +-
glom/import_csv/dialog_import_csv.cc | 4 +-
glom/libglom/connectionpool.cc | 30 +++---
glom/libglom/db_utils.cc | 18 ++--
glom/libglom/document/document.cc | 116 ++++++++++----------
glom/libglom/privs.cc | 2 +-
glom/libglom/python_embed/py_glom_record.cc | 2 +-
glom/libglom/python_embed/py_glom_related.cc | 2 +-
glom/libglom/python_embed/py_glom_relatedrecord.cc | 2 +-
.../libglom/python_embed/pygdavalue_conversions.cc | 2 +-
glom/libglom/report_builder.cc | 30 +++---
glom/libglom/test_connectionpool.cc | 6 +-
glom/libglom/utils.cc | 2 +-
glom/mode_data/box_data.cc | 6 +-
glom/mode_data/box_data_calendar_related.cc | 12 +-
glom/mode_data/box_data_details.cc | 22 ++--
glom/mode_data/box_data_list.cc | 6 +-
glom/mode_data/box_data_list_related.cc | 6 +-
glom/mode_data/box_data_manyrecords.cc | 2 +-
glom/mode_data/box_data_portal.cc | 2 +-
glom/mode_data/buttonglom.cc | 4 +-
glom/mode_data/datawidget/cellcreation.cc | 16 ++--
glom/mode_data/datawidget/cellrenderer_dblist.cc | 10 +-
glom/mode_data/datawidget/checkbutton.cc | 4 +-
glom/mode_data/datawidget/combo.cc | 10 +-
.../mode_data/datawidget/combo_as_radio_buttons.cc | 16 ++--
.../datawidget/combochoiceswithtreemodel.cc | 10 +-
glom/mode_data/datawidget/datawidget.cc | 56 +++++-----
glom/mode_data/datawidget/entry.cc | 4 +-
glom/mode_data/datawidget/label.cc | 4 +-
glom/mode_data/datawidget/textview.cc | 6 +-
glom/mode_data/datawidget/treemodel_db.cc | 6 +-
glom/mode_data/db_adddel/db_adddel.cc | 50 ++++----
glom/mode_data/flowtablewithfields.cc | 84 +++++++-------
glom/mode_data/notebook_data.cc | 14 +-
glom/mode_design/box_db_table_relationships.cc | 6 +-
glom/mode_design/dialog_database_preferences.cc | 6 +-
glom/mode_design/dialog_design.cc | 2 +-
glom/mode_design/dialog_initial_password.cc | 2 +-
glom/mode_design/fields/box_db_table_definition.cc | 16 ++--
glom/mode_design/fields/dialog_fielddefinition.cc | 6 +-
glom/mode_design/iso_codes.cc | 6 +-
glom/mode_design/layout/dialog_choose_field.cc | 2 +-
.../layout/dialog_layout_calendar_related.cc | 2 +-
glom/mode_design/layout/dialog_layout_details.cc | 20 ++--
glom/mode_design/layout/dialog_layout_export.cc | 6 +-
.../layout/dialog_layout_list_related.cc | 2 +-
.../layout/layout_item_dialogs/box_formatting.cc | 4 +-
.../layout_item_dialogs/dialog_fieldslist.cc | 8 +-
.../layout/layout_item_dialogs/dialog_notebook.cc | 2 +-
.../layout_item_dialogs/dialog_sortfields.cc | 8 +-
glom/mode_design/layout/treestore_layout.cc | 4 +-
.../mode_design/print_layouts/box_print_layouts.cc | 6 +-
.../print_layouts/print_layout_toolbar_button.cc | 8 +-
.../print_layouts/window_print_layout_edit.cc | 18 ++--
.../window_relationships_overview.cc | 6 +-
.../report_layout/dialog_layout_report.cc | 40 ++++----
.../report_layout/treestore_report_layout.cc | 2 +-
.../script_library/dialog_script_library.cc | 12 +-
glom/mode_design/translation/combobox_locale.cc | 2 +-
.../mode_design/translation/window_translations.cc | 16 ++--
glom/mode_design/users/dialog_groups_list.cc | 12 +-
glom/mode_design/users/dialog_users_list.cc | 2 +-
glom/mode_find/box_data_details_find.cc | 2 +-
glom/navigation/box_tables.cc | 12 +-
glom/notebook_glom.cc | 14 +-
glom/print_layout/canvas_print_layout.cc | 8 +-
glom/python_embed/python_ui_callbacks.cc | 10 +-
glom/utility_widgets/adddel/adddel.cc | 28 +++---
glom/utility_widgets/canvas/canvas_group_grid.cc | 6 +-
.../utility_widgets/canvas/canvas_image_movable.cc | 2 +-
glom/utility_widgets/canvas/canvas_item_movable.cc | 8 +-
glom/utility_widgets/dialog_properties.cc | 12 +-
.../eggspreadtablemm/test_spreadtablednd.cc | 30 +++---
.../filechooserdialog_saveextras.cc | 12 +-
glom/utility_widgets/flowtable.cc | 12 +-
glom/utility_widgets/imageglom.cc | 18 ++--
glom/utility_widgets/layouttoolbarbutton.cc | 2 +-
glom/utility_widgets/layoutwidgetbase.cc | 14 +-
glom/utility_widgets/layoutwidgetmenu.cc | 4 +-
glom/utility_widgets/layoutwidgetutils.cc | 2 +-
glom/utility_widgets/notebook_noframe.cc | 2 +-
glom/utility_widgets/notebookglom.cc | 2 +-
glom/utility_widgets/notebooklabelglom.cc | 4 +-
glom/utility_widgets/test_flowtable.cc | 12 +-
glom/variablesmap.cc | 32 +++---
glom/window_boxholder.cc | 2 +-
tests/glade_toplevels_instantiation.cc | 2 +-
.../python/test_python_execute_func_with_record.cc | 4 +-
..._python_execute_func_with_record_field_types.cc | 2 +-
tests/test_glade_derived_instantiation.cc | 2 +-
.../test_selfhosting_new_from_example_operator.cc | 2 +-
tests/test_selfhosting_new_then_change_columns.cc | 2 +-
tests/test_selfhosting_utils.cc | 6 +-
tests/test_xml_utils.cc | 2 +-
105 files changed, 670 insertions(+), 670 deletions(-)
---
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index d3268bb..043c2a9 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -130,7 +130,7 @@ AppWindow::AppWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>&
#ifndef GLOM_ENABLE_CLIENT_ONLY
#ifndef G_OS_WIN32
//Install UI hooks for this:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(connection_pool)
{
connection_pool->set_avahi_publish_callbacks(
@@ -207,7 +207,7 @@ bool AppWindow::init_with_document(const Glib::ustring& document_uri, bool resto
if(document_uri.empty())
{
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(pDocument && pDocument->get_connection_database().empty()) //If it is a new (default) document.
{
return offer_new_or_existing();
@@ -243,7 +243,7 @@ void AppWindow::set_show_sql_debug(bool val)
void AppWindow::set_stop_auto_server_shutdown(bool val)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(connection_pool)
connection_pool->set_auto_server_shutdown(!val);
}
@@ -619,7 +619,7 @@ void AppWindow::open_browsed_document(const EpcServiceInfo* server, const Glib::
else
{
//Open the document supplied by the other glom instance on the network:
- EpcConsumer* consumer = epc_consumer_new(server);
+ auto consumer = epc_consumer_new(server);
Glib::ustring username, password;
dialog_connection->get_username_and_password(username, password);
@@ -707,7 +707,7 @@ void AppWindow::open_browsed_document(const EpcServiceInfo* server, const Glib::
//so we don't think that opening has failed because it has no URI,
//and to stop us from allowing developer mode
//(that would require changes to the original document).
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
document->set_opened_from_browse();
@@ -772,7 +772,7 @@ void AppWindow::init_create_document()
{
if(!m_pDocument)
{
- Document* document_glom = new Document();
+ auto document_glom = new Document();
//By default, we assume that the original is in the current locale.
document_glom->set_translation_original_locale(AppWindow::get_current_locale());
@@ -855,7 +855,7 @@ bool AppWindow::on_document_load()
//Link to the database described in the document.
//Need to ask user for user/password:
//m_pFrame->load_from_document();
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(!pDocument)
return false;
@@ -993,7 +993,7 @@ bool AppWindow::on_document_load()
#endif // !GLOM_ENABLE_CLIENT_ONLY
//Read the connection information from the document:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return false; //Impossible anyway.
else
@@ -1118,7 +1118,7 @@ bool AppWindow::on_document_load()
if(!script.empty())
{
Glib::ustring error_message; //TODO: Check this and tell the user.
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
std::shared_ptr<SharedConnection> sharedconnection = connection_pool->connect();
AppPythonUICallbacks callbacks;
glom_execute_python_function_implementation(script,
@@ -1168,7 +1168,7 @@ void AppWindow::on_document_close()
#ifndef GLOM_ENABLE_CLIENT_ONLY
//TODO: It would be better to do this in a AppWindow::on_document_closed() virtual method,
//but that would need an ABI break in Bakery:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return;
@@ -1191,7 +1191,7 @@ void AppWindow::statusbar_clear()
void AppWindow::update_network_shared_ui()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return;
@@ -1333,7 +1333,7 @@ bool AppWindow::offer_new_or_existing()
}
//Check that a document was opened:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document was NULL." << std::endl;
@@ -1377,7 +1377,7 @@ void AppWindow::existing_or_new_new()
offer_saveas();
//Check that the document was given a location:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document is null." << std::endl;
@@ -1415,7 +1415,7 @@ void AppWindow::existing_or_new_new()
document->set_hosting_mode(hosting_mode);
//Tell the connection pool about the document:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(connection_pool)
connection_pool->set_get_document_func( std::bind(&AppWindow::on_connection_pool_get_document, this) );
@@ -1502,7 +1502,7 @@ bool AppWindow::recreate_database_from_example(bool& user_cancelled)
if(!pDocument)
return false;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return false; //Impossible anyway.
@@ -1680,11 +1680,11 @@ bool AppWindow::recreate_database_from_backup(const std::string& backup_data_fil
ShowProgressMessage progress_message(_("Creating Glom database from backup file."));
//Create a database, based on the information in the current document:
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(!pDocument)
return false;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return false; //Impossible anyway.
@@ -1808,7 +1808,7 @@ bool AppWindow::recreate_database_from_backup(const std::string& backup_data_fil
AppState::userlevels AppWindow::get_userlevel() const
{
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(document)
{
return document->get_userlevel();
@@ -2005,7 +2005,7 @@ void AppWindow::fill_menu_print_layouts(const Glib::ustring& table_name)
m_refNavPrintLayoutsActionGroup = Gio::SimpleActionGroup::create();
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document is null." << std::endl;
@@ -2053,7 +2053,7 @@ void AppWindow::on_menu_file_save_as_example()
//Show the save dialog:
bool bTest = false;
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document) {
std::cerr << G_STRFUNC << ": document was null." << std::endl;
} else {
@@ -2146,7 +2146,7 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
fileChooser_Save->set_do_overwrite_confirmation(); //Ask the user if the file already exists.
- Gtk::Window* pWindow = dynamic_cast<Gtk::Window*>(&app);
+ auto pWindow = dynamic_cast<Gtk::Window*>(&app);
if(pWindow)
fileChooser_Save->set_transient_for(*pWindow);
@@ -2165,7 +2165,7 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
//Start with something suitable:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
g_assert(document);
const auto filename = document->get_name(); //Get the filename without the path and extension.
@@ -2334,10 +2334,10 @@ Glib::ustring AppWindow::ui_file_select_save(const Glib::ustring& old_file_uri)
void AppWindow::stop_self_hosting_of_document_database()
{
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(pDocument)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return;
@@ -2399,7 +2399,7 @@ void AppWindow::on_menu_developer_active_platform(const Glib::ustring& parameter
//The state is not changed automatically:
m_action_menu_developer_active_platform->change_state(parameter);
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
document->set_active_layout_platform(parameter);
@@ -2408,7 +2408,7 @@ void AppWindow::on_menu_developer_active_platform(const Glib::ustring& parameter
void AppWindow::on_menu_developer_export_backup()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return;
@@ -2486,7 +2486,7 @@ void AppWindow::do_print_layout(const Glib::ustring& print_layout_name, bool pre
bool AppWindow::do_restore_backup(const Glib::ustring& backup_uri)
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
@@ -2574,7 +2574,7 @@ void AppWindow::update_window_title()
{
//Set application's main window title:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return;
@@ -2914,8 +2914,8 @@ void AppWindow::document_history_remove(const Glib::ustring& file_uri)
void AppWindow::on_menu_edit_copy_activate()
{
- Gtk::Widget* widget = get_focus();
- Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
+ auto widget = get_focus();
+ auto editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
{
@@ -2925,7 +2925,7 @@ void AppWindow::on_menu_edit_copy_activate()
//GtkTextView does not implement GtkEditable.
//See GTK+ bug: https://bugzilla.gnome.org/show_bug.cgi?id=667008
- Gtk::TextView* textview = dynamic_cast<Gtk::TextView*>(widget);
+ auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
@@ -2940,8 +2940,8 @@ void AppWindow::on_menu_edit_copy_activate()
void AppWindow::on_menu_edit_cut_activate()
{
- Gtk::Widget* widget = get_focus();
- Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
+ auto widget = get_focus();
+ auto editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
{
@@ -2951,7 +2951,7 @@ void AppWindow::on_menu_edit_cut_activate()
//GtkTextView does not implement GtkEditable.
//See GTK+ bug: https://bugzilla.gnome.org/show_bug.cgi?id=667008
- Gtk::TextView* textview = dynamic_cast<Gtk::TextView*>(widget);
+ auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
@@ -2966,8 +2966,8 @@ void AppWindow::on_menu_edit_cut_activate()
void AppWindow::on_menu_edit_paste_activate()
{
- Gtk::Widget* widget = get_focus();
- Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
+ auto widget = get_focus();
+ auto editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
{
@@ -2977,7 +2977,7 @@ void AppWindow::on_menu_edit_paste_activate()
//GtkTextView does not implement GtkEditable.
//See GTK+ bug: https://bugzilla.gnome.org/show_bug.cgi?id=667008
- Gtk::TextView* textview = dynamic_cast<Gtk::TextView*>(widget);
+ auto textview = dynamic_cast<Gtk::TextView*>(widget);
if(textview)
{
Glib::RefPtr<Gtk::TextBuffer> buffer = textview->get_buffer();
diff --git a/glom/base_db.cc b/glom/base_db.cc
index d48b208..1525f62 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -158,7 +158,7 @@ void Base_DB::load_from_document()
AppState::userlevels Base_DB::get_userlevel() const
{
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(document)
{
return document->get_userlevel();
@@ -172,7 +172,7 @@ AppState::userlevels Base_DB::get_userlevel() const
void Base_DB::set_userlevel(AppState::userlevels value)
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
document->set_userlevel(value);
@@ -191,7 +191,7 @@ void Base_DB::set_document(Document* pDocument)
View_Composite_Glom::set_document(pDocument);
//Connect to a signal that is only on the derived document class:
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
document->signal_userlevel_changed().connect( sigc::mem_fun(*this, &Base_DB::on_userlevel_changed) );
@@ -260,7 +260,7 @@ namespace
std::shared_ptr<Field> Base_DB::change_column(const Glib::ustring& table_name, const std::shared_ptr<const
Field>& field_old, const std::shared_ptr<const Field>& field, Gtk::Window* parent_window) const
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
std::shared_ptr<Field> result = check_field_change_constraints(field_old, field);
//TODO: change_column() doesn't throw any exception.
@@ -292,7 +292,7 @@ bool Base_DB::change_columns(const Glib::ustring& table_name, const type_vec_con
pass_fields[i] = fields[i];
}
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
try
{
@@ -610,7 +610,7 @@ std::shared_ptr<Field> Base_DB::get_field_primary_key_for_table(const Glib::ustr
void Base_DB::get_table_fields_to_show_for_sequence_add_group(const Glib::ustring& table_name, const
Privileges& table_privs, const type_vec_fields& all_db_fields, const std::shared_ptr<LayoutGroup>& group,
Base_DB::type_vecConstLayoutFields& vecFields) const
{
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
//g_warning("Box_Data::get_table_fields_to_show_for_sequence_add_group(): table_name=%s,
all_db_fields.size()=%d, group->name=%s", table_name.c_str(), all_db_fields.size(),
group->get_name().c_str());
@@ -687,7 +687,7 @@ void Base_DB::get_table_fields_to_show_for_sequence_add_group(const Glib::ustrin
Base_DB::type_vecConstLayoutFields Base_DB::get_table_fields_to_show_for_sequence(const Glib::ustring&
table_name, const Document::type_list_layout_groups& mapGroupSequence) const
{
- const Document* pDoc = dynamic_cast<const Document*>(get_document());
+ const auto pDoc = dynamic_cast<const Document*>(get_document());
//Get field definitions from the database, with corrections from the document:
type_vec_fields all_fields = DbUtils::get_fields_for_table(pDoc, table_name);
@@ -924,7 +924,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
//Add it to the database (even if it is not shown in the view)
//Using true for the last parameter means we use existing calculations where possible,
//instead of recalculating a field that is being calculated already, and for which this dependent
field is being calculated anyway.
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
LayoutFieldInRecord field_in_record_layout(layout_item, field_in_record.m_table_name /* parent
*/, field_in_record.m_key, field_in_record.m_key_value);
@@ -962,7 +962,7 @@ bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& field_in_re
bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& layoutfield_in_record, const
Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& field_value, bool use_current_calculations,
Gtk::Window* parent_window)
{
- Document* document = get_document();
+ auto document = get_document();
g_assert(document);
const auto field_in_record = layoutfield_in_record.get_fieldinrecord(*document);
@@ -1162,7 +1162,7 @@ Base_DB::type_list_const_field_items Base_DB::get_calculated_fields(const Glib::
type_list_const_field_items result;
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(document)
{
//Look at each field in the table, and get lists of what fields trigger their calculations,
@@ -1212,7 +1212,7 @@ Base_DB::type_list_const_field_items Base_DB::get_calculation_fields(const Glib:
if(calculation.empty())
return result;
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return result;
@@ -1272,7 +1272,7 @@ Base_DB::type_list_const_field_items Base_DB::get_calculation_fields(const Glib:
void Base_DB::do_lookups(const LayoutFieldInRecord& field_in_record, const Gtk::TreeModel::iterator& row,
const Gnome::Gda::Value& field_value)
{
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -1378,7 +1378,7 @@ bool Base_DB::check_entered_value_for_uniqueness(const Glib::ustring& table_name
bool Base_DB::get_relationship_exists(const Glib::ustring& table_name, const Glib::ustring&
relationship_name)
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
std::shared_ptr<Relationship> relationship = document->get_relationship(table_name, relationship_name);
@@ -1459,7 +1459,7 @@ void Base_DB::set_found_set_where_clause_for_portal(FoundSet& found_set, const s
// The WHERE clause mentions the first-related table (though by the alias defined in extra_join)
// and we add an extra JOIN to mention the second-related table.
- Document* document = get_document();
+ auto document = get_document();
Glib::ustring where_clause_to_table_name = relationship->get_to_table();
std::shared_ptr<Field> where_clause_to_key_field = DbUtils::get_fields_for_table_one_field(document,
relationship->get_to_table(), relationship->get_to_field());
@@ -1496,7 +1496,7 @@ bool Base_DB::set_database_owner_user(const Glib::ustring& user)
if(user.empty())
return false;
- ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ auto connectionpool = ConnectionPool::get_instance();
const auto database_name = connectionpool->get_database();
if(database_name.empty())
return false;
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 8ca52e3..b50eb13 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -68,7 +68,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
{
//std::cout << G_STRFUNC << ": debug: use_entered_data=" << use_entered_data << std::endl;
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<const Field> fieldPrimaryKey = get_field_primary_key();
@@ -314,7 +314,7 @@ bool Base_DB_Table_Data::add_related_record_for_field(const std::shared_ptr<cons
set_entered_field_data(item_from_key, primary_key_value);
//Set it in the database too:
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<Field> field_from_key = DbUtils::get_fields_for_table_one_field(document,
relationship->get_from_table(), relationship->get_from_field()); //TODO_Performance.
if(!field_from_key)
@@ -463,7 +463,7 @@ Base_DB_Table_Data::type_vecConstLayoutFields Base_DB_Table_Data::get_related_fi
{
type_vecConstLayoutFields result;
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(document)
{
const auto field_name = field->get_name(); //At the moment, relationships can not be based on related
fields on the from side.
diff --git a/glom/box_db_table.cc b/glom/box_db_table.cc
index cf3f9e6..d809b49 100644
--- a/glom/box_db_table.cc
+++ b/glom/box_db_table.cc
@@ -41,7 +41,7 @@ Box_DB_Table::~Box_DB_Table()
const Gtk::Window* Box_DB_Table::get_app_window() const
{
- Box_DB_Table* nonconst = const_cast<Box_DB_Table*>(this);
+ auto nonconst = const_cast<Box_DB_Table*>(this);
return nonconst->get_app_window();
}
diff --git a/glom/box_reports.cc b/glom/box_reports.cc
index e418ad2..1da8c1b 100644
--- a/glom/box_reports.cc
+++ b/glom/box_reports.cc
@@ -100,7 +100,7 @@ bool Box_Reports::fill_from_database()
m_colTitle = m_AddDel.add_column(_("Title"), AddDelColumnInfo::enumStyles::Text, editable, true);
std::vector<Glib::ustring> listTableReports;
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
for(const auto& item : document->get_report_names(m_table_name))
@@ -162,7 +162,7 @@ void Box_Reports::on_adddel_Edit(const Gtk::TreeModel::iterator& row)
{
Glib::ustring report_name = m_AddDel.get_value_key(row);
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
save_to_document();
@@ -208,7 +208,7 @@ void Box_Reports::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint c
if(get_userlevel() == AppState::userlevels::DEVELOPER)
{
const auto report_name = m_AddDel.get_value_key(row);
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<Report> report = document->get_report(m_table_name, report_name);
if(report)
diff --git a/glom/box_withbuttons.cc b/glom/box_withbuttons.cc
index de66f81..cb4ed5a 100644
--- a/glom/box_withbuttons.cc
+++ b/glom/box_withbuttons.cc
@@ -77,7 +77,7 @@ void Box_WithButtons::on_Button_Cancel()
const Gtk::Window* Box_WithButtons::get_app_window() const
{
- Box_WithButtons* nonconst = const_cast<Box_WithButtons*>(this);
+ auto nonconst = const_cast<Box_WithButtons*>(this);
return nonconst->get_app_window();
}
@@ -86,11 +86,11 @@ Gtk::Window* Box_WithButtons::get_app_window()
return dynamic_cast<Gtk::Window*>(get_toplevel());
/*
- Gtk::Widget* pWidget = get_parent();
+ auto pWidget = get_parent();
while(pWidget)
{
//Is this widget a Gtk::Window?:
- Gtk::Window* pWindow = dynamic_cast<Gtk::Window*>(pWidget);
+ auto pWindow = dynamic_cast<Gtk::Window*>(pWidget);
if(pWindow)
{
//Yes, return it.
diff --git a/glom/dialog_connection.cc b/glom/dialog_connection.cc
index c3e902e..7b5406d 100644
--- a/glom/dialog_connection.cc
+++ b/glom/dialog_connection.cc
@@ -65,7 +65,7 @@ std::shared_ptr<SharedConnection> Dialog_Connection::connect_to_server_with_conn
std::shared_ptr<SharedConnection> result;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
g_assert(connection_pool);
//Set the connection details in the ConnectionPool singleton.
@@ -81,8 +81,8 @@ std::shared_ptr<SharedConnection> Dialog_Connection::connect_to_server_with_conn
#ifdef GLOM_ENABLE_POSTGRESQL
if(document->get_hosting_mode() == Document::HostingMode::POSTGRES_CENTRAL)
{
- ConnectionPool::Backend* backend = connection_pool->get_backend();
- ConnectionPoolBackends::PostgresCentralHosted* central =
dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
+ auto backend = connection_pool->get_backend();
+ auto central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
g_assert(central);
central->set_host(m_entry_host->get_text());
@@ -99,12 +99,12 @@ std::shared_ptr<SharedConnection> Dialog_Connection::connect_to_server_with_conn
//Remember the port,
//to make opening faster next time,
//and so we can tell connecting clients (using browse network) what port to use:
- Document* unconst = const_cast<Document*>(document);
+ auto unconst = const_cast<Document*>(document);
if(document->get_hosting_mode() == Document::HostingMode::POSTGRES_CENTRAL)
{
- ConnectionPool::Backend* backend = connection_pool->get_backend();
- ConnectionPoolBackends::PostgresCentralHosted* central =
dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
+ auto backend = connection_pool->get_backend();
+ auto central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
g_assert(central);
unconst->set_connection_port(central->get_port() );
@@ -116,8 +116,8 @@ std::shared_ptr<SharedConnection> Dialog_Connection::connect_to_server_with_conn
#ifndef GLOM_ENABLE_CLIENT_ONLY
else if(document->get_hosting_mode() == Document::HostingMode::POSTGRES_SELF)
{
- ConnectionPool::Backend* backend = connection_pool->get_backend();
- ConnectionPoolBackends::PostgresSelfHosted* self =
dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
+ auto backend = connection_pool->get_backend();
+ auto self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
g_assert(self);
unconst->set_connection_port(self->get_port() );
@@ -132,7 +132,7 @@ std::shared_ptr<SharedConnection> Dialog_Connection::connect_to_server_with_conn
void Dialog_Connection::load_from_document()
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 995879e..3fb6796 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -449,7 +449,7 @@ std::shared_ptr<Gtk::TreeModel::iterator> Dialog_ExistingOrNew::create_dummy_ite
void Dialog_ExistingOrNew::existing_icon_data_func(Gtk::CellRenderer* renderer, const
Gtk::TreeModel::iterator& iter)
{
- Gtk::CellRendererPixbuf* pixbuf_renderer = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
+ auto pixbuf_renderer = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
if(!pixbuf_renderer)
throw std::logic_error("Renderer not a pixbuf renderer in existing_icon_data_func");
@@ -502,7 +502,7 @@ void Dialog_ExistingOrNew::existing_icon_data_func(Gtk::CellRenderer* renderer,
void Dialog_ExistingOrNew::existing_title_data_func(Gtk::CellRenderer* renderer, const
Gtk::TreeModel::iterator& iter)
{
- Gtk::CellRendererText* text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(!text_renderer)
throw std::logic_error("Renderer not a text renderer in existing_title_data_func");
@@ -526,7 +526,7 @@ void Dialog_ExistingOrNew::existing_title_data_func(Gtk::CellRenderer* renderer,
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Dialog_ExistingOrNew::new_icon_data_func(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
- Gtk::CellRendererPixbuf* pixbuf_renderer = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
+ auto pixbuf_renderer = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
if(!pixbuf_renderer)
throw std::logic_error("Renderer not a pixbuf renderer in new_icon_data_func");
@@ -555,7 +555,7 @@ void Dialog_ExistingOrNew::new_icon_data_func(Gtk::CellRenderer* renderer, const
void Dialog_ExistingOrNew::new_title_data_func(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
- Gtk::CellRendererText* text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(!text_renderer)
throw std::logic_error("Renderer not a text renderer in new_title_data_func");
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index a912297..bca56a2 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -108,7 +108,7 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
//QuickFind widgets:
//We don't use Glade for these, so it easier to modify them for the Maemo port.
m_pBox_QuickFind = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,
Utils::to_utype(UiUtils::DefaultSpacings::SMALL)));
- Gtk::Label* label = Gtk::manage(new Gtk::Label(_("Quick _search:"), true));
+ auto label = Gtk::manage(new Gtk::Label(_("Quick _search:"), true));
m_pBox_QuickFind->pack_start(*label, Gtk::PACK_SHRINK);
m_pEntry_QuickFind = Gtk::manage(new Gtk::Entry());
@@ -313,7 +313,7 @@ bool Frame_Glom::set_mode(enumModes mode)
void Frame_Glom::alert_no_table()
{
//Ask user to choose a table first:
- Gtk::Window* pWindowApp = get_app_window();
+ auto pWindowApp = get_app_window();
if(pWindowApp)
{
//TODO: Obviously this document should have been deleted when the database-creation was cancelled.
@@ -329,7 +329,7 @@ void Frame_Glom::show_table_refresh()
void Frame_Glom::show_table_allow_empty(const Glib::ustring& table_name, const Gnome::Gda::Value&
primary_key_value_for_details)
{
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
//This can take quite a long time, so we show the busy cursor while it's working:
BusyCursor busy_cursor(pApp);
@@ -361,7 +361,7 @@ void Frame_Glom::show_table_allow_empty(const Glib::ustring& table_name, const G
//Start with the last-used found set (sort order and where clause)
//for this layout:
//(This would be ignored anyway if a details primary key is specified.)
- Document* document = get_document();
+ auto document = get_document();
if(document)
found_set = document->get_criteria_current(m_table_name);
@@ -455,12 +455,12 @@ void Frame_Glom::show_no_table()
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool Frame_Glom::attempt_change_usermode_to_developer()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
//Check whether the current user has developer privileges:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
std::shared_ptr<SharedConnection> sharedconnection = connection_pool->connect();
// Default to true; if we don't support users, we always have
@@ -521,7 +521,7 @@ bool Frame_Glom::attempt_change_usermode_to_developer()
bool Frame_Glom::attempt_change_usermode_to_operator()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
@@ -534,13 +534,13 @@ void Frame_Glom::on_menu_file_export()
{
//Start with a sequence based on the Details view:
//The user can changed this by clicking the button in the FileChooser:
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
Document::type_list_layout_groups mapGroupSequence =
document->get_data_layout_groups_plus_new_fields("details", m_table_name,
get_active_layout_platform(document));
- Gtk::Window* pWindowApp = get_app_window();
+ auto pWindowApp = get_app_window();
g_assert(pWindowApp);
//Do not try to export the data if the user may not view it:
@@ -800,7 +800,7 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
{
//Prevent this change if not in developer mode,
//though the menu item should be disabled then anyway.
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document || document->get_userlevel() != AppState::userlevels::DEVELOPER)
return false;
@@ -844,7 +844,7 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
if(initial_password_provided && added)
{
//Use the new user/password from now on:
- ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ auto connectionpool = ConnectionPool::get_instance();
connectionpool->set_user(user);
connectionpool->set_password(password);
}
@@ -879,14 +879,14 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
if(default_user_exists)
{
//Force a reconnection with the new password:
- //ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ //auto connectionpool = ConnectionPool::get_instance();
//Remove it, after stopping it from being the database owner:
bool disabled = true;
Glib::ustring default_password;
const auto default_user = Privs::get_default_developer_user_name(default_password, hosting_mode);
- ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ auto connectionpool = ConnectionPool::get_instance();
const auto reowned = set_database_owner_user(connectionpool->get_user());
bool removed = false;
if(reowned)
@@ -969,7 +969,7 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
//and start it again:
if(change)
{
- ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ auto connectionpool = ConnectionPool::get_instance();
std::shared_ptr<SharedConnection> sharedconnection = connectionpool->connect();
if(sharedconnection)
{
@@ -996,7 +996,7 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
}
//Update the UI:
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
{
pApp->update_network_shared_ui();
@@ -1008,7 +1008,7 @@ bool Frame_Glom::attempt_toggle_shared(bool shared)
void Frame_Glom::on_menu_file_print()
{
- Notebook_Glom* notebook_current = dynamic_cast<Notebook_Glom*>(m_stack_mode->get_visible_child());
+ auto notebook_current = dynamic_cast<Notebook_Glom*>(m_stack_mode->get_visible_child());
if(notebook_current)
notebook_current->do_menu_file_print();
}
@@ -1109,7 +1109,7 @@ void Frame_Glom::on_menu_Tables_AddRelatedTable()
m_dialog_addrelatedtable->signal_response().connect( sigc::mem_fun(*this,
&Frame_Glom::on_dialog_add_related_table_response) );
- Gtk::Window* parent = get_app_window();
+ auto parent = get_app_window();
if(parent)
m_dialog_addrelatedtable->set_transient_for(*parent);
@@ -1136,7 +1136,7 @@ void Frame_Glom::on_dialog_add_related_table_response(int response)
Glib::ustring table_name, relationship_name, from_key_name;
m_dialog_addrelatedtable->get_input(table_name, relationship_name, from_key_name);
- Gtk::Window* parent = get_app_window();
+ auto parent = get_app_window();
//It would be nice to put this in the dialog's on_response() instead,
//but I don't think we can stop the response from being returned. murrayc
@@ -1194,7 +1194,7 @@ void Frame_Glom::on_dialog_add_related_table_response(int response)
relationship->set_allow_edit(true);
relationship->set_auto_create(true);
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -1236,7 +1236,7 @@ void Frame_Glom::do_menu_Navigate_Table(bool open_default)
m_pDialog_Tables = new Window_BoxHolder(m_pBox_Tables, _("Edit Tables"));
m_pDialog_Tables->signal_hide().connect(sigc::mem_fun(*this, &Frame_Glom::on_dialog_tables_hide));
- Gtk::Window* pWindow = get_app_window();
+ auto pWindow = get_app_window();
if(pWindow)
m_pDialog_Tables->set_transient_for(*pWindow);
@@ -1269,17 +1269,17 @@ void Frame_Glom::do_menu_Navigate_Table(bool open_default)
const Gtk::Window* Frame_Glom::get_app_window() const
{
- Frame_Glom* nonconst = const_cast<Frame_Glom*>(this);
+ auto nonconst = const_cast<Frame_Glom*>(this);
return nonconst->get_app_window();
}
Gtk::Window* Frame_Glom::get_app_window()
{
- Gtk::Widget* pWidget = get_parent();
+ auto pWidget = get_parent();
while(pWidget)
{
//Is this widget a Gtk::Window?:
- Gtk::Window* pWindow = dynamic_cast<Gtk::Window*>(pWidget);
+ auto pWindow = dynamic_cast<Gtk::Window*>(pWidget);
if(pWindow)
{
//Yes, return it.
@@ -1309,7 +1309,7 @@ void Frame_Glom::on_button_quickfind()
void Frame_Glom::on_notebook_find_criteria(const Gnome::Gda::SqlExpr& where_clause)
{
- AppWindow* app = dynamic_cast<AppWindow*>(get_app_window());
+ auto app = dynamic_cast<AppWindow*>(get_app_window());
if(!app)
{
std::cerr << G_STRFUNC << ": get_app_window() failed." << std::endl;
@@ -1392,7 +1392,7 @@ void Frame_Glom::on_userlevel_changed(AppState::userlevels /* userlevel */)
void Frame_Glom::show_table_title()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return;
@@ -1432,7 +1432,7 @@ void Frame_Glom::update_table_in_document_from_database()
" Falling back to the field details in the document." << std::endl;
}
- Document* pDoc = dynamic_cast<Document*>(get_document());
+ auto pDoc = dynamic_cast<Document*>(get_document());
if(pDoc)
{
bool document_must_be_updated = false;
@@ -1513,7 +1513,7 @@ void Frame_Glom::set_document(Document* pDocument)
{
View_Composite_Glom::set_document(pDocument);
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
//Connect to a signal that is only on the derived document class:
@@ -1526,7 +1526,7 @@ void Frame_Glom::set_document(Document* pDocument)
void Frame_Glom::load_from_document()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
//Call base class:
@@ -1556,7 +1556,7 @@ void Frame_Glom::on_menu_developer_database_preferences()
void Frame_Glom::on_menu_developer_fields()
{
- Gtk::Window* parent = get_app_window();
+ auto parent = get_app_window();
if(parent)
do_menu_developer_fields(*parent);
@@ -1574,7 +1574,7 @@ void Frame_Glom::do_menu_developer_fields(Gtk::Window& parent, const Glib::ustri
// Some database backends (SQLite) require the table to change to no longer
// be in use when changing the records, so we stop the database usage
// here. We reshow everything in on_developer_dialog_hide() anyway.
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document && document->get_hosting_mode() == Document::HostingMode::SQLITE)
show_no_table();
@@ -1648,7 +1648,7 @@ void Frame_Glom::on_menu_developer_relationships()
if(m_table_name.empty())
return;
- Gtk::Window* app = get_app_window();
+ auto app = get_app_window();
if(app)
do_menu_developer_relationships(*app, m_table_name);
}
@@ -1681,7 +1681,7 @@ void Frame_Glom::on_menu_developer_layout()
if(m_table_name.empty())
return;
- Notebook_Glom* notebook_current = dynamic_cast<Notebook_Glom*>(m_stack_mode->get_visible_child());
+ auto notebook_current = dynamic_cast<Notebook_Glom*>(m_stack_mode->get_visible_child());
if(notebook_current)
notebook_current->do_menu_developer_layout();
}
@@ -1798,7 +1798,7 @@ void Frame_Glom::add_window_to_app(Gtk::ApplicationWindow* window)
return;
}
- Gtk::Window* app_window = get_app_window();
+ auto app_window = get_app_window();
if(!app_window)
{
std::cerr << G_STRFUNC << ": app_window is null" << std::endl;
@@ -1817,7 +1817,7 @@ void Frame_Glom::add_window_to_app(Gtk::ApplicationWindow* window)
void Frame_Glom::on_box_print_layouts_selected(const Glib::ustring& print_layout_name)
{
- Gtk::Window* app_window = get_app_window();
+ auto app_window = get_app_window();
if(!app_window)
{
std::cerr << G_STRFUNC << ": app_window is null" << std::endl;
@@ -1926,7 +1926,7 @@ bool Frame_Glom::connection_request_initial_password(Glib::ustring& user, Glib::
user = Glib::ustring();
password = Glib::ustring();
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
@@ -1978,11 +1978,11 @@ bool Frame_Glom::connection_request_initial_password(Glib::ustring& user, Glib::
bool Frame_Glom::connection_request_password_and_choose_new_database_name()
{
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
connection_pool->setup_from_document(document);
if(!m_pDialogConnection)
@@ -2164,8 +2164,8 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
#ifdef GLOM_ENABLE_POSTGRESQL
if(document->get_hosting_mode() == Document::HostingMode::POSTGRES_CENTRAL)
{
- ConnectionPool::Backend* backend = connection_pool->get_backend();
- ConnectionPoolBackends::PostgresCentralHosted* central =
dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
+ auto backend = connection_pool->get_backend();
+ auto central = dynamic_cast<ConnectionPoolBackends::PostgresCentralHosted*>(backend);
g_assert(central);
document->set_connection_server(central->get_host());
@@ -2181,8 +2181,8 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
// somehow avoid this code duplication.
else if(document->get_hosting_mode() == Document::HostingMode::POSTGRES_SELF)
{
- ConnectionPool::Backend* backend = connection_pool->get_backend();
- ConnectionPoolBackends::PostgresSelfHosted* self =
dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
+ auto backend = connection_pool->get_backend();
+ auto self = dynamic_cast<ConnectionPoolBackends::PostgresSelfHosted*>(backend);
g_assert(self);
document->set_connection_port(self->get_port());
@@ -2204,7 +2204,7 @@ bool Frame_Glom::connection_request_password_and_choose_new_database_name()
void Frame_Glom::cleanup_connection()
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
ShowProgressMessage progress_message(_("Stopping Database Server"));
connection_pool->cleanup( sigc::mem_fun(*this, &Frame_Glom::on_connection_cleanup_progress) );
}
@@ -2244,13 +2244,13 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
//Initialize output parameter:
database_not_found = false;
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return false;
//Start a self-hosted server if necessary:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
ShowProgressMessage progress_message(_("Starting Database Server"));
connection_pool->setup_from_document(document);
const ConnectionPool::StartupErrors started =
@@ -2262,7 +2262,7 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
//TODO: Output more exact details of the error message.
}
- AppWindow* app = dynamic_cast<AppWindow*>(get_app_window());
+ auto app = dynamic_cast<AppWindow*>(get_app_window());
if(!app)
{
std::cerr << G_STRFUNC << ": app is null." << std::endl;
@@ -2346,7 +2346,7 @@ bool Frame_Glom::connection_request_password_and_attempt(bool& database_not_foun
else
{
//Use the known password:
- ConnectionPool* connectionpool = ConnectionPool::get_instance();
+ auto connectionpool = ConnectionPool::get_instance();
connectionpool->set_user(known_username);
connectionpool->set_password(known_password);
@@ -2377,7 +2377,7 @@ bool Frame_Glom::create_database(const Glib::ustring& database_name, const Glib:
{
bool result = false;
- Gtk::Window* pWindowApp = get_app_window();
+ auto pWindowApp = get_app_window();
g_assert(pWindowApp);
{
@@ -2420,7 +2420,7 @@ void Frame_Glom::on_menu_report_selected(const Glib::ustring& report_name)
return;
}
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<Report> report = document->get_report(m_table_name, report_name);
if(!report)
return;
@@ -2471,7 +2471,7 @@ void Frame_Glom::do_print_layout(const Glib::ustring& print_layout_name, bool pr
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Frame_Glom::on_dialog_layout_report_hide()
{
- Document* document = get_document();
+ auto document = get_document();
if(document && true) //m_pDialogLayoutReport->get_modified())
{
@@ -2484,14 +2484,14 @@ void Frame_Glom::on_dialog_layout_report_hide()
}
//Update the reports menu:
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
pApp->fill_menu_reports(m_table_name);
}
void Frame_Glom::on_dialog_layout_print_hide()
{
- Document* document = get_document();
+ auto document = get_document();
if(document && true) //m_pDialogLayoutReport->get_modified())
{
@@ -2504,7 +2504,7 @@ void Frame_Glom::on_dialog_layout_print_hide()
}
//Update the print layouts menu:
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
pApp->fill_menu_print_layouts(m_table_name);
}
@@ -2513,7 +2513,7 @@ void Frame_Glom::on_dialog_layout_print_hide()
void Frame_Glom::on_dialog_tables_hide()
{
//If tables could have been added or removed, update the tables menu:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
// This is never true in client only mode, so we can as well save the
@@ -2521,7 +2521,7 @@ void Frame_Glom::on_dialog_tables_hide()
#ifndef GLOM_ENABLE_CLIENT_ONLY
if(document->get_userlevel() == AppState::userlevels::DEVELOPER)
{
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
pApp->fill_menu_tables();
@@ -2543,7 +2543,7 @@ void Frame_Glom::on_dialog_tables_hide()
void Frame_Glom::on_notebook_data_switch_page(Gtk::Widget* /* page */)
{
//Refill this menu, because it depends on whether list or details are visible:
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
pApp->fill_menu_print_layouts(m_table_name);
}
@@ -2561,7 +2561,7 @@ void Frame_Glom::on_notebook_data_record_selection_changed()
if(!found_set.m_where_clause.empty())
something_selected = true;
- AppWindow* pApp = dynamic_cast<AppWindow*>(get_app_window());
+ auto pApp = dynamic_cast<AppWindow*>(get_app_window());
if(pApp)
pApp->enable_menu_print_layouts_details(something_selected);
}
diff --git a/glom/glom_create_from_example.cc b/glom/glom_create_from_example.cc
index 84c9ee9..0f83b6c 100644
--- a/glom/glom_create_from_example.cc
+++ b/glom/glom_create_from_example.cc
@@ -207,7 +207,7 @@ static Glib::ustring convert_filepath_to_uri(const std::string& filepath)
static void cleanup()
{
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
const auto stopped = connection_pool->cleanup( sigc::ptr_fun(&on_cleanup_progress) );
g_assert(stopped);
@@ -372,7 +372,7 @@ int main(int argc, char* argv[])
g_assert(document.get_is_example_file());;
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
//Save a copy, specifying the path to file in a directory:
filepath_dir =
@@ -468,8 +468,8 @@ int main(int argc, char* argv[])
connection_pool->set_user(group.m_arg_server_username);
connection_pool->set_password(password); //TODO: Take this from stdin instead.
- Glom::ConnectionPool::Backend* backend = connection_pool->get_backend();
- Glom::ConnectionPoolBackends::PostgresCentralHosted* central =
+ auto backend = connection_pool->get_backend();
+ auto central =
dynamic_cast<Glom::ConnectionPoolBackends::PostgresCentralHosted*>(backend);
g_assert(central);
diff --git a/glom/glom_test_connection.cc b/glom/glom_test_connection.cc
index ff3618b..7b9b5f7 100644
--- a/glom/glom_test_connection.cc
+++ b/glom/glom_test_connection.cc
@@ -190,7 +190,7 @@ int main(int argc, char* argv[])
#endif
//Setup the connection, assuming that we are testing central hosting:
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
//Specify the backend and backend-specific details to be used by the connectionpool.
//This is usually done by ConnectionPool::setup_from_document():
@@ -200,7 +200,7 @@ int main(int argc, char* argv[])
{
//TODO: Move some of the *CentralHosted API into a multiply-inherited Server base class,
//to avoid the duplication?
- Glom::ConnectionPoolBackends::MySQLCentralHosted* derived_backend = new
Glom::ConnectionPoolBackends::MySQLCentralHosted;
+ auto derived_backend = new Glom::ConnectionPoolBackends::MySQLCentralHosted;
//Use a specified port, or try all suitable ports:
if(group.m_arg_server_port)
@@ -219,7 +219,7 @@ int main(int argc, char* argv[])
else
#endif //GLOM_ENABLE_MYSQL
{
- Glom::ConnectionPoolBackends::PostgresCentralHosted* derived_backend = new
Glom::ConnectionPoolBackends::PostgresCentralHosted;
+ auto derived_backend = new Glom::ConnectionPoolBackends::PostgresCentralHosted;
//Use a specified port, or try all suitable ports:
if(group.m_arg_server_port)
diff --git a/glom/import_csv/dialog_import_csv.cc b/glom/import_csv/dialog_import_csv.cc
index 93abe16..ff7486b 100644
--- a/glom/import_csv/dialog_import_csv.cc
+++ b/glom/import_csv/dialog_import_csv.cc
@@ -526,7 +526,7 @@ void Dialog_Import_CSV::setup_sample_model(const CsvParser::type_row_strings& ro
Gtk::TreeViewColumn* Dialog_Import_CSV::create_sample_column(const Glib::ustring& title, guint index)
{
- Gtk::TreeViewColumn* col = new Gtk::TreeViewColumn(title);
+ auto col = new Gtk::TreeViewColumn(title);
auto cell = create_sample_cell(index);
col->pack_start(*Gtk::manage(cell), true);
col->set_cell_data_func(*cell, sigc::bind(sigc::mem_fun(*this, &Dialog_Import_CSV::field_data_func),
index));
@@ -536,7 +536,7 @@ Gtk::TreeViewColumn* Dialog_Import_CSV::create_sample_column(const Glib::ustring
Gtk::CellRendererCombo* Dialog_Import_CSV::create_sample_cell(guint index)
{
- Gtk::CellRendererCombo* cell = new Gtk::CellRendererCombo;
+ auto cell = new Gtk::CellRendererCombo;
cell->property_model() = m_field_model_sorted;
cell->property_text_column() = 0;
cell->property_has_entry() = false;
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index fbe3e18..9dd704a 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -145,14 +145,14 @@ void ConnectionPool::setup_from_document(const Document* document)
{
case Document::HostingMode::POSTGRES_SELF:
{
- ConnectionPoolBackends::PostgresSelfHosted* backend = new ConnectionPoolBackends::PostgresSelfHosted;
+ auto backend = new ConnectionPoolBackends::PostgresSelfHosted;
backend->set_database_directory_uri(document->get_connection_self_hosted_directory_uri());
set_backend(std::shared_ptr<ConnectionPool::Backend>(backend));
}
break;
case Document::HostingMode::POSTGRES_CENTRAL:
{
- ConnectionPoolBackends::PostgresCentralHosted* backend = new
ConnectionPoolBackends::PostgresCentralHosted;
+ auto backend = new ConnectionPoolBackends::PostgresCentralHosted;
backend->set_host(document->get_connection_server());
backend->set_port(document->get_connection_port());
backend->set_try_other_ports(document->get_connection_try_other_ports());
@@ -161,21 +161,21 @@ void ConnectionPool::setup_from_document(const Document* document)
break;
case Document::HostingMode::SQLITE:
{
- ConnectionPoolBackends::Sqlite* backend = new ConnectionPoolBackends::Sqlite;
+ auto backend = new ConnectionPoolBackends::Sqlite;
backend->set_database_directory_uri(document->get_connection_self_hosted_directory_uri());
set_backend(std::shared_ptr<ConnectionPool::Backend>(backend));
}
break;
case Document::HostingMode::MYSQL_SELF:
{
- ConnectionPoolBackends::MySQLSelfHosted* backend = new ConnectionPoolBackends::MySQLSelfHosted;
+ auto backend = new ConnectionPoolBackends::MySQLSelfHosted;
backend->set_database_directory_uri(document->get_connection_self_hosted_directory_uri());
set_backend(std::shared_ptr<ConnectionPool::Backend>(backend));
}
break;
case Document::HostingMode::MYSQL_CENTRAL:
{
- ConnectionPoolBackends::MySQLCentralHosted* backend = new ConnectionPoolBackends::MySQLCentralHosted;
+ auto backend = new ConnectionPoolBackends::MySQLCentralHosted;
backend->set_host(document->get_connection_server());
backend->set_port(document->get_connection_port());
backend->set_try_other_ports(document->get_connection_try_other_ports());
@@ -231,7 +231,7 @@ const ConnectionPool::Backend* ConnectionPool::get_backend() const
bool ConnectionPool::get_backend_supports_cursor() const
{
//TODO: Is there a generic libgda way to discover this?
- const ConnectionPoolBackends::Sqlite* sqlite_backend =
+ const auto sqlite_backend =
dynamic_cast<const ConnectionPoolBackends::Sqlite*>(get_backend());
return !sqlite_backend;
}
@@ -241,7 +241,7 @@ std::shared_ptr<SharedConnection> ConnectionPool::get_and_connect()
{
std::shared_ptr<SharedConnection> result;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return result;
@@ -258,7 +258,7 @@ std::shared_ptr<SharedConnection> ConnectionPool::get_and_connect()
bool ConnectionPool::get_instance_is_ready()
{
- ConnectionPool* instance = get_instance();
+ auto instance = get_instance();
if(!instance)
return false;
@@ -384,7 +384,7 @@ std::shared_ptr<SharedConnection> ConnectionPool::connect()
//to avoid duplicates.
//TODO: Only advertize if it makes sense for the backend,
//it does not for sqlite
- Document* document = get_document();
+ auto document = get_document();
if(document && document->get_network_shared())
avahi_start_publishing(); //Stopped in the signal_finished handler.
#endif // !G_OS_WIN32
@@ -611,7 +611,7 @@ static sighandler_t previous_sig_handler = SIG_DFL; /* Arbitrary default */
*/
static void on_linux_signal(int signum)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return;
@@ -830,7 +830,7 @@ Document* ConnectionPool::get_document()
//static
EpcContents* ConnectionPool::on_publisher_document_requested(EpcPublisher* /* publisher */, const gchar* /*
key */, gpointer user_data)
{
- Glom::ConnectionPool* connection_pool = static_cast<Glom::ConnectionPool*>(user_data);
+ auto connection_pool = static_cast<Glom::ConnectionPool*>(user_data);
if(!connection_pool)
return 0;
@@ -851,7 +851,7 @@ gboolean ConnectionPool::on_publisher_document_authentication(EpcAuthContext* co
{
g_return_val_if_fail(context, false);
- ConnectionPool* connection_pool = (ConnectionPool*)(user_data);
+ auto connection_pool = (ConnectionPool*)(user_data);
g_return_val_if_fail(connection_pool, false);
// Check if the username/password are correct:
@@ -883,7 +883,7 @@ void ConnectionPool::on_epc_progress_begin(const gchar* /* title */, gpointer us
{
//We ignore the title parameter because there is no way that libepc could know what Glom wants to say.
- ConnectionPool* connection_pool = (ConnectionPool*)user_data;
+ auto connection_pool = (ConnectionPool*)user_data;
if(connection_pool && connection_pool->m_epc_slot_begin)
connection_pool->m_epc_slot_begin();
}
@@ -893,14 +893,14 @@ void ConnectionPool::on_epc_progress_update(gdouble /* progress */, const gchar*
//We ignore the title parameter because there is no way that libepc could know what Glom wants to say.
//TODO: Show the progress in a ProgressBar.
- ConnectionPool* connection_pool = (ConnectionPool*)user_data;
+ auto connection_pool = (ConnectionPool*)user_data;
if(connection_pool && connection_pool->m_epc_slot_progress)
connection_pool->m_epc_slot_progress();
}
void ConnectionPool::on_epc_progress_end(gpointer user_data)
{
- ConnectionPool* connection_pool = (ConnectionPool*)user_data;
+ auto connection_pool = (ConnectionPool*)user_data;
if(connection_pool && connection_pool->m_epc_slot_done)
connection_pool->m_epc_slot_done();
}
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index a5f9af8..498e375 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -129,7 +129,7 @@ bool create_database(Document* document, const Glib::ustring& database_name, con
progress();
//Connect to the actual database:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
connection_pool->set_database(database_name);
if(progress)
@@ -197,8 +197,8 @@ bool create_database(Document* document, const Glib::ustring& database_name, con
progress();
//Save the port, if appropriate, so the document can be used to connect again:
- Glom::ConnectionPool::Backend* backend = connection_pool->get_backend();
- Glom::ConnectionPoolBackends::PostgresCentralHosted* central =
+ auto backend = connection_pool->get_backend();
+ auto central =
dynamic_cast<Glom::ConnectionPoolBackends::PostgresCentralHosted*>(backend);
if(central)
{
@@ -216,7 +216,7 @@ bool create_database(Document* document, const Glib::ustring& database_name, con
bool recreate_database_from_document(Document* document, const std::function<void()>& progress)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(!connection_pool)
return false; //Impossible anyway.
@@ -1329,7 +1329,7 @@ bool create_table_add_missing_fields(const std::shared_ptr<const TableInfo>& tab
bool add_column(const Glib::ustring& table_name, const std::shared_ptr<const Field>& field, Gtk::Window* /*
parent_window */)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
try
{
@@ -1348,7 +1348,7 @@ bool add_column(const Glib::ustring& table_name, const std::shared_ptr<const Fie
bool drop_column(const Glib::ustring& table_name, const Glib::ustring& field_name)
{
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
try
{
@@ -1908,7 +1908,7 @@ bool layout_field_should_have_navigation(const Glib::ustring& table_name, const
Glib::ustring get_unused_database_name(const Glib::ustring& base_name)
{
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
if(!connection_pool)
return Glib::ustring();
@@ -2246,8 +2246,8 @@ bool remove_user_from_group(const Glib::ustring& user, const Glib::ustring& grou
void set_fake_connection()
{
//Allow a fake connection, so sqlbuilder_get_full_query() can work:
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
- Glom::ConnectionPoolBackends::Backend* backend =
+ auto connection_pool = Glom::ConnectionPool::get_instance();
+ auto backend =
new Glom::ConnectionPoolBackends::PostgresCentralHosted();
connection_pool->set_backend(std::shared_ptr<Glom::ConnectionPool::Backend>(backend));
connection_pool->set_fake_connection();
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index c15b4b5..07fc7d2 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -2710,7 +2710,7 @@ bool Document::load_after(int& failure_code)
field->set_auto_increment( XmlUtils::get_node_attribute_value_as_bool(node_field,
GLOM_ATTRIBUTE_AUTOINCREMENT) );
//Get lookup information, if present.
- xmlpp::Element* nodeLookup = XmlUtils::get_node_child_named(node_field,
GLOM_NODE_FIELD_LOOKUP);
+ auto nodeLookup = XmlUtils::get_node_child_named(node_field, GLOM_NODE_FIELD_LOOKUP);
if(nodeLookup)
{
const auto lookup_relationship_name = XmlUtils::get_node_attribute_value(nodeLookup,
GLOM_ATTRIBUTE_RELATIONSHIP_NAME);
@@ -2815,7 +2815,7 @@ bool Document::load_after(int& failure_code)
//before we can load layouts that can use them.
for(const auto& node_table : list_nodes_tables)
{
- xmlpp::Element* nodeTable = dynamic_cast<xmlpp::Element*>(node_table);
+ auto nodeTable = dynamic_cast<xmlpp::Element*>(node_table);
if(nodeTable)
{
const auto table_name = XmlUtils::get_node_attribute_value(nodeTable, GLOM_ATTRIBUTE_NAME);
@@ -2827,7 +2827,7 @@ bool Document::load_after(int& failure_code)
{
for(const auto& item : nodeDataLayouts->get_children(GLOM_NODE_DATA_LAYOUT))
{
- xmlpp::Element* node_data_layout = dynamic_cast<xmlpp::Element*>(item);
+ auto node_data_layout = dynamic_cast<xmlpp::Element*>(item);
if(node_data_layout)
{
const auto layout_name = XmlUtils::get_node_attribute_value(node_data_layout,
GLOM_ATTRIBUTE_NAME);
@@ -2872,7 +2872,7 @@ bool Document::load_after(int& failure_code)
{
for(const auto& item_report : nodeReports->get_children(GLOM_NODE_REPORT))
{
- xmlpp::Element* node_report = dynamic_cast<xmlpp::Element*>(item_report);
+ auto node_report = dynamic_cast<xmlpp::Element*>(item_report);
if(node_report)
{
const auto report_name = XmlUtils::get_node_attribute_value(node_report,
GLOM_ATTRIBUTE_NAME);
@@ -2917,7 +2917,7 @@ bool Document::load_after(int& failure_code)
{
for(const auto& item_print_layout : nodePrintLayouts->get_children(GLOM_NODE_PRINT_LAYOUT))
{
- xmlpp::Element* node_print_layout = dynamic_cast<xmlpp::Element*>(item_print_layout);
+ auto node_print_layout = dynamic_cast<xmlpp::Element*>(item_print_layout);
if(node_print_layout)
{
const auto name = XmlUtils::get_node_attribute_value(node_print_layout, GLOM_ATTRIBUTE_NAME);
@@ -3005,7 +3005,7 @@ bool Document::load_after(int& failure_code)
{
for(const auto& item_group : nodeGroups->get_children(GLOM_NODE_GROUP))
{
- xmlpp::Element* node_group = dynamic_cast<xmlpp::Element*>(item_group);
+ auto node_group = dynamic_cast<xmlpp::Element*>(item_group);
if(node_group)
{
GroupInfo group_info;
@@ -3015,7 +3015,7 @@ bool Document::load_after(int& failure_code)
for(const auto& item_priv : node_group->get_children(GLOM_NODE_TABLE_PRIVS))
{
- xmlpp::Element* node_priv = dynamic_cast<xmlpp::Element*>(item_priv);
+ auto node_priv = dynamic_cast<xmlpp::Element*>(item_priv);
if(node_priv)
{
const auto priv_table_name = XmlUtils::get_node_attribute_value(node_priv,
GLOM_ATTRIBUTE_TABLE_NAME);
@@ -3044,7 +3044,7 @@ bool Document::load_after(int& failure_code)
{
for(const auto& item : nodeModules->get_children(GLOM_NODE_LIBRARY_MODULE))
{
- xmlpp::Element* node_lib_module = dynamic_cast<xmlpp::Element*>(item);
+ auto node_lib_module = dynamic_cast<xmlpp::Element*>(item);
if(node_lib_module)
{
//The name is in an attribute:
@@ -3142,10 +3142,10 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
{
if(format.get_has_custom_choices())
{
- xmlpp::Element* child = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_CUSTOM_LIST);
+ auto child = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_CUSTOM_LIST);
for(const auto& value : format.get_choices_custom())
{
- xmlpp::Element* childChoice = child->add_child(GLOM_NODE_FORMAT_CUSTOM_CHOICE);
+ auto childChoice = child->add_child(GLOM_NODE_FORMAT_CUSTOM_CHOICE);
save_before_choicevalue(childChoice, value, field_type);
}
}
@@ -3172,14 +3172,14 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
//Save the extra fields to show for related choices:
if(choice_extra_layouts)
{
- xmlpp::Element* nodeExtraLayout =
nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_EXTRA_LAYOUT);
- xmlpp::Element* nodeGroups = nodeExtraLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
+ auto nodeExtraLayout = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_EXTRA_LAYOUT);
+ auto nodeGroups = nodeExtraLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
save_before_layout_group(nodeGroups, choice_extra_layouts);
}
if(!choice_sort_fields.empty())
{
- xmlpp::Element* nodeSortBy = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SORTBY);
+ auto nodeSortBy = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SORTBY);
save_before_sort_by(nodeSortBy, choice_sort_fields);
}
}
@@ -3209,7 +3209,7 @@ void Document::save_before_layout_item_field(xmlpp::Element* nodeItem, const std
std::shared_ptr<const CustomTitle> custom_title = field->get_title_custom();
if(custom_title)
{
- xmlpp::Element* elementCustomTitle = nodeItem->add_child(GLOM_NODE_LAYOUT_ITEM_CUSTOM_TITLE);
+ auto elementCustomTitle = nodeItem->add_child(GLOM_NODE_LAYOUT_ITEM_CUSTOM_TITLE);
XmlUtils::set_node_attribute_value_as_bool(elementCustomTitle,
GLOM_ATTRIBUTE_LAYOUT_ITEM_CUSTOM_TITLE_USE, custom_title->get_use_custom_title());
save_before_translations(elementCustomTitle, custom_title);
@@ -3225,7 +3225,7 @@ void Document::save_before_sort_by(xmlpp::Element* node, const LayoutItem_GroupB
{
std::shared_ptr<const LayoutItem_Field> field = field_pair.first;
- xmlpp::Element* nodeChild = node->add_child(GLOM_NODE_DATA_LAYOUT_ITEM_FIELD);
+ auto nodeChild = node->add_child(GLOM_NODE_DATA_LAYOUT_ITEM_FIELD);
save_before_layout_item_field(nodeChild, field);
XmlUtils::set_node_attribute_value_as_bool(nodeChild, GLOM_ATTRIBUTE_SORT_ASCENDING, field_pair.second);
@@ -3248,21 +3248,21 @@ void Document::save_before_layout_group(xmlpp::Element* node, const std::shared_
if(group_by->get_has_field_group_by())
{
- xmlpp::Element* nodeGroupBy = child->add_child(GLOM_NODE_REPORT_ITEM_GROUPBY_GROUPBY);
+ auto nodeGroupBy = child->add_child(GLOM_NODE_REPORT_ITEM_GROUPBY_GROUPBY);
save_before_layout_item_field(nodeGroupBy, group_by->get_field_group_by());
}
//Sort fields:
if(group_by->get_has_fields_sort_by())
{
- xmlpp::Element* nodeSortBy = child->add_child(GLOM_NODE_REPORT_ITEM_GROUPBY_SORTBY);
+ auto nodeSortBy = child->add_child(GLOM_NODE_REPORT_ITEM_GROUPBY_SORTBY);
save_before_sort_by(nodeSortBy, group_by->get_fields_sort_by());
}
//Secondary fields:
if(!group_by->get_secondary_fields()->m_list_items.empty())
{
- xmlpp::Element* secondary_fields = child->add_child(GLOM_NODE_DATA_LAYOUT_GROUP_SECONDARYFIELDS);
+ auto secondary_fields = child->add_child(GLOM_NODE_DATA_LAYOUT_GROUP_SECONDARYFIELDS);
save_before_layout_group(secondary_fields, group_by->get_secondary_fields(),
with_print_layout_positions);
}
}
@@ -3336,7 +3336,7 @@ void Document::save_before_layout_group(xmlpp::Element* node, const std::shared_
//In that case we don't even write the node, to keep the XML small:
if(!navigation_type_string.empty())
{
- xmlpp::Element* child_navigation_relationship =
child->add_child(GLOM_NODE_DATA_LAYOUT_PORTAL_NAVIGATIONRELATIONSHIP);
+ auto child_navigation_relationship =
child->add_child(GLOM_NODE_DATA_LAYOUT_PORTAL_NAVIGATIONRELATIONSHIP);
save_before_layout_item_usesrelationship(child_navigation_relationship,
relationship_navigation_specific);
XmlUtils::set_node_attribute_value(child_navigation_relationship,
@@ -3451,7 +3451,7 @@ void Document::save_before_layout_group(xmlpp::Element* node, const std::shared_
save_before_translations(nodeItem, textobject);
//The text is translatable too, so we use a node for it:
- xmlpp::Element* element_text = nodeItem->add_child(GLOM_NODE_DATA_LAYOUT_TEXTOBJECT_TEXT);
+ auto element_text = nodeItem->add_child(GLOM_NODE_DATA_LAYOUT_TEXTOBJECT_TEXT);
save_before_translations(element_text, textobject->m_text);
}
else
@@ -3462,7 +3462,7 @@ void Document::save_before_layout_group(xmlpp::Element* node, const std::shared_
nodeItem = child->add_child(GLOM_NODE_DATA_LAYOUT_IMAGEOBJECT);
save_before_translations(nodeItem, imageobject);
- xmlpp::Element* nodeValue = nodeItem->add_child(GLOM_NODE_VALUE);
+ auto nodeValue = nodeItem->add_child(GLOM_NODE_VALUE);
XmlUtils::set_node_text_child_as_value(nodeValue, imageobject->get_image(),
Field::glom_field_type::IMAGE);
}
else
@@ -3500,7 +3500,7 @@ void Document::save_before_layout_group(xmlpp::Element* node, const std::shared_
std::shared_ptr<const LayoutItem_WithFormatting> withformatting = std::dynamic_pointer_cast<const
LayoutItem_WithFormatting>(item);
if(withformatting)
{
- xmlpp::Element* elementFormat = nodeItem->add_child(GLOM_NODE_FORMAT);
+ auto elementFormat = nodeItem->add_child(GLOM_NODE_FORMAT);
save_before_layout_item_formatting(elementFormat, withformatting);
}
}
@@ -3535,12 +3535,12 @@ void Document::save_before_translations(xmlpp::Element* element, const std::shar
if(!item->get_has_translations())
return;
- xmlpp::Element* child = element->add_child(GLOM_NODE_TRANSLATIONS_SET);
+ auto child = element->add_child(GLOM_NODE_TRANSLATIONS_SET);
const auto map_translations = item->_get_translations_map();
for(const auto& translation_pair : map_translations)
{
- xmlpp::Element* childItem = child->add_child(GLOM_NODE_TRANSLATION);
+ auto childItem = child->add_child(GLOM_NODE_TRANSLATION);
XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_LOCALE, translation_pair.first);
XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_VALUE, translation_pair.second);
}
@@ -3551,14 +3551,14 @@ void Document::save_before_translations(xmlpp::Element* element, const std::shar
if(has_title_singular && has_title_singular->m_title_singular
&& !(has_title_singular->m_title_singular->get_title_original().empty()))
{
- xmlpp::Element* nodeTitleSingular = element->add_child(GLOM_NODE_TABLE_TITLE_SINGULAR);
+ auto nodeTitleSingular = element->add_child(GLOM_NODE_TABLE_TITLE_SINGULAR);
save_before_translations(nodeTitleSingular, has_title_singular->m_title_singular);
}
}
void Document::save_before_print_layout_position(xmlpp::Element* nodeItem, const std::shared_ptr<const
LayoutItem>& item)
{
- xmlpp::Element* child = nodeItem->add_child(GLOM_NODE_POSITION);
+ auto child = nodeItem->add_child(GLOM_NODE_POSITION);
double x = 0;
double y = 0;
@@ -3597,7 +3597,7 @@ bool Document::save_before()
*/
//TODO: Add xmlpp::Document::remove_root_node() to libxml++
- xmlpp::Element* nodeRoot = get_node_document();
+ auto nodeRoot = get_node_document();
if(nodeRoot)
{
@@ -3618,7 +3618,7 @@ bool Document::save_before()
XmlUtils::set_child_text_node(nodeRoot, GLOM_NODE_STARTUP_SCRIPT, m_startup_script);
- xmlpp::Element* nodeConnection = XmlUtils::get_node_child_named_with_add(nodeRoot, GLOM_NODE_CONNECTION);
+ auto nodeConnection = XmlUtils::get_node_child_named_with_add(nodeRoot, GLOM_NODE_CONNECTION);
switch(m_hosting_mode)
{
@@ -3672,7 +3672,7 @@ bool Document::save_before()
if(!table_name.empty())
{
- xmlpp::Element* nodeTable = nodeRoot->add_child(GLOM_NODE_TABLE);
+ auto nodeTable = nodeRoot->add_child(GLOM_NODE_TABLE);
XmlUtils::set_node_attribute_value(nodeTable, GLOM_ATTRIBUTE_NAME, table_name);
XmlUtils::set_node_attribute_value_as_bool(nodeTable, GLOM_ATTRIBUTE_HIDDEN,
doctableinfo->m_info->get_hidden());
XmlUtils::set_node_attribute_value_as_bool(nodeTable, GLOM_ATTRIBUTE_DEFAULT,
doctableinfo->m_info->get_default());
@@ -3682,11 +3682,11 @@ bool Document::save_before()
if(m_is_example) //The example data is useless to non-example files (and is big):
{
- xmlpp::Element* nodeExampleRows = nodeTable->add_child(GLOM_NODE_EXAMPLE_ROWS);
+ auto nodeExampleRows = nodeTable->add_child(GLOM_NODE_EXAMPLE_ROWS);
for(const auto& row_data : doctableinfo->m_example_rows)
{
- xmlpp::Element* nodeExampleRow = nodeExampleRows->add_child(GLOM_NODE_EXAMPLE_ROW);
+ auto nodeExampleRow = nodeExampleRows->add_child(GLOM_NODE_EXAMPLE_ROW);
if(!row_data.empty())
{
const auto row_data_size = row_data.size();
@@ -3696,7 +3696,7 @@ bool Document::save_before()
if(!field)
break;
- xmlpp::Element* nodeField = nodeExampleRow->add_child(GLOM_NODE_VALUE);
+ auto nodeField = nodeExampleRow->add_child(GLOM_NODE_VALUE);
XmlUtils::set_node_attribute_value(nodeField, GLOM_ATTRIBUTE_COLUMN, field->get_name());
XmlUtils::set_node_text_child_as_value(nodeField, row_data[i], field->get_glom_type());
} // for each value
@@ -3709,13 +3709,13 @@ bool Document::save_before()
save_before_translations(nodeTable, doctableinfo->m_info);
//Fields:
- xmlpp::Element* elemFields = nodeTable->add_child(GLOM_NODE_FIELDS);
+ auto elemFields = nodeTable->add_child(GLOM_NODE_FIELDS);
const auto type_names = Field::get_type_names();
for(const auto& field : doctableinfo->m_fields)
{
- xmlpp::Element* elemField = elemFields->add_child(GLOM_NODE_FIELD);
+ auto elemField = elemFields->add_child(GLOM_NODE_FIELD);
XmlUtils::set_node_attribute_value(elemField, GLOM_ATTRIBUTE_NAME, field->get_name());
XmlUtils::set_node_attribute_value_as_bool(elemField, GLOM_ATTRIBUTE_PRIMARY_KEY,
field->get_primary_key());
@@ -3735,7 +3735,7 @@ bool Document::save_before()
//Add Lookup sub-node:
if(field->get_is_lookup())
{
- xmlpp::Element* elemFieldLookup = elemField->add_child(GLOM_NODE_FIELD_LOOKUP);
+ auto elemFieldLookup = elemField->add_child(GLOM_NODE_FIELD_LOOKUP);
std::shared_ptr<Relationship> lookup_relationship = field->get_lookup_relationship();
XmlUtils::set_node_attribute_value(elemFieldLookup, GLOM_ATTRIBUTE_RELATIONSHIP_NAME,
glom_get_sharedptr_name(lookup_relationship));
@@ -3744,7 +3744,7 @@ bool Document::save_before()
}
//Default Formatting:
- xmlpp::Element* elementFormat = elemField->add_child(GLOM_NODE_FORMAT);
+ auto elementFormat = elemField->add_child(GLOM_NODE_FORMAT);
save_before_layout_item_formatting(elementFormat, field->m_default_formatting,
field->get_glom_type());
//Translations:
@@ -3753,14 +3753,14 @@ bool Document::save_before()
//Relationships:
//Add new <relationships> node:
- xmlpp::Element* elemRelationships = nodeTable->add_child(GLOM_NODE_RELATIONSHIPS);
+ auto elemRelationships = nodeTable->add_child(GLOM_NODE_RELATIONSHIPS);
//Add each <relationship> node:
for(const auto& relationship : doctableinfo->m_relationships)
{
if(relationship)
{
- xmlpp::Element* elemRelationship = elemRelationships->add_child(GLOM_NODE_RELATIONSHIP);
+ auto elemRelationship = elemRelationships->add_child(GLOM_NODE_RELATIONSHIP);
XmlUtils::set_node_attribute_value(elemRelationship, GLOM_ATTRIBUTE_NAME,
relationship->get_name());
XmlUtils::set_node_attribute_value(elemRelationship, GLOM_ATTRIBUTE_KEY,
relationship->get_from_field());
XmlUtils::set_node_attribute_value(elemRelationship, GLOM_ATTRIBUTE_OTHER_TABLE,
relationship->get_to_table());
@@ -3774,17 +3774,17 @@ bool Document::save_before()
}
//Layouts:
- xmlpp::Element* nodeDataLayouts = nodeTable->add_child(GLOM_NODE_DATA_LAYOUTS);
+ auto nodeDataLayouts = nodeTable->add_child(GLOM_NODE_DATA_LAYOUTS);
//Add the groups:
//Make sure that we always get these _after_ the relationships.
for(const auto& layout : doctableinfo->m_layouts)
{
- xmlpp::Element* nodeLayout = nodeDataLayouts->add_child(GLOM_NODE_DATA_LAYOUT);
+ auto nodeLayout = nodeDataLayouts->add_child(GLOM_NODE_DATA_LAYOUT);
XmlUtils::set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_NAME, layout.m_layout_name);
XmlUtils::set_node_attribute_value(nodeLayout, GLOM_ATTRIBUTE_LAYOUT_PLATFORM,
layout.m_layout_platform);
- xmlpp::Element* nodeGroups = nodeLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
+ auto nodeGroups = nodeLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
for(const auto& group : layout.m_layout_groups)
{
@@ -3793,18 +3793,18 @@ bool Document::save_before()
}
//Reports:
- xmlpp::Element* nodeReports = nodeTable->add_child(GLOM_NODE_REPORTS);
+ auto nodeReports = nodeTable->add_child(GLOM_NODE_REPORTS);
//Add the groups:
for(const auto& report_pair : doctableinfo->m_reports)
{
- xmlpp::Element* nodeReport = nodeReports->add_child(GLOM_NODE_REPORT);
+ auto nodeReport = nodeReports->add_child(GLOM_NODE_REPORT);
std::shared_ptr<const Report> report = report_pair.second;
XmlUtils::set_node_attribute_value(nodeReport, GLOM_ATTRIBUTE_NAME, report->get_name());
XmlUtils::set_node_attribute_value_as_bool(nodeReport, GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE,
report->get_show_table_title());
- xmlpp::Element* nodeGroups = nodeReport->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
+ auto nodeGroups = nodeReport->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
save_before_layout_group(nodeGroups, report->get_layout_group());
//Translations:
@@ -3812,12 +3812,12 @@ bool Document::save_before()
}
//Print Layouts:
- xmlpp::Element* nodePrintLayouts = nodeTable->add_child(GLOM_NODE_PRINT_LAYOUTS);
+ auto nodePrintLayouts = nodeTable->add_child(GLOM_NODE_PRINT_LAYOUTS);
//Add the print :
for(const auto& print_layout_pair : doctableinfo->m_print_layouts)
{
- xmlpp::Element* nodePrintLayout = nodePrintLayouts->add_child(GLOM_NODE_PRINT_LAYOUT);
+ auto nodePrintLayout = nodePrintLayouts->add_child(GLOM_NODE_PRINT_LAYOUT);
const auto& print_layout = print_layout_pair.second;
XmlUtils::set_node_attribute_value(nodePrintLayout, GLOM_ATTRIBUTE_NAME, print_layout->get_name());
@@ -3830,13 +3830,13 @@ bool Document::save_before()
//Save the rule lines:
for(const auto& value : print_layout->get_horizontal_rules())
{
- xmlpp::Element* child = nodePrintLayout->add_child(GLOM_NODE_HORIZONTAL_RULE);
+ auto child = nodePrintLayout->add_child(GLOM_NODE_HORIZONTAL_RULE);
XmlUtils::set_node_attribute_value_as_decimal(child, GLOM_ATTRIBUTE_RULE_POSITION, value);
}
for(const auto& value : print_layout->get_vertical_rules())
{
- xmlpp::Element* child = nodePrintLayout->add_child(GLOM_NODE_VERTICAL_RULE);
+ auto child = nodePrintLayout->add_child(GLOM_NODE_VERTICAL_RULE);
XmlUtils::set_node_attribute_value_as_decimal(child, GLOM_ATTRIBUTE_RULE_POSITION, value);
}
@@ -3844,14 +3844,14 @@ bool Document::save_before()
const auto page_setup = print_layout->get_page_setup();
if(!page_setup.empty())
{
- xmlpp::Element* child = nodePrintLayout->add_child(GLOM_NODE_PAGE_SETUP);
+ auto child = nodePrintLayout->add_child(GLOM_NODE_PAGE_SETUP);
child->add_child_text( Utils::string_clean_for_xml(page_setup) );
}
XmlUtils::set_node_attribute_value_as_decimal(nodePrintLayout,
GLOM_ATTRIBUTE_PRINT_LAYOUT_PAGE_COUNT,
print_layout->get_page_count(), 1);
- xmlpp::Element* nodeGroups = nodePrintLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
+ auto nodeGroups = nodePrintLayout->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
save_before_layout_group(nodeGroups, print_layout->get_layout_group(), true /* x,y positions too.
*/);
//Translations:
@@ -3867,7 +3867,7 @@ bool Document::save_before()
nodeRoot->remove_child(item);
//Add groups:
- xmlpp::Element* nodeGroups = nodeRoot->add_child(GLOM_NODE_GROUPS);
+ auto nodeGroups = nodeRoot->add_child(GLOM_NODE_GROUPS);
nodeGroups->add_child_comment("These are only used when recreating a database from an example file. The
actual access-control is on the server, of course.");
@@ -3883,14 +3883,14 @@ bool Document::save_before()
continue;
}
- xmlpp::Element* nodeGroup = nodeGroups->add_child(GLOM_NODE_GROUP);
+ auto nodeGroup = nodeGroups->add_child(GLOM_NODE_GROUP);
XmlUtils::set_node_attribute_value(nodeGroup, GLOM_ATTRIBUTE_NAME, group_name);
XmlUtils::set_node_attribute_value_as_bool(nodeGroup, GLOM_ATTRIBUTE_DEVELOPER,
group_info.m_developer);
//The privileges for each table, for this group:
for(const auto& priv_pair : group_info.m_map_privileges)
{
- xmlpp::Element* nodeTablePrivs = nodeGroup->add_child(GLOM_NODE_TABLE_PRIVS);
+ auto nodeTablePrivs = nodeGroup->add_child(GLOM_NODE_TABLE_PRIVS);
XmlUtils::set_node_attribute_value(nodeTablePrivs, GLOM_ATTRIBUTE_TABLE_NAME, priv_pair.first);
@@ -3908,20 +3908,20 @@ bool Document::save_before()
nodeRoot->remove_child(item);
//Add groups:
- xmlpp::Element* nodeModules = nodeRoot->add_child(GLOM_NODE_LIBRARY_MODULES);
+ auto nodeModules = nodeRoot->add_child(GLOM_NODE_LIBRARY_MODULES);
for(const auto& script_pair : m_map_library_scripts)
{
const auto& name = script_pair.first;
const auto& script = script_pair.second;
- xmlpp::Element* nodeModule = nodeModules->add_child(GLOM_NODE_LIBRARY_MODULE);
+ auto nodeModule = nodeModules->add_child(GLOM_NODE_LIBRARY_MODULE);
//The name is in an attribute:
XmlUtils::set_node_attribute_value(nodeModule, GLOM_ATTRIBUTE_LIBRARY_MODULE_NAME, name);
//The script is in a child text node:
- xmlpp::TextNode* text_child = nodeModule->get_child_text();
+ auto text_child = nodeModule->get_child_text();
if(!text_child)
nodeModule->add_child_text( Utils::string_clean_for_xml(script) );
else
@@ -4704,7 +4704,7 @@ void Document::set_startup_script(const Glib::ustring& script)
Glib::ustring Document::build_and_get_contents() const
{
//save_before() probably should be const because it doesn't change much of the external behaviour:
- Document* unconst = const_cast<Document*>(this);
+ auto unconst = const_cast<Document*>(this);
unconst->save_before(); //This is the part of the Document_XML overrides that sets the contents string
from the XML tree.
return get_contents();
@@ -4915,7 +4915,7 @@ Glib::ustring Document::save_backup_file(const Glib::ustring& uri, const SlotPro
//Save the data:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
const bool data_saved =
connection_pool->save_backup(slot_progress, path_dir);
if(!data_saved)
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index f394d2f..55a9257 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -462,7 +462,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
//std::cout << "debug: " << G_STRFUNC << ": Getting non-cached." << std::endl;
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
const auto current_user = connection_pool->get_user();
//Is the user in the special developers group?
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 0cd184e..7a8fdb6 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -70,7 +70,7 @@ boost::python::object PyGlomRecord::get_connection()
return result;
}
- PyObject* cobject = pygobject_new( G_OBJECT(m_connection->gobj()) );
+ auto cobject = pygobject_new( G_OBJECT(m_connection->gobj()) );
if(cobject)
result = boost::python::object( boost::python::borrowed(cobject) );
}
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 76614cb..2ec0b94 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -85,7 +85,7 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
if(from_key_field)
{
//Return a new RelatedRecord:
- PyGlomRelatedRecord* pyRelatedRecord = new PyGlomRelatedRecord();
+ auto pyRelatedRecord = new PyGlomRelatedRecord();
pyRelatedRecord->set_relationship(iterFind->second, from_key_value, record->m_document);
//Store it in the cache:
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc
b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index 52d3814..d228a27 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -117,7 +117,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
builder->add_expr(m_from_key_value)));
/* TODO: Fix linking problems
- const App_Glom* app = App_Glom::get_appwindow();
+ const auto app = App_Glom::get_appwindow();
if(app && app->get_show_sql_debug())
{
try
diff --git a/glom/libglom/python_embed/pygdavalue_conversions.cc
b/glom/libglom/python_embed/pygdavalue_conversions.cc
index 9b6a2b9..915d416 100644
--- a/glom/libglom/python_embed/pygdavalue_conversions.cc
+++ b/glom/libglom/python_embed/pygdavalue_conversions.cc
@@ -43,7 +43,7 @@ glom_pygda_value_from_pyobject(GValue* boxed, const boost::python::object& input
if(G_IS_VALUE (boxed))
g_value_unset(boxed);
- PyObject* input_c = input.ptr();
+ auto input_c = input.ptr();
//We check for bool first,
//because bool is derived from int in Python,
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index 624050f..9cd62ab 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -45,7 +45,7 @@ ReportBuilder::~ReportBuilder()
bool ReportBuilder::report_build_headerfooter(const FoundSet& found_set, xmlpp::Element& parent_node, const
std::shared_ptr<LayoutGroup>& group)
{
//Add XML node:
- xmlpp::Element* node = parent_node.add_child(group->get_report_part_id());
+ auto node = parent_node.add_child(group->get_report_part_id());
//Add child parts:
type_vecLayoutItems itemsToGet;
@@ -107,7 +107,7 @@ bool ReportBuilder::report_build_headerfooter(const FoundSet& found_set, xmlpp::
bool ReportBuilder::report_build_summary(const FoundSet& found_set, xmlpp::Element& parent_node, const
std::shared_ptr<LayoutItem_Summary>& summary)
{
//Add XML node:
- xmlpp::Element* node = parent_node.add_child(summary->get_report_part_id());
+ auto node = parent_node.add_child(summary->get_report_part_id());
//Get fields
type_vecLayoutItems itemsToGet;
@@ -251,7 +251,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
//Add XML node:
- xmlpp::Element* nodeGroupBy = parent_node.add_child(group_by->get_report_part_id());
+ auto nodeGroupBy = parent_node.add_child(group_by->get_report_part_id());
XmlUtils::set_node_attribute_value_as_decimal_double(nodeGroupBy, "border_width",
group_by->get_border_width());
nodeGroupBy->set_attribute("group_field", field_group_by->get_title_or_name(m_locale_id));
@@ -274,7 +274,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
//Secondary fields. For instance, the Contact Name, in addition to the Contact ID that we group by.
if(!(group_by->get_secondary_fields()->m_list_items.empty()))
{
- xmlpp::Element* nodeSecondaryFields = nodeGroupBy->add_child("secondary_fields");
+ auto nodeSecondaryFields = nodeGroupBy->add_child("secondary_fields");
type_vecLayoutItems itemsToGet;
for(const auto& item : group_by->get_secondary_fields()->m_list_items)
@@ -305,7 +305,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
{
//There is no group-by field, so ouput all the found records.
//For instance, the user could use the GroupBy part just to specify a sort, though that would be a bit
of a hack:
- xmlpp::Element* nodeGroupBy = parent_node.add_child(group_by->get_report_part_id()); //We need this to
create the HTML table.
+ auto nodeGroupBy = parent_node.add_child(group_by->get_report_part_id()); //We need this to create the
HTML table.
XmlUtils::set_node_attribute_value_as_decimal_double(nodeGroupBy, "border_width",
group_by->get_border_width());
return report_build_groupby_children(found_set_parent, *nodeGroupBy, group_by);
}
@@ -347,7 +347,7 @@ bool ReportBuilder::report_build_records(const FoundSet& found_set, xmlpp::Eleme
std::shared_ptr<LayoutItem_Field> layoutitem_field =
std::dynamic_pointer_cast<LayoutItem_Field>(layout_item);
//This adds a field heading (and therefore, column) for fields, or for a vertical group.
- xmlpp::Element* nodeFieldHeading = parent_node.add_child("field_heading");
+ auto nodeFieldHeading = parent_node.add_child("field_heading");
if(layoutitem_field && layoutitem_field->get_glom_type() == Field::glom_field_type::NUMERIC)
nodeFieldHeading->set_attribute("field_type", "numeric"); //TODO: More sophisticated formatting.
@@ -399,7 +399,7 @@ bool ReportBuilder::report_build_records(const FoundSet& found_set, xmlpp::Eleme
for(guint row = 0; row < rows_count; ++row)
{
- xmlpp::Element* nodeRow = parent_node.add_child("row");
+ auto nodeRow = parent_node.add_child("row");
guint colField = 0;
for(const auto& item : items)
@@ -453,7 +453,7 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
{
const auto field_type = field->get_glom_type();
- xmlpp::Element* nodeField = nodeParent.add_child(field->get_report_part_id());
+ auto nodeField = nodeParent.add_child(field->get_report_part_id());
if(field_type == Field::glom_field_type::NUMERIC)
nodeField->set_attribute("field_type", "numeric"); //TODO: More sophisticated formatting.
@@ -514,7 +514,7 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
bool ReportBuilder::report_build_records_text(const FoundSet& /* found_set */, xmlpp::Element& nodeParent,
const std::shared_ptr<const LayoutItem_Text>& textobject, bool vertical)
{
//Text object:
- xmlpp::Element* nodeField = nodeParent.add_child(textobject->get_report_part_id()); //We reuse this node
type for text objects.
+ auto nodeField = nodeParent.add_child(textobject->get_report_part_id()); //We reuse this node type for
text objects.
nodeField->set_attribute("value", textobject->get_text(m_locale_id));
if(vertical)
@@ -526,7 +526,7 @@ bool ReportBuilder::report_build_records_text(const FoundSet& /* found_set */, x
bool ReportBuilder::report_build_records_image(const FoundSet& /* found_set */, xmlpp::Element& nodeParent,
const std::shared_ptr<const LayoutItem_Image>& imageobject, bool vertical)
{
//Text object:
- xmlpp::Element* nodeImage = nodeParent.add_child(imageobject->get_report_part_id()); //We reuse this node
type for text objects.
+ auto nodeImage = nodeParent.add_child(imageobject->get_report_part_id()); //We reuse this node type for
text objects.
nodeImage->set_attribute("image_uri", imageobject->create_local_image_uri());
if(vertical)
@@ -537,7 +537,7 @@ bool ReportBuilder::report_build_records_image(const FoundSet& /* found_set */,
bool ReportBuilder::report_build_records_vertical_group(const FoundSet& found_set, xmlpp::Element&
parentNode, const std::shared_ptr<LayoutItem_VerticalGroup>& group, const
Glib::RefPtr<Gnome::Gda::DataModel>& datamodel, guint row, guint& field_index)
{
- xmlpp::Element* nodeGroupVertical = parentNode.add_child(group->get_report_part_id());
+ auto nodeGroupVertical = parentNode.add_child(group->get_report_part_id());
for(const auto& item : group->m_list_items)
{
@@ -636,8 +636,8 @@ Glib::ustring ReportBuilder::report_build(const FoundSet& found_set, const std::
//Create a DOM Document with the XML:
xmlpp::DomParser dom_parser;;
- xmlpp::Document* pDocument = dom_parser.get_document();
- xmlpp::Element* nodeRoot = pDocument->get_root_node();
+ auto pDocument = dom_parser.get_document();
+ auto nodeRoot = pDocument->get_root_node();
if(!nodeRoot)
{
//Add it if it isn't there already:
@@ -654,7 +654,7 @@ Glib::ustring ReportBuilder::report_build(const FoundSet& found_set, const std::
//The groups:
- xmlpp::Element* nodeParent = nodeRoot;
+ auto nodeParent = nodeRoot;
nodeRoot->set_attribute("title", report->get_title_or_name(m_locale_id));
@@ -712,7 +712,7 @@ Glib::ustring ReportBuilder::report_build(const FoundSet& found_set, const std::
//Add top-level records, outside of any groupby or summary, if fields have been specified:
if(!itemsToGet_TopLevel.empty())
{
- xmlpp::Element* nodeGroupBy = nodeParent->add_child("ungrouped_records");
+ auto nodeGroupBy = nodeParent->add_child("ungrouped_records");
if(!report_build_records(found_set, *nodeGroupBy, itemsToGet_TopLevel))
{
std::cerr << G_STRFUNC << ": report_build_records() failed." << std::endl;
diff --git a/glom/libglom/test_connectionpool.cc b/glom/libglom/test_connectionpool.cc
index 4e32bee..a6487f9 100644
--- a/glom/libglom/test_connectionpool.cc
+++ b/glom/libglom/test_connectionpool.cc
@@ -39,7 +39,7 @@ int main()
{
//Set the connection details:
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
if(connection_pool)
{
//Set the connection details in the ConnectionPool singleton.
@@ -50,12 +50,12 @@ int main()
connection_pool->set_password("murraycpw");
#ifdef GLOM_ENABLE_POSTGRESQL
- Glom::ConnectionPoolBackends::PostgresCentralHosted* backend = new
Glom::ConnectionPoolBackends::PostgresCentralHosted;
+ auto backend = new Glom::ConnectionPoolBackends::PostgresCentralHosted;
backend->set_host("localhost");
backend->set_port(5433);
backend->set_try_other_ports(false);
#else
- Glom::ConnectionPoolBackends::Sqlite* backend = new Glom::ConnectionPoolBackends::Sqlite;
+ auto backend = new Glom::ConnectionPoolBackends::Sqlite;
#endif //GLOM_ENABLE_POSTGRESQL
connection_pool->set_backend(std::shared_ptr<Glom::ConnectionPool::Backend>(backend));
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 6d923fc..c40fde3 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -351,7 +351,7 @@ void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::Sq
const Glib::ustring parent = layout_item->get_sql_table_or_join_alias_name(table_name);
//TODO: Use std::dynamic_pointer_cast?
- const LayoutItem_FieldSummary* fieldsummary = dynamic_cast<const
LayoutItem_FieldSummary*>(layout_item.get());
+ const auto fieldsummary = dynamic_cast<const LayoutItem_FieldSummary*>(layout_item.get());
if(fieldsummary)
{
const Gnome::Gda::SqlBuilder::Id id_function = builder->add_function(
diff --git a/glom/mode_data/box_data.cc b/glom/mode_data/box_data.cc
index 76d487c..5d1ec24 100644
--- a/glom/mode_data/box_data.cc
+++ b/glom/mode_data/box_data.cc
@@ -171,7 +171,7 @@ void Box_Data::create_layout()
set_unstored_data(false);
//Cache the table information, for performance:
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
m_TableFields = DbUtils::get_fields_for_table(document, m_table_name);
}
@@ -239,7 +239,7 @@ Box_Data::type_vecConstLayoutFields Box_Data::get_fields_to_show() const
Box_Data::type_vecConstLayoutFields Box_Data::get_table_fields_to_show(const Glib::ustring& table_name) const
{
- const Document* pDoc = dynamic_cast<const Document*>(get_document());
+ const auto pDoc = dynamic_cast<const Document*>(get_document());
if(pDoc)
{
Document::type_list_layout_groups mapGroupSequence =
pDoc->get_data_layout_groups_plus_new_fields(m_layout_name, table_name, m_layout_platform);
@@ -253,7 +253,7 @@ Document::type_list_layout_groups Box_Data::get_data_layout_groups(const Glib::u
{
Document::type_list_layout_groups layout_groups;
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
if(!m_table_name.empty())
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index f729c84..e59dd11 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -116,7 +116,7 @@ bool Box_Data_Calendar_Related::init_db_details(const Glib::ustring& parent_tabl
if(m_portal)
{
- Document* document = get_document();
+ auto document = get_document();
m_key_field = DbUtils::get_fields_for_table_one_field(document,
LayoutWidgetBase::m_table_name, m_portal->get_to_field_used());
}
@@ -233,7 +233,7 @@ bool Box_Data_Calendar_Related::fill_from_database()
const auto date = value_date.get_date();
//Get all the values for this row:
- type_vector_values* pVector = new type_vector_values(m_FieldsShown.size());
+ auto pVector = new type_vector_values(m_FieldsShown.size());
for(int column_index = 0; column_index < columns_count; ++column_index)
{
(*pVector)[column_index] = datamodel->get_value_at(column_index, row_index);
@@ -352,7 +352,7 @@ Box_Data_Calendar_Related::type_vecConstLayoutFields Box_Data_Calendar_Related::
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Box_Data_Calendar_Related::on_dialog_layout_hide()
{
- Dialog_Layout_Calendar_Related* dialog_related =
dynamic_cast<Dialog_Layout_Calendar_Related*>(m_pDialogLayout);
+ auto dialog_related = dynamic_cast<Dialog_Layout_Calendar_Related*>(m_pDialogLayout);
g_assert(dialog_related);
m_portal = dialog_related->get_portal_layout();
@@ -384,7 +384,7 @@ Dialog_Layout* Box_Data_Calendar_Related::create_layout_dialog() const
void Box_Data_Calendar_Related::prepare_layout_dialog(Dialog_Layout* dialog)
{
- Dialog_Layout_Calendar_Related* related_dialog = dynamic_cast<Dialog_Layout_Calendar_Related*>(dialog);
+ auto related_dialog = dynamic_cast<Dialog_Layout_Calendar_Related*>(dialog);
g_assert(related_dialog);
std::shared_ptr<LayoutItem_CalendarPortal> derived_portal =
std::dynamic_pointer_cast<LayoutItem_CalendarPortal>(m_portal);
@@ -512,7 +512,7 @@ void Box_Data_Calendar_Related::setup_menu(Gtk::Widget* /* this */)
sigc::mem_fun(*this, &Box_Data_Calendar_Related::on_MenuPopup_activate_layout) );
//TODO: This does not work until this widget is in a container in the window:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -542,7 +542,7 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *b
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 59377ae..90fc32a 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -85,7 +85,7 @@ Box_Data_Details::Box_Data_Details(bool bWithNavButtons /* = true */)
m_ScrolledWindow.add(m_FlowTable);
// The FlowTable does not support native scrolling, so gtkmm adds it to a
// viewport first that also has some shadow we do not want.
- Gtk::Viewport* viewport = dynamic_cast<Gtk::Viewport*>(m_FlowTable.get_parent());
+ auto viewport = dynamic_cast<Gtk::Viewport*>(m_FlowTable.get_parent());
if(viewport)
viewport->set_shadow_type(Gtk::SHADOW_NONE);
@@ -214,7 +214,7 @@ void Box_Data_Details::create_layout()
//Remove existing child widgets:
m_FlowTable.remove_all();
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
m_FlowTable.set_table(m_table_name); //This allows portals to get full Relationship information
@@ -343,7 +343,7 @@ bool Box_Data_Details::fill_from_database()
if((result && result->get_n_rows()) || primary_key_is_empty) //either a working result or no result
needed.
{
- const Document* pDoc = dynamic_cast<const Document*>(get_document());
+ const auto pDoc = dynamic_cast<const Document*>(get_document());
if(pDoc)
{
//Get glom-specific field info:
@@ -410,10 +410,10 @@ void Box_Data_Details::on_button_new()
{
//Warn the user that they won't see anything if there are no fields on the layout,
//doing an extra check:
- Document* document = get_document();
+ auto document = get_document();
if( document && !(document->get_data_layout_groups_have_any_fields(m_layout_name, m_table_name,
m_layout_platform)) )
{
- Gtk::Window* parent_window = get_app_window();
+ auto parent_window = get_app_window();
if(parent_window)
UiUtils::show_ok_dialog(_("Layout Contains No Fields"), _("There are no fields on the layout, so
there is no way to enter data in a new record."), *parent_window, Gtk::MESSAGE_ERROR);
}
@@ -608,7 +608,7 @@ void Box_Data_Details::on_flowtable_layout_changed()
m_FlowTable.get_layout_groups(layout_groups);
//Store it in the document:
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->set_data_layout_groups(m_layout_name, m_table_name, m_layout_platform, layout_groups);
//Build the view again from the new layout:
@@ -616,7 +616,7 @@ void Box_Data_Details::on_flowtable_layout_changed()
create_layout();
//Store it in the document:
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->set_modified();
@@ -707,9 +707,9 @@ void Box_Data_Details::on_flowtable_field_edited(const std::shared_ptr<const Lay
const auto strFieldName = layout_field->get_name();
- Gtk::Window* window = get_app_window();
+ auto window = get_app_window();
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
Gnome::Gda::Value primary_key_value = get_primary_key_value_selected();
//std::cout << "debug: " << G_STRFUNC << ": primary_key_value=" << primary_key_value.to_string() <<
std::endl;
@@ -922,7 +922,7 @@ void Box_Data_Details::print_layout()
if(!table_privs.m_view)
return; //TODO: Warn the user.
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document was null" << std::endl;
@@ -945,7 +945,7 @@ void Box_Data_Details::print_layout()
false /* do not avoid page margins */);
//Show the print preview window:
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
PrintLayoutUtils::do_print_layout(layout, m_found_set,
false /* not preview */, document, true /* avoid page margins */, app);
}
diff --git a/glom/mode_data/box_data_list.cc b/glom/mode_data/box_data_list.cc
index 49a69c2..79fcca0 100644
--- a/glom/mode_data/box_data_list.cc
+++ b/glom/mode_data/box_data_list.cc
@@ -182,7 +182,7 @@ void Box_Data_List::set_primary_key_value(const Gtk::TreeModel::iterator& row, c
void Box_Data_List::on_adddel_user_reordered_columns()
{
- Document* pDoc = dynamic_cast<Document*>(get_document());
+ auto pDoc = dynamic_cast<Document*>(get_document());
if(pDoc)
{
auto group = std::make_shared<LayoutGroup>();
@@ -401,7 +401,7 @@ void Box_Data_List::create_layout()
{
Box_Data::create_layout(); //Fills m_TableFields.
- const Document* pDoc = dynamic_cast<const Document*>(get_document());
+ const auto pDoc = dynamic_cast<const Document*>(get_document());
if(!pDoc)
return;
@@ -532,7 +532,7 @@ void Box_Data_List::on_adddel_user_sort_clause_changed()
m_found_set = m_AddDel.get_found_set();
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->set_criteria_current(m_table_name, m_found_set);
}
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index 181ce0d..56846aa 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -327,7 +327,7 @@ void Box_Data_List_Related::on_adddel_record_added(const Gtk::TreeModel::iterato
#ifndef GLOM_ENABLE_CLIENT_ONLY
void Box_Data_List_Related::on_dialog_layout_hide()
{
- Dialog_Layout_List_Related* dialog_related = dynamic_cast<Dialog_Layout_List_Related*>(m_pDialogLayout);
+ auto dialog_related = dynamic_cast<Dialog_Layout_List_Related*>(m_pDialogLayout);
g_assert(dialog_related);
m_portal = dialog_related->get_portal_layout();
@@ -356,7 +356,7 @@ Dialog_Layout* Box_Data_List_Related::create_layout_dialog() const
void Box_Data_List_Related::prepare_layout_dialog(Dialog_Layout* dialog)
{
- Dialog_Layout_List_Related* related_dialog = dynamic_cast<Dialog_Layout_List_Related*>(dialog);
+ auto related_dialog = dynamic_cast<Dialog_Layout_List_Related*>(dialog);
g_assert(related_dialog);
related_dialog->init_with_portal(m_layout_name, m_layout_platform, get_document(), m_portal,
m_parent_table);
@@ -398,7 +398,7 @@ void Box_Data_List_Related::create_layout()
{
Box_Data::create_layout(); //Fills m_TableFields.
- const Document* pDoc = dynamic_cast<const Document*>(get_document());
+ const auto pDoc = dynamic_cast<const Document*>(get_document());
if(!pDoc)
return;
diff --git a/glom/mode_data/box_data_manyrecords.cc b/glom/mode_data/box_data_manyrecords.cc
index 3ecb177..c680e58 100644
--- a/glom/mode_data/box_data_manyrecords.cc
+++ b/glom/mode_data/box_data_manyrecords.cc
@@ -84,7 +84,7 @@ void Box_Data_ManyRecords::print_layout()
else
{
//Create a simple report on the fly:
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<Report> report_temp = ReportBuilder::create_standard_list_report(document, m_table_name);
//TODO: Find a way to get a full locale name from the simplified locale name from
AppWindow::get_current_locale():
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index 1406ecb..f64e7aa 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -329,7 +329,7 @@ void Box_Data_Portal::get_suitable_record_to_view_details(const Gnome::Gda::Valu
table_name = Glib::ustring();
table_primary_key_value = Gnome::Gda::Value();
- Gtk::Window* window = const_cast<Gtk::Window*>(get_app_window());
+ auto window = const_cast<Gtk::Window*>(get_app_window());
if(window)
Frame_Glom::show_ok_dialog(_("No Corresponding Record Exists"), _("No record with this value exists.
Therefore navigation to the related record is not possible."), *window, Gtk::MESSAGE_WARNING); //TODO: Make
it more clear to the user exactly what record, what field, and what value, we are talking about.
}
diff --git a/glom/mode_data/buttonglom.cc b/glom/mode_data/buttonglom.cc
index d76fc19..748749f 100644
--- a/glom/mode_data/buttonglom.cc
+++ b/glom/mode_data/buttonglom.cc
@@ -54,7 +54,7 @@ void ButtonGlom::init()
AppWindow* ButtonGlom::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -84,7 +84,7 @@ void ButtonGlom::on_menu_properties_activate()
bool ButtonGlom::on_button_press_event(GdkEventButton *button_event)
{
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
diff --git a/glom/mode_data/datawidget/cellcreation.cc b/glom/mode_data/datawidget/cellcreation.cc
index f0bf17c..4c85215 100644
--- a/glom/mode_data/datawidget/cellcreation.cc
+++ b/glom/mode_data/datawidget/cellcreation.cc
@@ -38,7 +38,7 @@ namespace Glom
static void apply_formatting(Gtk::CellRenderer* renderer, const std::shared_ptr<const
LayoutItem_WithFormatting>& layout_item)
{
- Gtk::CellRendererText* text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto text_renderer = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(!text_renderer)
return;
@@ -101,7 +101,7 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
const auto formatting = item_field->get_formatting_used();
if(formatting.get_has_choices())
{
- CellRendererDbList* rendererList = Gtk::manage( new CellRendererDbList() );
+ auto rendererList = Gtk::manage( new CellRendererDbList() );
std::shared_ptr<LayoutItem> unconst = std::const_pointer_cast<LayoutItem>(layout_item); //TODO:
Avoid this.
rendererList->set_layout_item(unconst, table_name);
bool as_radio_buttons = false; //Can't really be done in a list, so we ignore it.
@@ -131,7 +131,7 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
std::shared_ptr<const LayoutItem_Image> item_image = std::dynamic_pointer_cast<const
LayoutItem_Image>(layout_item);
if(item_image)
{
- Gtk::CellRendererPixbuf* pixbuf_renderer = Gtk::manage( new Gtk::CellRendererPixbuf() );
+ auto pixbuf_renderer = Gtk::manage( new Gtk::CellRendererPixbuf() );
const Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(item_image->m_image);
if(pixbuf)
@@ -146,7 +146,7 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
std::shared_ptr<const LayoutItem_Text> item_text = std::dynamic_pointer_cast<const
LayoutItem_Text>(layout_item);
if(item_text)
{
- Gtk::CellRendererText* pCellText = Gtk::manage( new Gtk::CellRendererText() );
+ auto pCellText = Gtk::manage( new Gtk::CellRendererText() );
pCellText->property_text() = item_get_title(item_text);
cell = pCellText;
@@ -156,7 +156,7 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
std::shared_ptr<const LayoutItem_Button> item_button = std::dynamic_pointer_cast<const
LayoutItem_Button>(layout_item);
if(item_button)
{
- GlomCellRenderer_ButtonText* pCellButton = Gtk::manage( new GlomCellRenderer_ButtonText() );
+ auto pCellButton = Gtk::manage( new GlomCellRenderer_ButtonText() );
pCellButton->property_text() = item_get_title_or_name(item_button);
//pCellButton->set_fixed_width(50); //Otherwise it doesn't show up. TODO: Discover the width of
the contents.
@@ -181,7 +181,7 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
}
- Gtk::CellRendererText* cell_text = dynamic_cast<Gtk::CellRendererText*>(cell);
+ auto cell_text = dynamic_cast<Gtk::CellRendererText*>(cell);
if(cell_text)
{
//Use an ellipze to indicate excessive text,
@@ -198,8 +198,8 @@ Gtk::CellRenderer* create_cell(const std::shared_ptr<const LayoutItem>& layout_i
}
//Choices:
- CellRendererList* pCellRendererList = dynamic_cast<CellRendererList*>(cell);
- CellRendererDbList* pCellRendererDbList = dynamic_cast<CellRendererDbList*>(cell);
+ auto pCellRendererList = dynamic_cast<CellRendererList*>(cell);
+ auto pCellRendererDbList = dynamic_cast<CellRendererDbList*>(cell);
if(pCellRendererList) //Used for custom choices:
{
pCellRendererList->remove_all_list_items();
diff --git a/glom/mode_data/datawidget/cellrenderer_dblist.cc
b/glom/mode_data/datawidget/cellrenderer_dblist.cc
index 947f7be..0acff96 100644
--- a/glom/mode_data/datawidget/cellrenderer_dblist.cc
+++ b/glom/mode_data/datawidget/cellrenderer_dblist.cc
@@ -93,7 +93,7 @@ void CellRendererDbList::set_restrict_values_to_list(bool val)
void CellRendererDbList::repack_cells_fixed(Gtk::CellLayout* combobox)
{
//We need an actual widget, to guess the fixed cell height.
- Gtk::Widget* widget = dynamic_cast<Gtk::Widget*>(combobox);
+ auto widget = dynamic_cast<Gtk::Widget*>(combobox);
if(!widget)
{
std::cerr << G_STRFUNC << ": widget is null." << std::endl;
@@ -102,7 +102,7 @@ void CellRendererDbList::repack_cells_fixed(Gtk::CellLayout* combobox)
if(!m_repacked_first_cell)
{
//Get the default column, created by set_text_column():
- Gtk::CellRendererText* cell = dynamic_cast<Gtk::CellRendererText*>(combobox->get_first_cell());
+ auto cell = dynamic_cast<Gtk::CellRendererText*>(combobox->get_first_cell());
if (cell)
{
//Unpack and repack it with expand=false instead of expand=true:
@@ -153,7 +153,7 @@ void CellRendererDbList::repack_cells_fixed(Gtk::CellLayout* combobox)
void CellRendererDbList::repack_cells_related(Gtk::CellLayout* combobox)
{
//We need an actual widget, to guess the fixed cell height.
- Gtk::Widget* widget = dynamic_cast<Gtk::Widget*>(combobox);
+ auto widget = dynamic_cast<Gtk::Widget*>(combobox);
if(!widget)
{
std::cerr << G_STRFUNC << ": widget is null." << std::endl;
@@ -219,7 +219,7 @@ void CellRendererDbList::on_editing_started(Gtk::CellEditable* cell_editable, co
return;
}
- Gtk::CellLayout* combobox = dynamic_cast<Gtk::CellLayout*>(cell_editable);
+ auto combobox = dynamic_cast<Gtk::CellLayout*>(cell_editable);
if(!combobox)
return;
@@ -251,7 +251,7 @@ void CellRendererDbList::set_value(const Gnome::Gda::Value& value)
if(cells.empty())
return;
- Gtk::CellRendererText* cell = dynamic_cast<Gtk::CellRendererText*>(cells[0]);
+ auto cell = dynamic_cast<Gtk::CellRendererText*>(cells[0]);
if(!cell)
return;
diff --git a/glom/mode_data/datawidget/checkbutton.cc b/glom/mode_data/datawidget/checkbutton.cc
index 7e5df2f..b5d4b92 100644
--- a/glom/mode_data/datawidget/checkbutton.cc
+++ b/glom/mode_data/datawidget/checkbutton.cc
@@ -55,7 +55,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -85,7 +85,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *button_event)
AppWindow* CheckButton::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/mode_data/datawidget/combo.cc b/glom/mode_data/datawidget/combo.cc
index 945aecb..4039440 100644
--- a/glom/mode_data/datawidget/combo.cc
+++ b/glom/mode_data/datawidget/combo.cc
@@ -134,7 +134,7 @@ void ComboGlom::set_choices_fixed(const Formatting::type_list_values& list_value
if(i == 0 && get_has_entry())
continue;
- Gtk::CellRendererText* cell = Gtk::manage(new Gtk::CellRendererText);
+ auto cell = Gtk::manage(new Gtk::CellRendererText);
cell->property_xalign() = 0.0f;
//Use the renderer:
@@ -207,7 +207,7 @@ void ComboGlom::set_choices_related(const Document* document, const std::shared_
continue;
}
- Gtk::CellRenderer* cell = create_cell(layout_item, m_table_name, document, get_fixed_cell_height(*this));
+ auto cell = create_cell(layout_item, m_table_name, document, get_fixed_cell_height(*this));
//Add the ViewColumn:
if(cell)
@@ -278,7 +278,7 @@ void ComboGlom::set_value(const Gnome::Gda::Value& value)
if(cells.empty())
return;
- Gtk::CellRendererText* cell = dynamic_cast<Gtk::CellRendererText*>(cells[0]);
+ auto cell = dynamic_cast<Gtk::CellRendererText*>(cells[0]);
if(!cell)
return;
@@ -317,7 +317,7 @@ g_warning("ComboGlom::on_button_press_event()");
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -349,7 +349,7 @@ g_warning("ComboGlom::on_button_press_event()");
AppWindow* ComboGlom::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index bef700a..a6d0bb5 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -106,7 +106,7 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
}
}
- Gtk::RadioButton* button = new Gtk::RadioButton(group, title);
+ auto button = new Gtk::RadioButton(group, title);
m_map_buttons[value_first] = button;
pack_start(*button);
button->show();
@@ -125,7 +125,7 @@ void ComboAsRadioButtons::set_choices_fixed(const Formatting::type_list_values&
//Clear existing buttons:
for(const auto& the_pair : m_map_buttons)
{
- Gtk::RadioButton* button = the_pair.second;
+ auto button = the_pair.second;
delete button;
}
m_map_buttons.clear();
@@ -143,7 +143,7 @@ void ComboAsRadioButtons::set_choices_fixed(const Formatting::type_list_values&
const auto value_first = Conversions::get_text_for_gda_value(layout_item->get_glom_type(), value,
layout_item->get_formatting_used().m_numeric_format);
- Gtk::RadioButton* button = new Gtk::RadioButton(group, value_first);
+ auto button = new Gtk::RadioButton(group, value_first);
m_map_buttons[value_first] = button;
pack_start(*button);
button->show();
@@ -164,7 +164,7 @@ ComboAsRadioButtons::~ComboAsRadioButtons()
{
for(const auto& the_pair : m_map_buttons)
{
- Gtk::RadioButton* button = the_pair.second;
+ auto button = the_pair.second;
delete button;
}
m_map_buttons.clear();
@@ -223,7 +223,7 @@ void ComboAsRadioButtons::set_text(const Glib::ustring& text)
auto iter = m_map_buttons.find(text);
if(iter != m_map_buttons.end())
{
- Gtk::RadioButton* button = iter->second;
+ auto button = iter->second;
if(button)
{
button->set_active();
@@ -248,7 +248,7 @@ Glib::ustring ComboAsRadioButtons::get_text() const
//Get the active row:
for(const auto& the_pair : m_map_buttons)
{
- Gtk::CheckButton* button = the_pair.second;
+ auto button = the_pair.second;
if(button && button->get_active())
{
return the_pair.first;
@@ -262,7 +262,7 @@ Glib::ustring ComboAsRadioButtons::get_text() const
void ComboAsRadioButtons::show_context_menu(GdkEventButton *button_event)
{
std::cout << "ComboAsRadioButtons::show_context_menu()" << std::endl;
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
//Enable/Disable items.
@@ -305,7 +305,7 @@ bool ComboAsRadioButtons::on_button_press_event(GdkEventButton *button_event)
AppWindow* ComboAsRadioButtons::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 973a44d..654576c 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -77,7 +77,7 @@ void ComboChoicesWithTreeModel::create_model_non_db(guint columns_count)
{
//Create a value column for all columns
//for instance for later value comparison.
- type_model_column_value_fixed* model_column = new type_model_column_value_fixed();
+ auto model_column = new type_model_column_value_fixed();
//Store it so we can use it and delete it later:
m_vec_model_columns_value_fixed[i] = model_column;
@@ -90,7 +90,7 @@ void ComboChoicesWithTreeModel::create_model_non_db(guint columns_count)
m_vec_model_columns_string_fixed.resize(1, 0);
if(columns_count > 0)
{
- type_model_column_string_fixed* model_column = new type_model_column_string_fixed();
+ auto model_column = new type_model_column_string_fixed();
//Store it so we can use it and delete it later:
m_vec_model_columns_string_fixed.push_back(model_column);
@@ -341,7 +341,7 @@ void ComboChoicesWithTreeModel::set_cell_for_field_value(Gtk::CellRenderer* cell
{
case(Field::glom_field_type::BOOLEAN):
{
- Gtk::CellRendererToggle* pDerived = dynamic_cast<Gtk::CellRendererToggle*>(cell);
+ auto pDerived = dynamic_cast<Gtk::CellRendererToggle*>(cell);
if(pDerived)
pDerived->set_active( (value.get_value_type() == G_TYPE_BOOLEAN) && value.get_boolean() );
@@ -349,7 +349,7 @@ void ComboChoicesWithTreeModel::set_cell_for_field_value(Gtk::CellRenderer* cell
}
case(Field::glom_field_type::IMAGE):
{
- Gtk::CellRendererPixbuf* pDerived = dynamic_cast<Gtk::CellRendererPixbuf*>(cell);
+ auto pDerived = dynamic_cast<Gtk::CellRendererPixbuf*>(cell);
if(pDerived)
{
const auto pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
@@ -367,7 +367,7 @@ void ComboChoicesWithTreeModel::set_cell_for_field_value(Gtk::CellRenderer* cell
default:
{
//TODO: Maybe we should have custom cellcells for time, date, and numbers.
- Gtk::CellRendererText* pDerived = dynamic_cast<Gtk::CellRendererText*>(cell);
+ auto pDerived = dynamic_cast<Gtk::CellRendererText*>(cell);
if(pDerived)
{
//std::cout << "debug: " << G_STRFUNC << ": field name=" << field->get_name() << ", glom type=" <<
field->get_glom_type() << std::endl;
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index dd7ba89..9368e16 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -76,7 +76,7 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
LayoutWidgetField* pFieldWidget = nullptr;
if(glom_type == Field::glom_field_type::BOOLEAN)
{
- DataWidgetChildren::CheckButton* checkbutton = Gtk::manage( new DataWidgetChildren::CheckButton() );
+ auto checkbutton = Gtk::manage( new DataWidgetChildren::CheckButton() );
checkbutton->show();
checkbutton->signal_toggled().connect( sigc::mem_fun(*this, &DataWidget::on_widget_edited) );
@@ -91,9 +91,9 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
}
else if(glom_type == Field::glom_field_type::IMAGE)
{
- ImageGlom* image = Gtk::manage( new ImageGlom() );
+ auto image = Gtk::manage( new ImageGlom() );
image->set_size_request(200, 200);
- //Gtk::Image* image = Gtk::manage( new Gtk::Image("/home/murrayc/gnome-small.jpg") );
+ //auto image = Gtk::manage( new Gtk::Image("/home/murrayc/gnome-small.jpg") );
image->show();
//TODO: Respond to double-click: checkbutton->signal_toggled().connect( sigc::mem_fun(*this,
&DataWidget::on_widget_edited) );
@@ -115,7 +115,7 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
//Use a Combo if there is a drop-down of choices (A "value list"), else an Entry:
if(field->get_formatting_used().get_has_choices())
{
- DataWidgetChildren::ComboChoices* combo = create_combo_widget_for_field(field);
+ auto combo = create_combo_widget_for_field(field);
if(field->get_formatting_used().get_has_custom_choices())
{
@@ -144,12 +144,12 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
{
if((glom_type == Field::glom_field_type::TEXT) &&
(field->get_formatting_used().get_text_format_multiline()))
{
- DataWidgetChildren::TextView* textview = Gtk::manage(new DataWidgetChildren::TextView(glom_type));
+ auto textview = Gtk::manage(new DataWidgetChildren::TextView(glom_type));
pFieldWidget = textview;
}
else //DATE, NUMBER, etc.
{
- DataWidgetChildren::Entry* entry = Gtk::manage(new DataWidgetChildren::Entry(glom_type));
+ auto entry = Gtk::manage(new DataWidgetChildren::Entry(glom_type));
pFieldWidget = entry;
}
@@ -209,7 +209,7 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
if(glom_type == Field::glom_field_type::DATE)
{
//Let the user choose a date from a calendar dialog:
- Gtk::Button* button_date = Gtk::manage(new Gtk::Button(_("..."))); //TODO: A better label/icon for
"Choose Date".
+ auto button_date = Gtk::manage(new Gtk::Button(_("..."))); //TODO: A better label/icon for "Choose
Date".
button_date->set_tooltip_text(_("Choose a date from an on-screen calendar."));
button_date->show();
hbox_parent->pack_start(*button_date, Gtk::PACK_SHRINK);
@@ -229,12 +229,12 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
//can generally not be edited via another table's layout.
if(field_used_in_relationship_to_one)
{
- Gtk::Button* button_select = Gtk::manage(new Gtk::Button(_("_Find"), true));
+ auto button_select = Gtk::manage(new Gtk::Button(_("_Find"), true));
button_select->set_tooltip_text(_("Enter search criteria to identify records in the other table, to
choose an ID for this field."));
hbox_parent->pack_start(*button_select, Gtk::PACK_SHRINK);
button_select->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_select_id));
- Gtk::Button* button_new = Gtk::manage(new Gtk::Button(_("_New"), true));
+ auto button_new = Gtk::manage(new Gtk::Button(_("_New"), true));
button_new->set_tooltip_text(_("Enter details for a new record in the other table, then use its ID
for this field."));
hbox_parent->pack_start(*button_new, Gtk::PACK_SHRINK);
button_new->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_new_id));
@@ -275,8 +275,8 @@ DataWidget::type_signal_choices_changed DataWidget::signal_choices_changed()
void DataWidget::set_value(const Gnome::Gda::Value& value)
{
- Gtk::Widget* widget = get_data_child_widget();
- LayoutWidgetField* generic_field_widget = dynamic_cast<LayoutWidgetField*>(widget);
+ auto widget = get_data_child_widget();
+ auto generic_field_widget = dynamic_cast<LayoutWidgetField*>(widget);
if(generic_field_widget)
{
//if(generic_field_widget->get_layout_item())
@@ -286,7 +286,7 @@ void DataWidget::set_value(const Gnome::Gda::Value& value)
}
else
{
- Gtk::CheckButton* checkbutton = dynamic_cast<Gtk::CheckButton*>(widget);
+ auto checkbutton = dynamic_cast<Gtk::CheckButton*>(widget);
if(checkbutton)
{
bool bValue = false;
@@ -315,12 +315,12 @@ void DataWidget::update_go_to_details_button_sensitivity()
Gnome::Gda::Value DataWidget::get_value() const
{
const auto widget = get_data_child_widget();
- const LayoutWidgetField* generic_field_widget = dynamic_cast<const LayoutWidgetField*>(widget);
+ const auto generic_field_widget = dynamic_cast<const LayoutWidgetField*>(widget);
if(generic_field_widget)
return generic_field_widget->get_value();
else
{
- const Gtk::CheckButton* checkbutton = dynamic_cast<const Gtk::CheckButton*>(widget);
+ const auto checkbutton = dynamic_cast<const Gtk::CheckButton*>(widget);
if(checkbutton)
{
return Gnome::Gda::Value(checkbutton->get_active());
@@ -372,13 +372,13 @@ int DataWidget::get_suitable_width(const std::shared_ptr<const LayoutItem_Field>
void DataWidget::set_viewable(bool viewable)
{
- Gtk::Widget* child = get_data_child_widget();
- Gtk::Entry* entry = dynamic_cast<Gtk::Entry*>(child);
+ auto child = get_data_child_widget();
+ auto entry = dynamic_cast<Gtk::Entry*>(child);
if(entry)
entry->set_visibility(viewable); //TODO: This is not an ideal way to show non-viewable fields..
else
{
- Gtk::CheckButton* checkbutton = dynamic_cast<Gtk::CheckButton*>(child);
+ auto checkbutton = dynamic_cast<Gtk::CheckButton*>(child);
if(checkbutton)
checkbutton->property_inconsistent() = !viewable;
}
@@ -386,8 +386,8 @@ void DataWidget::set_viewable(bool viewable)
void DataWidget::set_editable(bool editable)
{
- Gtk::Widget* child = get_data_child_widget();
- Gtk::Editable* gtkeditable = dynamic_cast<Gtk::Editable*>(child);
+ auto child = get_data_child_widget();
+ auto gtkeditable = dynamic_cast<Gtk::Editable*>(child);
if(gtkeditable)
{
gtkeditable->set_editable(editable);
@@ -399,7 +399,7 @@ void DataWidget::set_editable(bool editable)
//and our TextView class actually derives from ScrolledView anyway,
//and out LayoutWidgetBase::set_read_only() override takes care of it instead.
//But let's leave this here just in case:
- Gtk::TextView* textview =
+ auto textview =
dynamic_cast<Gtk::TextView*>(child);
if(textview)
{
@@ -407,14 +407,14 @@ void DataWidget::set_editable(bool editable)
return;
}
- LayoutWidgetBase* base = dynamic_cast<LayoutWidgetBase*>(child);
+ auto base = dynamic_cast<LayoutWidgetBase*>(child);
if(base)
{
base->set_read_only(!editable);
return;
}
- Gtk::CheckButton* checkbutton = dynamic_cast<Gtk::CheckButton*>(child);
+ auto checkbutton = dynamic_cast<Gtk::CheckButton*>(child);
if(checkbutton)
checkbutton->set_sensitive(editable);
}
@@ -426,7 +426,7 @@ bool DataWidget::on_button_press_event(GdkEventButton *button_event)
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
//TODO: Avoid doing this multiple times:
@@ -504,7 +504,7 @@ std::shared_ptr<LayoutItem_Field> DataWidget::offer_field_layout(const std::shar
add_view(dialog); //Give it access to the document.
dialog->set_field(start_field, m_table_name);
- Gtk::Window* parent = get_appwindow();
+ auto parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
@@ -569,7 +569,7 @@ void DataWidget::on_child_user_requested_layout()
AppWindow* DataWidget::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -635,7 +635,7 @@ void DataWidget::on_button_choose_date()
if(dialog)
{
- Gtk::Window* parent = get_appwindow(); //This doesn't work (and would be wrong) when the widget is in a
Field Definitions dialog.
+ auto parent = get_appwindow(); //This doesn't work (and would be wrong) when the widget is in a Field
Definitions dialog.
if(parent)
dialog->set_transient_for(*parent);
dialog->set_date_chosen(get_value());
@@ -674,7 +674,7 @@ bool DataWidget::offer_related_record_id_find(Gnome::Gda::Value& chosen_id)
if(dialog)
{
//dialog->set_document(get_document(), table_name, field);
- Gtk::Window* parent = get_appwindow();
+ auto parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
add_view(dialog);
@@ -723,7 +723,7 @@ bool DataWidget::offer_related_record_id_new(Gnome::Gda::Value& chosen_id)
if(dialog)
{
//dialog->set_document(get_document(), table_name, field);
- Gtk::Window* parent = get_appwindow();
+ auto parent = get_appwindow();
if(parent)
dialog->set_transient_for(*parent);
add_view(dialog);
diff --git a/glom/mode_data/datawidget/entry.cc b/glom/mode_data/datawidget/entry.cc
index f85c426..432a843 100644
--- a/glom/mode_data/datawidget/entry.cc
+++ b/glom/mode_data/datawidget/entry.cc
@@ -192,7 +192,7 @@ bool Entry::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -224,7 +224,7 @@ bool Entry::on_button_press_event(GdkEventButton *button_event)
AppWindow* Entry::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/mode_data/datawidget/label.cc b/glom/mode_data/datawidget/label.cc
index e771107..a416bb8 100644
--- a/glom/mode_data/datawidget/label.cc
+++ b/glom/mode_data/datawidget/label.cc
@@ -70,7 +70,7 @@ void Label::init()
AppWindow* Label::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -104,7 +104,7 @@ void Label::on_menu_properties_activate()
bool Label::on_button_press_event(GdkEventButton *button_event)
{
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
diff --git a/glom/mode_data/datawidget/textview.cc b/glom/mode_data/datawidget/textview.cc
index 1b0a42b..ae958d1 100644
--- a/glom/mode_data/datawidget/textview.cc
+++ b/glom/mode_data/datawidget/textview.cc
@@ -170,7 +170,7 @@ Gnome::Gda::Value TextView::get_value() const
std::shared_ptr<const LayoutItem_Field>layout_item = std::dynamic_pointer_cast<const
LayoutItem_Field>(get_layout_item());
- TextView* pNonConstThis = const_cast<TextView*>(this); //Gtk::TextBuffer::get_text() is non-const in gtkmm
<=2.6.
+ auto pNonConstThis = const_cast<TextView*>(this); //Gtk::TextBuffer::get_text() is non-const in gtkmm
<=2.6.
return Conversions::parse_value(m_glom_type, pNonConstThis->m_TextView.get_buffer()->get_text(true),
layout_item->get_formatting_used().m_numeric_format, success);
}
@@ -179,7 +179,7 @@ bool TextView::on_button_press_event(GdkEventButton *button_event)
{
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -211,7 +211,7 @@ bool TextView::on_button_press_event(GdkEventButton *button_event)
AppWindow* TextView::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index d1b3ddf..aca75c0 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -326,7 +326,7 @@ bool DbTreeModel::refresh_from_database(const FoundSet& found_set)
//Connect to database:
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(connection_pool)
{
m_connection = connection_pool->connect();
@@ -363,7 +363,7 @@ bool DbTreeModel::refresh_from_database(const FoundSet& found_set)
// a) make this code dependent on the database backend used.
// b) fetch rows we perhaps don't need, if only the first few rows of
// a table are accessed.
- ConnectionPool* connection = ConnectionPool::get_instance();
+ auto connection = ConnectionPool::get_instance();
if(connection && !connection->get_backend_supports_cursor())
m_gda_datamodel = Gnome::Gda::DataAccessWrapper::create(m_gda_datamodel);
@@ -775,7 +775,7 @@ void DbTreeModel::set_value_impl(const iterator& row, int column, const Glib::Va
//It can't work with anything else anyway.
typedef Glib::Value< DbValue > ValueDbValue;
- const ValueDbValue* pDbValue = static_cast<const ValueDbValue*>(&value);
+ const auto pDbValue = static_cast<const ValueDbValue*>(&value);
if(!pDbValue)
std::cerr << G_STRFUNC << ": value is not a Value< DbValue >." << std::endl;
else
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 05b1a8f..a161561 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -125,7 +125,7 @@ DbAddDel::DbAddDel()
DbAddDel::~DbAddDel()
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->remove_developer_action(m_refContextLayout);
@@ -243,7 +243,7 @@ void DbAddDel::setup_menu(Gtk::Widget* /* widget */)
sigc::mem_fun(*this, &DbAddDel::on_MenuPopup_activate_layout) );
//TODO: This does not work until this widget is in a container in the window:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -288,7 +288,7 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *button_event)
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -462,7 +462,7 @@ bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, const std::shar
const auto test = get_view_column_index(treemodel_col, view_column_index);
if(test)
{
- Gtk::TreeView::Column* pColumn = m_TreeView.get_column(view_column_index);
+ auto pColumn = m_TreeView.get_column(view_column_index);
if(pColumn)
{
if(pColumn != m_treeviewcolumn_button) //This would activate the button. Let's avoid this, though it
should never happen.
@@ -562,14 +562,14 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const std:
{
InnerIgnore innerIgnore(this); //see comments for InnerIgnore class
- Gtk::CellRenderer* pCellRenderer = create_cell(layout_item, m_table_name, get_document(),
get_fixed_cell_height());
+ auto pCellRenderer = create_cell(layout_item, m_table_name, get_document(), get_fixed_cell_height());
std::shared_ptr<const LayoutItem_Field> item_field = std::dynamic_pointer_cast<const
LayoutItem_Field>(layout_item);
//Set extra cellrenderer attributes, depending on the type used,
//to support editing:
- Gtk::CellRendererText* pCellRendererText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
+ auto pCellRendererText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
if(pCellRendererText)
{
//Connect to edited signal:
@@ -587,7 +587,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const std:
}
else
{
- Gtk::CellRendererToggle* pCellRendererToggle = dynamic_cast<Gtk::CellRendererToggle*>(pCellRenderer);
+ auto pCellRendererToggle = dynamic_cast<Gtk::CellRendererToggle*>(pCellRenderer);
if(pCellRendererToggle)
{
pCellRendererToggle->property_activatable() = true;
@@ -601,7 +601,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const std:
}
else
{
- Gtk::CellRendererPixbuf* pCellRendererPixbuf = dynamic_cast<Gtk::CellRendererPixbuf*>(pCellRenderer);
+ auto pCellRendererPixbuf = dynamic_cast<Gtk::CellRendererPixbuf*>(pCellRenderer);
if(pCellRendererPixbuf)
{
//TODO: Do something when it's clicked, such as show the big image in a window or tooltip?
@@ -609,7 +609,7 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const std:
}
}
- GlomCellRenderer_ButtonText* pCellButton = Gtk::manage( new GlomCellRenderer_ButtonText() );
+ auto pCellButton = Gtk::manage( new GlomCellRenderer_ButtonText() );
if(pCellButton)
{
std::shared_ptr<const LayoutItem_Button> item_button = std::dynamic_pointer_cast<const
LayoutItem_Button>(layout_item);
@@ -659,7 +659,7 @@ void DbAddDel::construct_specified_columns()
int view_column_index = 0;
{
- GlomCellRenderer_ButtonImage* pCellButton = Gtk::manage(new GlomCellRenderer_ButtonImage());
+ auto pCellButton = Gtk::manage(new GlomCellRenderer_ButtonImage());
pCellButton->signal_clicked().connect(sigc::mem_fun(*this, &DbAddDel::on_cell_button_clicked));
@@ -716,7 +716,7 @@ void DbAddDel::construct_specified_columns()
}
//Add the ViewColumn
- Gtk::CellRenderer* pCellRenderer = construct_specified_columns_cellrenderer(layout_item,
model_column_index, item_data_model_column_index);
+ auto pCellRenderer = construct_specified_columns_cellrenderer(layout_item, model_column_index,
item_data_model_column_index);
if(pCellRenderer)
{
//Get the index of the field in the query, if it is a field:
@@ -880,7 +880,7 @@ void DbAddDel::refresh_cell_choices_data_from_database_with_foreign_key(guint mo
return;
}
- CellRendererDbList* cell =
+ auto cell =
dynamic_cast<CellRendererDbList*>( m_TreeView.get_column_cell_renderer(view_column_index) );
if(!cell)
{
@@ -1073,7 +1073,7 @@ void DbAddDel::set_column_choices(guint col, const type_vec_strings& vecStrings)
const auto test = get_view_column_index(col, view_column_index);
if(test)
{
- CellRendererDbList* pCellRenderer =
+ auto pCellRenderer =
dynamic_cast<CellRendererDbList*>( m_TreeView.get_column_cell_renderer(view_column_index) );
if(pCellRenderer)
{
@@ -1367,14 +1367,14 @@ void DbAddDel::on_idle_treeview_cell_edited_revert(const Gtk::TreeModel::Row& ro
guint view_column_index = 0;
get_view_column_index(model_column_index, view_column_index);
- Gtk::TreeView::Column* pColumn = m_TreeView.get_column(view_column_index);
+ auto pColumn = m_TreeView.get_column(view_column_index);
if(!pColumn)
{
std::cerr << G_STRFUNC << ": pColumn is null." << std::endl;
return;
}
- Gtk::CellRendererText* pCell = dynamic_cast<Gtk::CellRendererText*>(pColumn->get_first_cell());
+ auto pCell = dynamic_cast<Gtk::CellRendererText*>(pColumn->get_first_cell());
if(!pCell)
{
std::cerr << G_STRFUNC << ": pCell is null." << std::endl;
@@ -1687,7 +1687,7 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
{
InnerIgnore innerIgnore(this); //see comments for InnerIgnore class
- DbTreeViewColumnGlom* pViewColumn = Gtk::manage( new
DbTreeViewColumnGlom(Utils::string_escape_underscores(title), cellrenderer) );
+ auto pViewColumn = Gtk::manage( new DbTreeViewColumnGlom(Utils::string_escape_underscores(title),
cellrenderer) );
//This is needed by fixed-height mode. We get critical warnings otherwise.
//But we must call set_fixed_width() later or we will have a zero-width column.
@@ -1922,7 +1922,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
{
case(Field::glom_field_type::BOOLEAN):
{
- Gtk::CellRendererToggle* pDerived = dynamic_cast<Gtk::CellRendererToggle*>(renderer);
+ auto pDerived = dynamic_cast<Gtk::CellRendererToggle*>(renderer);
if(pDerived)
pDerived->set_active( (value.get_value_type() == G_TYPE_BOOLEAN) && value.get_boolean() );
@@ -1930,7 +1930,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
}
case(Field::glom_field_type::IMAGE):
{
- Gtk::CellRendererPixbuf* pDerived = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
+ auto pDerived = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
if(pDerived)
{
Glib::RefPtr<Gdk::Pixbuf> pixbuf = UiUtils::get_pixbuf_for_gda_value(value);
@@ -1949,7 +1949,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
default:
{
//TODO: Maybe we should have custom cellrenderers for time, date, and numbers.
- Gtk::CellRendererText* pDerived = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto pDerived = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(pDerived)
{
//std::cout << "debug: " << G_STRFUNC << ": field name=" << field->get_name() << ", glom type="
<< field->get_glom_type() << std::endl;
@@ -1992,7 +1992,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
AppWindow* DbAddDel::get_appwindow()
{
- Gtk::Container* pWindow = get_toplevel();
+ auto pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -2005,10 +2005,10 @@ void DbAddDel::on_treeview_cell_editing_started(Gtk::CellEditable* cell_editable
if(m_validation_retry)
{
//This is the CellEditable inside the CellRenderer.
- Gtk::CellEditable* celleditable_validated = cell_editable;
+ auto celleditable_validated = cell_editable;
//It's usually an Entry, at least for a CellRendererText:
- Gtk::Entry* pEntry = dynamic_cast<Gtk::Entry*>(celleditable_validated);
+ auto pEntry = dynamic_cast<Gtk::Entry*>(celleditable_validated);
if(pEntry)
{
pEntry->set_text(m_validation_invalid_text_for_retry);
@@ -2132,7 +2132,7 @@ void DbAddDel::user_changed(const Gtk::TreeModel::iterator& row, guint col)
Glib::ustring table_name = m_found_set.m_table_name;
std::shared_ptr<Field> primary_key_field;
Gnome::Gda::Value primary_key_value;
- Gtk::Window* window = get_appwindow();
+ auto window = get_appwindow();
//Just update the record:
try
@@ -2149,7 +2149,7 @@ void DbAddDel::user_changed(const Gtk::TreeModel::iterator& row, guint col)
//plus how to identify the record in that table.
const auto relationship_name = layout_field->get_relationship_name();
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
std::shared_ptr<Relationship> relationship = document->get_relationship(m_found_set.m_table_name,
relationship_name);
if(relationship)
@@ -2452,7 +2452,7 @@ void DbAddDel::treeview_delete_all_columns()
const Gtk::Window* DbAddDel::get_app_window() const
{
- DbAddDel* nonconst = const_cast<DbAddDel*>(this);
+ auto nonconst = const_cast<DbAddDel*>(this);
return nonconst->get_app_window();
}
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index cfdc1a5..34107b2 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -64,13 +64,13 @@ FlowTableWithFields::~FlowTableWithFields()
//Remove views. The widgets are deleted automatically because they are managed.
for(const auto& the_pair : m_listFields)
{
- View_Composite_Glom* pViewFirst = dynamic_cast<View_Composite_Glom*>(the_pair.m_first);
+ auto pViewFirst = dynamic_cast<View_Composite_Glom*>(the_pair.m_first);
if(pViewFirst)
{
remove_view(pViewFirst);
}
- View_Composite_Glom* pViewSecond = dynamic_cast<View_Composite_Glom*>(the_pair.m_second);
+ auto pViewSecond = dynamic_cast<View_Composite_Glom*>(the_pair.m_second);
if(pViewSecond)
{
remove_view(pViewSecond);
@@ -159,12 +159,12 @@ void FlowTableWithFields::add_layout_group(const std::shared_ptr<LayoutGroup>& g
if(true)//!fields.empty() && !group_name.empty())
{
- Gtk::Frame* frame = Gtk::manage( new Gtk::Frame ); //TODO_leak: This is possibly leaked, according to
valgrind.
+ auto frame = Gtk::manage( new Gtk::Frame ); //TODO_leak: This is possibly leaked, according to valgrind.
const auto group_title = item_get_title(group);
if(!group_title.empty())
{
- Gtk::Label* label = Gtk::manage( new Gtk::Label ); //TODO: This is maybe leaked, according to
valgrind, though it should be managed by GtkFrame.
+ auto label = Gtk::manage( new Gtk::Label ); //TODO: This is maybe leaked, according to valgrind,
though it should be managed by GtkFrame.
label->set_markup( UiUtils::bold_message(group_title) );
label->show();
frame->set_label_widget(*label);
@@ -173,7 +173,7 @@ void FlowTableWithFields::add_layout_group(const std::shared_ptr<LayoutGroup>& g
frame->set_shadow_type(Gtk::SHADOW_NONE); //HIG-style
frame->show();
- FlowTableWithFields* flow_table = Gtk::manage( new FlowTableWithFields() );
+ auto flow_table = Gtk::manage( new FlowTableWithFields() );
flow_table->set_find_mode(m_find_mode);
add_view(flow_table); //Allow these sub-flowtables to access the document too.
flow_table->set_table(m_table_name);
@@ -185,7 +185,7 @@ void FlowTableWithFields::add_layout_group(const std::shared_ptr<LayoutGroup>& g
flow_table->set_vertical_spacing(get_vertical_spacing());
flow_table->show();
- Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is
possibly leaked.
+ auto event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is possibly leaked.
event_box->add(*flow_table);
event_box->set_visible_window(false);
#ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -249,10 +249,10 @@ Box_Data_List_Related* FlowTableWithFields::create_related(const std::shared_ptr
if(!portal)
return 0;
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(pDocument)
{
- Box_Data_List_Related* portal_box = Gtk::manage(new Box_Data_List_Related);
+ auto portal_box = Gtk::manage(new Box_Data_List_Related);
portal_box->set_find_mode(m_find_mode);
add_view(portal_box); //Give it access to the document, needed to get the layout and fields information.
@@ -289,10 +289,10 @@ Box_Data_Calendar_Related* FlowTableWithFields::create_related_calendar(const st
if(!portal)
return 0;
- Document* pDocument = static_cast<Document*>(get_document());
+ auto pDocument = static_cast<Document*>(get_document());
if(pDocument)
{
- Box_Data_Calendar_Related* portal_box = Gtk::manage(new Box_Data_Calendar_Related);
+ auto portal_box = Gtk::manage(new Box_Data_Calendar_Related);
portal_box->set_find_mode(m_find_mode); //TODO: Implement this in the class
add_view(portal_box); //Give it access to the document, needed to get the layout and fields information.
@@ -348,7 +348,7 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
return;
//Add the widget:
- NotebookGlom* notebook_widget = Gtk::manage(new NotebookGlom());
+ auto notebook_widget = Gtk::manage(new NotebookGlom());
notebook_widget->show();
notebook_widget->set_layout_item(notebook, m_table_name);
@@ -359,10 +359,10 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
if(group)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
- NotebookLabel* tab_label = Gtk::manage(new NotebookLabel(notebook_widget));
+ auto tab_label = Gtk::manage(new NotebookLabel(notebook_widget));
tab_label->show();
#else
- Gtk::Label* tab_label = Gtk::manage(new Gtk::Label());
+ auto tab_label = Gtk::manage(new Gtk::Label());
tab_label->show();
#endif
@@ -372,7 +372,7 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
if(portal)
{
//Add a Related Records list for this portal:
- Box_Data_List_Related* portal_box = create_related(portal, false /* no label, because it's in the
tab instead. */);
+ auto portal_box = create_related(portal, false /* no label, because it's in the tab instead. */);
//portal_box->set_border_width(Utils::to_utype(Glom::UiUtils::DefaultSpacings::SMALL)); It has
margins around the frame's child widget instead.
portal_box->show();
notebook_widget->append_page(*portal_box, *tab_label);
@@ -382,7 +382,7 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
else
{
//Add a FlowTable for this group:
- FlowTableWithFields* flow_table = Gtk::manage( new FlowTableWithFields() );
+ auto flow_table = Gtk::manage( new FlowTableWithFields() );
flow_table->set_find_mode(m_find_mode);
add_view(flow_table); //Allow these sub-flowtables to access the document too.
flow_table->set_table(m_table_name);
@@ -393,7 +393,7 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
flow_table->show();
// Put the new flowtable in an event box to catch events
- Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is
possibly leaked.
+ auto event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is possibly
leaked.
event_box->add(*flow_table);
event_box->set_visible_window(false);
#ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -449,7 +449,7 @@ void FlowTableWithFields::add_field(const std::shared_ptr<LayoutItem_Field>& lay
info.m_field = layoutitem_field;
//Add the entry or checkbox (handled by the DataWidget)
- DataWidget* pDataWidget = Gtk::manage(new DataWidget(layoutitem_field, table_name, get_document()) );
//TODO_Leak: Possibly leaked, according to valgrind.
+ auto pDataWidget = Gtk::manage(new DataWidget(layoutitem_field, table_name, get_document()) );
//TODO_Leak: Possibly leaked, according to valgrind.
add_layoutwidgetbase(pDataWidget);
add_view(pDataWidget); //So it can get the document.
@@ -460,10 +460,10 @@ void FlowTableWithFields::add_field(const std::shared_ptr<LayoutItem_Field>& lay
//We put it inside a box so that halign works as we want.
//See https://mail.gnome.org/archives/gtk-devel-list/2014-July/msg00005.html
- Gtk::Label* label = info.m_second->get_label();
+ auto label = info.m_second->get_label();
if(label && !label->get_text().empty())
{
- Gtk::Box* boxLabel = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+ auto boxLabel = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
boxLabel->show();
boxLabel->pack_start(*label);
info.m_first = boxLabel;
@@ -491,7 +491,7 @@ void FlowTableWithFields::add_field(const std::shared_ptr<LayoutItem_Field>& lay
label->set_valign(Gtk::ALIGN_START); //Center is neater next to entries, but center is silly next to
large images.
}
- Gtk::EventBox* eventbox = Gtk::manage(new Gtk::EventBox());
+ auto eventbox = Gtk::manage(new Gtk::EventBox());
if(info.m_first)
eventbox->add(*info.m_first);
@@ -521,7 +521,7 @@ void FlowTableWithFields::add_field(const std::shared_ptr<LayoutItem_Field>& lay
void FlowTableWithFields::add_button(const std::shared_ptr<LayoutItem_Button>& layoutitem_button, const
Glib::ustring& table_name)
{
//Add the widget
- ButtonGlom* button = Gtk::manage(new ButtonGlom());
+ auto button = Gtk::manage(new ButtonGlom());
button->set_label(item_get_title_or_name(layoutitem_button));
button->set_layout_item(layoutitem_button, table_name);
button->signal_clicked().connect(
@@ -536,14 +536,14 @@ void FlowTableWithFields::add_button(const std::shared_ptr<LayoutItem_Button>& l
const Formatting::HorizontalAlignment alignment =
layoutitem_button->get_formatting_used_horizontal_alignment();
- Gtk::Widget* widget_to_add = button;
+ Gtk::Widget *widget_to_add = button;
bool expand = false;
if(alignment != Formatting::HorizontalAlignment::LEFT)
{
//Put the button in a Gtk::Box so we can have non-default alignment in
//its space. Note that we will need a different technique if we ever
//support center alignment.
- Gtk::Box* box_button = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
+ auto box_button = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
box_button->show();
if(alignment == Formatting::HorizontalAlignment::RIGHT)
box_button->pack_end(*button, Gtk::PACK_SHRINK);
@@ -563,7 +563,7 @@ void FlowTableWithFields::add_textobject(const std::shared_ptr<LayoutItem_Text>&
{
//Add the widget:
const auto text = layoutitem_text->get_text(AppWindow::get_current_locale());
- DataWidgetChildren::Label* label = Gtk::manage(new DataWidgetChildren::Label(text));
+ auto label = Gtk::manage(new DataWidgetChildren::Label(text));
label->set_layout_item(layoutitem_text, table_name);
const Formatting::HorizontalAlignment alignment =
@@ -584,7 +584,7 @@ void FlowTableWithFields::add_textobject(const std::shared_ptr<LayoutItem_Text>&
}
else
{
- DataWidgetChildren::Label* title_label = Gtk::manage(new DataWidgetChildren::Label(title,
Gtk::ALIGN_START, Gtk::ALIGN_START, false));
+ auto title_label = Gtk::manage(new DataWidgetChildren::Label(title, Gtk::ALIGN_START, Gtk::ALIGN_START,
false));
title_label->set_layout_item(layoutitem_text, table_name);
title_label->set_halign(Gtk::ALIGN_END);
title_label->set_valign(Gtk::ALIGN_CENTER);
@@ -598,7 +598,7 @@ void FlowTableWithFields::add_textobject(const std::shared_ptr<LayoutItem_Text>&
void FlowTableWithFields::add_imageobject(const std::shared_ptr<LayoutItem_Image>& layoutitem_image, const
Glib::ustring& table_name)
{
//Add the widget:
- ImageGlom* image = Gtk::manage(new ImageGlom());
+ auto image = Gtk::manage(new ImageGlom());
image->set_size_request(200, 200);
image->set_value(layoutitem_image->get_image());
image->set_read_only(); //Only field images can be changed by the user when they are on a layout.
@@ -615,7 +615,7 @@ void FlowTableWithFields::add_imageobject(const std::shared_ptr<LayoutItem_Image
}
else
{
- Gtk::Label* title_label = Gtk::manage(new Gtk::Label(title));
+ auto title_label = Gtk::manage(new Gtk::Label(title));
title_label->set_halign(Gtk::ALIGN_END);
title_label->set_valign(Gtk::ALIGN_CENTER);
title_label->show();
@@ -647,13 +647,13 @@ void FlowTableWithFields::remove_field(const Glib::ustring& id)
{
remove(*(info.m_first));
- View_Composite_Glom* pViewFirst = dynamic_cast<View_Composite_Glom*>(info.m_first);
+ auto pViewFirst = dynamic_cast<View_Composite_Glom*>(info.m_first);
if(pViewFirst)
remove_view(pViewFirst);
delete info.m_first;
- View_Composite_Glom* pViewSecond = dynamic_cast<View_Composite_Glom*>(info.m_second);
+ auto pViewSecond = dynamic_cast<View_Composite_Glom*>(info.m_second);
if(pViewSecond)
remove_view(pViewSecond);
@@ -713,7 +713,7 @@ Gnome::Gda::Value FlowTableWithFields::get_field_value(const std::shared_ptr<con
for(type_list_const_widgets::const_iterator iter = list_widgets.begin();
iter != list_widgets.end(); ++iter)
{
- const DataWidget* datawidget = dynamic_cast<const DataWidget*>(*iter);
+ const auto datawidget = dynamic_cast<const DataWidget*>(*iter);
if(!datawidget)
continue;
@@ -730,7 +730,7 @@ void FlowTableWithFields::set_field_editable(const std::shared_ptr<const LayoutI
{
for(const auto& item : get_field(field, true))
{
- DataWidget* datawidget = dynamic_cast<DataWidget*>(item);
+ auto datawidget = dynamic_cast<DataWidget*>(item);
if(datawidget)
{
datawidget->set_editable(editable);
@@ -742,11 +742,11 @@ void FlowTableWithFields::update_choices(const std::shared_ptr<const LayoutItem_
{
for(const auto& item : get_field(field, true))
{
- DataWidget* datawidget = dynamic_cast<DataWidget*>(item);
+ auto datawidget = dynamic_cast<DataWidget*>(item);
if(!datawidget)
continue;
- DataWidgetChildren::ComboChoices* combo =
+ auto combo =
dynamic_cast<DataWidgetChildren::ComboChoices*>(datawidget->get_data_child_widget());
if(!combo)
continue;
@@ -819,12 +819,12 @@ FlowTableWithFields::type_choice_widgets FlowTableWithFields::get_choice_widgets
//Check the single-item widgets:
for(const auto& the_pair : m_listFields)
{
- DataWidget* widget = the_pair.m_second;
+ auto widget = the_pair.m_second;
if(!widget)
continue;
- Gtk::Widget* child_widget = widget->get_data_child_widget();
- DataWidgetChildren::ComboChoices* combochoices =
dynamic_cast<DataWidgetChildren::ComboChoices*>(child_widget);
+ auto child_widget = widget->get_data_child_widget();
+ auto combochoices = dynamic_cast<DataWidgetChildren::ComboChoices*>(child_widget);
if(!combochoices)
continue;
@@ -968,11 +968,11 @@ void FlowTableWithFields::remove_all()
//Remove views. The widgets are deleted automatically because they are managed.
for(const auto& the_pair : m_listFields)
{
- View_Composite_Glom* pViewFirst = dynamic_cast<View_Composite_Glom*>(the_pair.m_first);
+ auto pViewFirst = dynamic_cast<View_Composite_Glom*>(the_pair.m_first);
if(pViewFirst)
remove_view(pViewFirst);
- View_Composite_Glom* pViewSecond = dynamic_cast<View_Composite_Glom*>(the_pair.m_second);
+ auto pViewSecond = dynamic_cast<View_Composite_Glom*>(the_pair.m_second);
if(pViewSecond)
remove_view(pViewSecond);
}
@@ -1169,7 +1169,7 @@ void FlowTableWithFields::apply_size_groups_to_labels(const type_vec_sizegroups&
//Remove widgets from any existing size group:
for(auto info : m_listFields)
{
- Gtk::Widget* widget = info.m_first;
+ auto widget = info.m_first;
Glib::RefPtr<Gtk::SizeGroup> previous_size_group = info.m_first_in_sizegroup;
if(!widget || !previous_size_group)
continue;
@@ -1185,11 +1185,11 @@ void FlowTableWithFields::apply_size_groups_to_labels(const type_vec_sizegroups&
for(auto info : m_listFields)
{
- Gtk::Widget* label = info.m_first;
+ auto label = info.m_first;
if(!label)
continue;
- Gtk::EventBox* label_parent = info.m_first_eventbox;
+ auto label_parent = info.m_first_eventbox;
if(!label_parent)
continue;
@@ -1303,7 +1303,7 @@ void FlowTableWithFields::on_menu_delete_activate()
bool FlowTableWithFields::on_button_press_event(GdkEventButton *button_event)
{
- AppWindow* pApp = AppWindow::get_appwindow();
+ auto pApp = AppWindow::get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
diff --git a/glom/mode_data/notebook_data.cc b/glom/mode_data/notebook_data.cc
index 5102699..2f08b1d 100644
--- a/glom/mode_data/notebook_data.cc
+++ b/glom/mode_data/notebook_data.cc
@@ -111,7 +111,7 @@ bool Notebook_Data::init_db_details(const FoundSet& found_set, const Gnome::Gda:
//Show the previously-shown record, if there is one, if this is not a new found-set (via a new
where_clause)
//so that returning to this table will return the user to the same record:
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
Gnome::Gda::Value primary_key_for_details;
@@ -171,7 +171,7 @@ bool Notebook_Data::init_db_details(const FoundSet& found_set, const Gnome::Gda:
Glib::ustring current_layout;
if(!details_record_specified)
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
current_layout = document->get_layout_current(m_table_name);
}
@@ -293,7 +293,7 @@ void Notebook_Data::do_menu_developer_layout()
Gtk::Widget* pChild = get_visible_child();
if(pChild)
{
- Box_Data* pBox = dynamic_cast<Box_Data*>(pChild);
+ auto pBox = dynamic_cast<Box_Data*>(pChild);
if(pBox)
pBox->show_layout_dialog();
}
@@ -309,10 +309,10 @@ void Notebook_Data::set_enable_layout_drag_and_drop(bool enable)
void Notebook_Data::do_menu_file_print()
{
- Gtk::Widget* pChild = get_visible_child();
+ auto pChild = get_visible_child();
if(pChild)
{
- Box_Data* pBox = dynamic_cast<Box_Data*>(pChild);
+ auto pBox = dynamic_cast<Box_Data*>(pChild);
if(pBox)
pBox->print_layout();
}
@@ -351,10 +351,10 @@ void Notebook_Data::on_switch_page_handler(Gtk::Widget* pPage)
Notebook_Glom::on_switch_page_handler(pPage);
//Remember that currently-viewed layout, so we can show it again when the user comes back to this table
from elsewhere:
- Box_Data* box = dynamic_cast<Box_Data*>(get_visible_child());
+ auto box = dynamic_cast<Box_Data*>(get_visible_child());
if(box)
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->set_layout_current(m_table_name, box->get_layout_name());
diff --git a/glom/mode_design/box_db_table_relationships.cc b/glom/mode_design/box_db_table_relationships.cc
index ba6c0aa..df9eb16 100644
--- a/glom/mode_design/box_db_table_relationships.cc
+++ b/glom/mode_design/box_db_table_relationships.cc
@@ -77,7 +77,7 @@ bool Box_DB_Table_Relationships::fill_from_database()
bool result = Box_DB_Table::fill_from_database();
- const Document* document = get_document();
+ const auto document = get_document();
if(!document)
return false;
@@ -247,7 +247,7 @@ void Box_DB_Table_Relationships::on_adddel_user_activated(const Gtk::TreeModel::
{
Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
- Document* document = get_document();
+ auto document = get_document();
type_vec_strings vecFields = util_vecStrings_from_Fields(DbUtils::get_fields_for_table(document,
table_name));
//This would cause a lot of tedious re-filling:
@@ -278,7 +278,7 @@ void Box_DB_Table_Relationships::on_adddel_user_requested_delete(const Gtk::Tree
m_AddDel.remove_item(iter);
//Remove it from any layouts, reports, field lookups, etc:
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
std::shared_ptr<const Relationship> relationship = document->get_relationship(m_table_name,
relationship_name);
diff --git a/glom/mode_design/dialog_database_preferences.cc b/glom/mode_design/dialog_database_preferences.cc
index 67582b0..8c588ba 100644
--- a/glom/mode_design/dialog_database_preferences.cc
+++ b/glom/mode_design/dialog_database_preferences.cc
@@ -63,7 +63,7 @@ Dialog_Database_Preferences::Dialog_Database_Preferences(BaseObjectType* cobject
m_treeview_autoincrements->append_column(_("Field"), m_columns.m_col_field);
const int view_cols_count = m_treeview_autoincrements->append_column(_("Next Value"),
m_columns.m_col_next_value);
- Gtk::CellRendererText* pCellRenderer =
dynamic_cast<Gtk::CellRendererText*>(m_treeview_autoincrements->get_column_cell_renderer(view_cols_count-1));
+ auto pCellRenderer =
dynamic_cast<Gtk::CellRendererText*>(m_treeview_autoincrements->get_column_cell_renderer(view_cols_count-1));
if(pCellRenderer)
{
//Make it editable:
@@ -230,7 +230,7 @@ void Dialog_Database_Preferences::save_to_document()
m_glade_variables_map.transfer_widgets_to_variables();
m_system_prefs.m_org_logo = m_image->get_value();
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -264,7 +264,7 @@ void Dialog_Database_Preferences::on_button_test_script()
type_map_fields field_values;
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
diff --git a/glom/mode_design/dialog_design.cc b/glom/mode_design/dialog_design.cc
index c20e1e5..f00772e 100644
--- a/glom/mode_design/dialog_design.cc
+++ b/glom/mode_design/dialog_design.cc
@@ -53,7 +53,7 @@ bool Dialog_Design::init_db_details(const Glib::ustring& table_name)
Glib::ustring table_label = _("None selected");
//Show the table title (if any) and name:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
Glib::ustring table_title = document->get_table_title(table_name, AppWindow::get_current_locale());
diff --git a/glom/mode_design/dialog_initial_password.cc b/glom/mode_design/dialog_initial_password.cc
index c9a8266..75e4e64 100644
--- a/glom/mode_design/dialog_initial_password.cc
+++ b/glom/mode_design/dialog_initial_password.cc
@@ -56,7 +56,7 @@ Glib::ustring Dialog_InitialPassword::get_password() const
void Dialog_InitialPassword::load_from_document()
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
Glib::ustring user = document->get_connection_user(); //TODO: Offer a drop-down list of users.
diff --git a/glom/mode_design/fields/box_db_table_definition.cc
b/glom/mode_design/fields/box_db_table_definition.cc
index 6ef277a..fa633b7 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -212,7 +212,7 @@ void Box_DB_Table_Definition::on_adddel_add(const Gtk::TreeModel::iterator& row)
// unnecessary extra stuff just to get the field added into the
// document:
- Document* pDoc = static_cast<Document*>(get_document());
+ auto pDoc = static_cast<Document*>(get_document());
if(pDoc)
{
std::cout << Utils::to_utype(field->get_glom_type()) << std::endl;
@@ -275,7 +275,7 @@ bool Box_DB_Table_Definition::check_field_change(const std::shared_ptr<const Fie
{
bool result = true; //Tells the caller whether to continue.
- Gtk::Window* parent_window = get_app_window();
+ auto parent_window = get_app_window();
//Warn about a long slow recalculation, and offer the chance to cancel it:
if(field_new->get_has_calculation())
@@ -364,7 +364,7 @@ bool Box_DB_Table_Definition::check_field_change(const std::shared_ptr<const Fie
void Box_DB_Table_Definition::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint /* col */)
{
//Get old field definition:
- Document* pDoc = static_cast<Document*>(get_document());
+ auto pDoc = static_cast<Document*>(get_document());
if(pDoc)
{
const auto strFieldNameBeingEdited = m_AddDel.get_value_key(row);
@@ -417,7 +417,7 @@ void Box_DB_Table_Definition::on_adddel_edit(const Gtk::TreeModel::iterator& row
//m_dialog_field_definition->set_modified(false); //Disable [Apply] at start.
- Gtk::Window* parent_window = get_app_window();
+ auto parent_window = get_app_window();
if(parent_window)
m_dialog_field_definition->set_transient_for(*parent_window);
@@ -433,7 +433,7 @@ void Box_DB_Table_Definition::on_adddel_extra(const Gtk::TreeModel::iterator& ro
//m_dialog_field_definition->set_modified(false); //Disable [Apply] at start.
- Gtk::Window* parent_window = get_app_window();
+ auto parent_window = get_app_window();
if(parent_window)
m_dialog_default_formatting->set_transient_for(*parent_window);
@@ -449,7 +449,7 @@ std::shared_ptr<Field> Box_DB_Table_Definition::get_field_definition(const Gtk::
const auto strFieldNameBeforeEdit = m_AddDel.get_value_key(row);
//Glom field definition:
- Document* pDoc = static_cast<Document*>(get_document());
+ auto pDoc = static_cast<Document*>(get_document());
if(pDoc)
{
Document::type_vec_fields vecFields= pDoc->get_table_fields(m_table_name);
@@ -590,7 +590,7 @@ std::shared_ptr<Field> Box_DB_Table_Definition::change_definition(const std::sha
//Forget the remembered currently-viewed primary key value,
//because it will be useless with a different field as the primary key, or with no field as primary key:
- Document* document = get_document();
+ auto document = get_document();
document->forget_layout_record_viewed(m_table_name);
}
@@ -618,7 +618,7 @@ std::shared_ptr<Field> Box_DB_Table_Definition::change_definition(const std::sha
}
//Extra Glom field definitions:
- Document* pDoc = static_cast<Document*>(get_document());
+ auto pDoc = static_cast<Document*>(get_document());
if(pDoc)
{
//Get Table's fields:
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc
b/glom/mode_design/fields/dialog_fielddefinition.cc
index 31539fd..6dec001 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -155,7 +155,7 @@ void Dialog_FieldDefinition::set_field(const std::shared_ptr<const Field>& field
connect_each_widget(m_pDataWidget_DefaultValueSimple);
- Gtk::Label* pLabel = m_pDataWidget_DefaultValueSimple->get_label();
+ auto pLabel = m_pDataWidget_DefaultValueSimple->get_label();
if(!pLabel->get_text().empty())
{
pLabel->set_valign(Gtk::ALIGN_START); //Because the widget might be multiline.
@@ -172,7 +172,7 @@ void Dialog_FieldDefinition::set_field(const std::shared_ptr<const Field>& field
on_check_lookup_toggled();
//Fill the lookup relationships combo:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
//Get the relationships used by this table, excluding relationships triggered
@@ -347,7 +347,7 @@ void Dialog_FieldDefinition::on_combo_lookup_relationship_changed()
if(relationship)
{
//Get the relationship details:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document)
{
const auto to_table = relationship->get_to_table();
diff --git a/glom/mode_design/iso_codes.cc b/glom/mode_design/iso_codes.cc
index 9f10896..b51dd0b 100644
--- a/glom/mode_design/iso_codes.cc
+++ b/glom/mode_design/iso_codes.cc
@@ -62,7 +62,7 @@ type_list_currencies get_list_of_currency_symbols()
for(const auto& node : nodeRoot->get_children("iso_4217_entry"))
{
- xmlpp::Element* nodeEntry = dynamic_cast<xmlpp::Element*>(node);
+ auto nodeEntry = dynamic_cast<xmlpp::Element*>(node);
if(nodeEntry)
{
Currency currency;
@@ -167,7 +167,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
for(const auto& node : nodeRoot->get_children("iso_639_entry"))
{
- xmlpp::Element* nodeEntry = dynamic_cast<xmlpp::Element*>(node);
+ auto nodeEntry = dynamic_cast<xmlpp::Element*>(node);
if(nodeEntry)
{
//TODO: There are 3 codes (not each entry has each code). Is this the correct one to identify a
language?
@@ -221,7 +221,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
for(const auto& node : nodeRoot->get_children("iso_3166_entry"))
{
- xmlpp::Element* nodeEntry = dynamic_cast<xmlpp::Element*>(node);
+ auto nodeEntry = dynamic_cast<xmlpp::Element*>(node);
if(nodeEntry)
{
const auto attribute_code = nodeEntry->get_attribute("alpha_2_code");
diff --git a/glom/mode_design/layout/dialog_choose_field.cc b/glom/mode_design/layout/dialog_choose_field.cc
index dded491..c4861a8 100644
--- a/glom/mode_design/layout/dialog_choose_field.cc
+++ b/glom/mode_design/layout/dialog_choose_field.cc
@@ -305,7 +305,7 @@ void Dialog_ChooseField::on_combo_relationship_changed()
{
std::shared_ptr<Relationship> relationship = m_combo_relationship->get_selected_relationship();
- Document* pDocument = m_document;
+ auto pDocument = m_document;
if(pDocument)
{
//Show the list of fields from this relationship:
diff --git a/glom/mode_design/layout/dialog_layout_calendar_related.cc
b/glom/mode_design/layout/dialog_layout_calendar_related.cc
index 94445ea..d78bedd 100644
--- a/glom/mode_design/layout/dialog_layout_calendar_related.cc
+++ b/glom/mode_design/layout/dialog_layout_calendar_related.cc
@@ -139,7 +139,7 @@ void Dialog_Layout_Calendar_Related::update_ui(bool including_relationship_list)
const auto related_table_name = m_portal->get_table_used(Glib::ustring() /* parent table - not relevant*/);
//Update the tree models from the document
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
//Fill the relationships combo:
diff --git a/glom/mode_design/layout/dialog_layout_details.cc
b/glom/mode_design/layout/dialog_layout_details.cc
index 1455f36..b30e719 100644
--- a/glom/mode_design/layout/dialog_layout_details.cc
+++ b/glom/mode_design/layout/dialog_layout_details.cc
@@ -100,10 +100,10 @@ Dialog_Layout_Details::Dialog_Layout_Details(BaseObjectType* cobject, const Glib
// Use set_cell_data_func() to give more control over the cell attributes depending on the row:
//Name column:
- Gtk::TreeView::Column* column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
+ auto column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
m_treeview_fields->append_column(*column_name);
- Gtk::CellRendererText* renderer_name = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_name = Gtk::manage(new Gtk::CellRendererText);
column_name->pack_start(*renderer_name);
column_name->set_cell_data_func(*renderer_name, sigc::mem_fun(*this,
&Dialog_Layout_Details::on_cell_data_name));
@@ -116,7 +116,7 @@ Dialog_Layout_Details::Dialog_Layout_Details(BaseObjectType* cobject, const Glib
m_treeview_column_title = Gtk::manage( new Gtk::TreeView::Column(_("Title")) );
m_treeview_fields->append_column(*m_treeview_column_title);
- Gtk::CellRendererText* renderer_title = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_title = Gtk::manage(new Gtk::CellRendererText);
m_treeview_column_title->pack_start(*renderer_title);
m_treeview_column_title->set_cell_data_func(*renderer_title, sigc::mem_fun(*this,
&Dialog_Layout_Details::on_cell_data_title));
@@ -129,7 +129,7 @@ Dialog_Layout_Details::Dialog_Layout_Details(BaseObjectType* cobject, const Glib
m_treeview_column_group_columns = Gtk::manage( new Gtk::TreeView::Column(_("Group Columns")) );
m_treeview_fields->append_column(*m_treeview_column_group_columns);
- Gtk::CellRendererText* renderer_count = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_count = Gtk::manage(new Gtk::CellRendererText);
m_treeview_column_group_columns->pack_start(*renderer_count);
m_treeview_column_group_columns->set_cell_data_func(*renderer_count, sigc::mem_fun(*this,
&Dialog_Layout_Details::on_cell_data_group_columns));
@@ -142,7 +142,7 @@ Dialog_Layout_Details::Dialog_Layout_Details(BaseObjectType* cobject, const Glib
m_treeview_column_column_width = Gtk::manage( new Gtk::TreeView::Column(_("Display Width")) );
m_treeview_fields->append_column(*m_treeview_column_column_width);
- Gtk::CellRendererText* renderer_column_width = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_column_width = Gtk::manage(new Gtk::CellRendererText);
m_treeview_column_column_width->pack_start(*renderer_column_width);
m_treeview_column_column_width->set_cell_data_func(*renderer_column_width, sigc::mem_fun(*this,
&Dialog_Layout_Details::on_cell_data_column_width));
@@ -1045,7 +1045,7 @@ void Dialog_Layout_Details::save_to_document()
if(m_modified)
{
//Set the table name and title:
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->set_table_title( m_table_name, m_entry_table_title->get_text(),
AppWindow::get_current_locale());
@@ -1091,7 +1091,7 @@ void Dialog_Layout_Details::on_cell_data_name(Gtk::CellRenderer* renderer, const
//TODO: If we ever use this a real layout tree, then let's add icons for each type.
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -1179,7 +1179,7 @@ void Dialog_Layout_Details::on_cell_data_name(Gtk::CellRenderer* renderer, const
void Dialog_Layout_Details::on_cell_data_title(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -1207,7 +1207,7 @@ void Dialog_Layout_Details::on_cell_data_title(Gtk::CellRenderer* renderer, cons
void Dialog_Layout_Details::on_cell_data_column_width(Gtk::CellRenderer* renderer, const
Gtk::TreeModel::iterator& iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -1239,7 +1239,7 @@ void Dialog_Layout_Details::on_cell_data_column_width(Gtk::CellRenderer* rendere
void Dialog_Layout_Details::on_cell_data_group_columns(Gtk::CellRenderer* renderer, const
Gtk::TreeModel::iterator& iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/layout/dialog_layout_export.cc b/glom/mode_design/layout/dialog_layout_export.cc
index 5d77665..45f3ee5 100644
--- a/glom/mode_design/layout/dialog_layout_export.cc
+++ b/glom/mode_design/layout/dialog_layout_export.cc
@@ -52,10 +52,10 @@ Dialog_Layout_Export::Dialog_Layout_Export(BaseObjectType* cobject, const Glib::
m_treeview_fields->set_model(m_model_fields);
// Append the View columns:
- Gtk::TreeView::Column* column_name = Gtk::manage( new Gtk::TreeView::Column(_("Fields")) );
+ auto column_name = Gtk::manage( new Gtk::TreeView::Column(_("Fields")) );
m_treeview_fields->append_column(*column_name);
- Gtk::CellRendererText* renderer_name = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_name = Gtk::manage(new Gtk::CellRendererText);
column_name->pack_start(*renderer_name);
column_name->set_cell_data_func(*renderer_name, sigc::mem_fun(*this,
&Dialog_Layout_Export::on_cell_data_name));
@@ -304,7 +304,7 @@ void Dialog_Layout_Export::on_button_delete()
void Dialog_Layout_Export::on_cell_data_name(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/layout/dialog_layout_list_related.cc
b/glom/mode_design/layout/dialog_layout_list_related.cc
index df49b5d..c15c0a8 100644
--- a/glom/mode_design/layout/dialog_layout_list_related.cc
+++ b/glom/mode_design/layout/dialog_layout_list_related.cc
@@ -195,7 +195,7 @@ void Dialog_Layout_List_Related::update_ui(bool including_relationship_list)
const auto related_table_name = m_portal->get_table_used(Glib::ustring() /* parent table - not relevant*/);
//Update the tree models from the document
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
//Fill the relationships combo:
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index 7a877e0..441b8f5 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -198,7 +198,7 @@ void Box_Formatting::set_is_for_non_editable()
m_show_editable_options = false;
//Add labels (because we will hide the checkboxes):
- Gtk::Label* label = Gtk::manage(new Gtk::Label(_("Font")));
+ auto label = Gtk::manage(new Gtk::Label(_("Font")));
label->show();
m_hbox_font->pack_start(*label, Gtk::PACK_SHRINK);
label = Gtk::manage(new Gtk::Label(_("Foreground Color")));
@@ -441,7 +441,7 @@ void Box_Formatting::on_combo_choices_relationship_changed()
{
std::shared_ptr<Relationship> relationship = m_combo_choices_relationship->get_selected_relationship();
- Document* pDocument = get_document();
+ auto pDocument = get_document();
if(pDocument)
{
//Show the list of fields from this relationship:
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 f9fccd9..9d07bc2 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
@@ -50,10 +50,10 @@ Dialog_FieldsList::Dialog_FieldsList(BaseObjectType* cobject, const Glib::RefPtr
m_treeview_fields->set_model(m_model_fields);
// Append the View columns:
- Gtk::TreeView::Column* column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
+ auto column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
m_treeview_fields->append_column(*column_name);
- Gtk::CellRendererText* renderer_name = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_name = Gtk::manage(new Gtk::CellRendererText);
column_name->pack_start(*renderer_name);
column_name->set_cell_data_func(*renderer_name, sigc::mem_fun(*this,
&Dialog_FieldsList::on_cell_data_name));
@@ -103,7 +103,7 @@ void Dialog_FieldsList::set_fields(const Glib::ustring& table_name, const Layout
m_modified = false;
m_table_name = table_name;
- Document* document = get_document();
+ auto document = get_document();
//Update the tree models from the document
if(document)
@@ -287,7 +287,7 @@ void Dialog_FieldsList::on_button_delete()
void Dialog_FieldsList::on_cell_data_name(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator& iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc
b/glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc
index b4d5790..a2e95e7 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc
@@ -89,7 +89,7 @@ void Dialog_Notebook::set_notebook(const std::shared_ptr<const LayoutItem_Notebo
m_layout_item = start_notebook; //So we can preserve information for later.
m_modified = false;
- //Document* document = get_document();
+ //auto document = get_document();
guint sequence = 1;
for(const auto& base_item : start_notebook->m_list_items)
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 fd55db8..861184d 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc
@@ -49,10 +49,10 @@ Dialog_SortFields::Dialog_SortFields(BaseObjectType* cobject, const Glib::RefPtr
m_treeview_fields->set_model(m_model_fields);
// Append the View columns:
- Gtk::TreeView::Column* column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
+ auto column_name = Gtk::manage( new Gtk::TreeView::Column(_("Name")) );
m_treeview_fields->append_column(*column_name);
- Gtk::CellRendererText* renderer_name = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_name = Gtk::manage(new Gtk::CellRendererText);
column_name->pack_start(*renderer_name);
column_name->set_cell_data_func(*renderer_name, sigc::mem_fun(*this,
&Dialog_SortFields::on_cell_data_name));
@@ -100,7 +100,7 @@ void Dialog_SortFields::set_fields(const Glib::ustring& table_name, const Layout
m_modified = false;
m_table_name = table_name;
- Document* document = get_document();
+ auto document = get_document();
//Update the tree models from the document
if(document)
@@ -261,7 +261,7 @@ void Dialog_SortFields::on_button_delete()
void Dialog_SortFields::on_cell_data_name(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator& iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/layout/treestore_layout.cc b/glom/mode_design/layout/treestore_layout.cc
index d2633fc..f2f53f9 100644
--- a/glom/mode_design/layout/treestore_layout.cc
+++ b/glom/mode_design/layout/treestore_layout.cc
@@ -72,7 +72,7 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
//Get an iterator for the row at this path:
//We must unconst this. This should not be necessary with a future version of gtkmm.
- TreeStore_Layout* unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of
get_iter to TreeModel:
+ auto unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of get_iter to
TreeModel:
const_iterator iter_dragged = unconstThis->get_iter(path_dragged_row);
//const_iterator iter_dragged = get_iter(path_dragged_row);
@@ -94,7 +94,7 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
//Get an iterator for the row at the requested parent's path:
//We must unconst this. This should not be necessary with a future version of gtkmm.
- TreeStore_Layout* unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of
get_iter to TreeModel:
+ auto unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of get_iter to
TreeModel:
const_iterator iter_dest_parent = unconstThis->get_iter(dest_parent);
//const_iterator iter_dest_parent = get_iter(dest);
if(iter_dest_parent)
diff --git a/glom/mode_design/print_layouts/box_print_layouts.cc
b/glom/mode_design/print_layouts/box_print_layouts.cc
index 03be099..c66e47a 100644
--- a/glom/mode_design/print_layouts/box_print_layouts.cc
+++ b/glom/mode_design/print_layouts/box_print_layouts.cc
@@ -99,7 +99,7 @@ bool Box_Print_Layouts::fill_from_database()
m_colTitle = m_AddDel.add_column(_("Title"), AddDelColumnInfo::enumStyles::Text, editable, true);
std::vector<Glib::ustring> listItems;
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
for(const auto& print_layout_name : document->get_print_layout_names(m_table_name))
@@ -161,7 +161,7 @@ void Box_Print_Layouts::on_adddel_user_requested_edit(const Gtk::TreeModel::iter
{
Glib::ustring name = m_AddDel.get_value_key(row);
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
save_to_document();
@@ -205,7 +205,7 @@ void Box_Print_Layouts::on_adddel_user_changed(const Gtk::TreeModel::iterator& r
if(get_userlevel() == AppState::userlevels::DEVELOPER)
{
const auto name = m_AddDel.get_value_key(row);
- Document* document = get_document();
+ auto document = get_document();
std::shared_ptr<PrintLayout> item = document->get_print_layout(m_table_name, name);
if(item)
diff --git a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
index 036517b..0910497 100644
--- a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
+++ b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
@@ -31,7 +31,7 @@ PrintLayoutToolbarButton::PrintLayoutToolbarButton(const std::string& icon_name,
const Glib::ustring& title, const Glib::ustring& tooltip)
: Gtk::ToolButton()
{
- Gtk::Image* image = Gtk::manage (new Gtk::Image());
+ auto image = Gtk::manage (new Gtk::Image());
const auto resource_path = UiUtils::get_icon_path(icon_name);
if(!Utils::get_resource_exists(resource_path))
@@ -64,8 +64,8 @@ PrintLayoutToolbarButton::enumItems PrintLayoutToolbarButton::get_item_type_from
PrintLayoutToolbarButton::enumItems result = enumItems::INVALID;
//Put this code in the toolbar class:
- Gtk::Widget* palette_candidate = drag_get_source_widget(drag_context);
- Gtk::ToolPalette* palette = dynamic_cast<Gtk::ToolPalette*>(palette_candidate);
+ auto palette_candidate = drag_get_source_widget(drag_context);
+ auto palette = dynamic_cast<Gtk::ToolPalette*>(palette_candidate);
while(palette_candidate && !palette) {
palette_candidate = palette_candidate->get_parent();
palette = dynamic_cast<Gtk::ToolPalette*>(palette_candidate);
@@ -74,7 +74,7 @@ PrintLayoutToolbarButton::enumItems PrintLayoutToolbarButton::get_item_type_from
if(!palette)
return result;
- Gtk::Widget* tool_item = palette->get_drag_item(selection_data);
+ auto tool_item = palette->get_drag_item(selection_data);
if(!tool_item)
return result;
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 5fee727..33546ec 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -279,7 +279,7 @@ void Window_PrintLayout_Edit::init_menu()
g_warning("GMenu not found");
//Menubar:
- Gtk::MenuBar* pMenuBar = new Gtk::MenuBar(gmenu);
+ auto pMenuBar = new Gtk::MenuBar(gmenu);
m_box_menu->pack_start(*pMenuBar, Gtk::PACK_SHRINK);
pMenuBar->show();
@@ -287,7 +287,7 @@ void Window_PrintLayout_Edit::init_menu()
// all actions from the action group are in the GMenu?
//TODO: Add a toolbar if it would be useful:
- //Gtk::Toolbar* pToolBar = static_cast<Gtk::Toolbar*>(builder->get_widget("/Bakery_ToolBar"));
+ //auto pToolBar = static_cast<Gtk::Toolbar*>(builder->get_widget("/Bakery_ToolBar"));
//m_HandleBox_Toolbar.add(*pToolBar);
//m_HandleBox_Toolbar.show();
@@ -557,7 +557,7 @@ Window_PrintLayout_Edit::~Window_PrintLayout_Edit()
void Window_PrintLayout_Edit::update_table_title()
{
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document was null" << std::endl;
@@ -842,7 +842,7 @@ void Window_PrintLayout_Edit::on_menu_insert_create_standard()
if(response != Gtk::RESPONSE_OK)
return;
- const Document* document = dynamic_cast<const Document*>(get_document());
+ const auto document = dynamic_cast<const Document*>(get_document());
if(!document)
{
std::cerr << G_STRFUNC << ": document was null" << std::endl;
@@ -932,8 +932,8 @@ void Window_PrintLayout_Edit::do_menu_view_show_rules(bool active)
m_canvas.set_rules_visibility(active);
- Gtk::Widget* hruler = Glib::wrap(GTK_WIDGET(m_hruler));
- Gtk::Widget* vruler = Glib::wrap(GTK_WIDGET(m_vruler));
+ auto hruler = Glib::wrap(GTK_WIDGET(m_hruler));
+ auto vruler = Glib::wrap(GTK_WIDGET(m_vruler));
if(active)
{
@@ -982,7 +982,7 @@ void Window_PrintLayout_Edit::on_menu_view_zoom(int parameter)
canvas_width_pixels = canvas_width_pixels / m_canvas.property_scale();
//Get the viewport size:
- Gtk::Widget* child = m_scrolled_window.get_child();
+ auto child = m_scrolled_window.get_child();
if(child)
{
Gtk::Allocation widget_allocation = child->get_allocation();
@@ -1020,7 +1020,7 @@ void Window_PrintLayout_Edit::on_menu_file_print_preview()
{
//Save any recent changes in the document,
//so that the preview will show them:
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(!document)
return;
@@ -1032,7 +1032,7 @@ void Window_PrintLayout_Edit::on_menu_file_print_preview()
document->set_print_layout(m_table_name, print_layout);
//Show the print preview window:
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->do_print_layout(m_print_layout->get_name(), true /* preview */, this);
}
diff --git a/glom/mode_design/relationships_overview/window_relationships_overview.cc
b/glom/mode_design/relationships_overview/window_relationships_overview.cc
index b6096d0..fdeb7a3 100644
--- a/glom/mode_design/relationships_overview/window_relationships_overview.cc
+++ b/glom/mode_design/relationships_overview/window_relationships_overview.cc
@@ -413,7 +413,7 @@ void Window_RelationshipsOverview::on_table_moved(const Glib::RefPtr<CanvasItemM
if(!table)
return;
- Document* document = dynamic_cast<Document*>(get_document());
+ auto document = dynamic_cast<Document*>(get_document());
if(document && table)
{
//Save the new position in the document:
@@ -471,7 +471,7 @@ void Window_RelationshipsOverview::setup_context_menu()
void Window_RelationshipsOverview::on_context_menu_edit_fields(const Glib::VariantBase& /* parameter */,
Glib::RefPtr<CanvasGroupDbTable> table)
{
- AppWindow* pApp = AppWindow::get_appwindow();
+ auto pApp = AppWindow::get_appwindow();
if(pApp && table)
{
pApp->do_menu_developer_fields(*this, table->get_table_name());
@@ -482,7 +482,7 @@ void Window_RelationshipsOverview::on_context_menu_edit_fields(const Glib::Varia
void Window_RelationshipsOverview::on_context_menu_edit_relationships(const Glib::VariantBase& /* parameter
*/, Glib::RefPtr<CanvasGroupDbTable> table)
{
- AppWindow* pApp = AppWindow::get_appwindow();
+ auto pApp = AppWindow::get_appwindow();
if(pApp && table)
{
pApp->do_menu_developer_relationships(*this, table->get_table_name());
diff --git a/glom/mode_design/report_layout/dialog_layout_report.cc
b/glom/mode_design/report_layout/dialog_layout_report.cc
index 4eff5ca..d6c2508 100644
--- a/glom/mode_design/report_layout/dialog_layout_report.cc
+++ b/glom/mode_design/report_layout/dialog_layout_report.cc
@@ -152,10 +152,10 @@ Dialog_Layout_Report::Dialog_Layout_Report(BaseObjectType* cobject, const Glib::
// Use set_cell_data_func() to give more control over the cell attributes depending on the row:
//Name column:
- Gtk::TreeView::Column* column_part = Gtk::manage( new Gtk::TreeView::Column(_("Part")) );
+ auto column_part = Gtk::manage( new Gtk::TreeView::Column(_("Part")) );
m_treeview_available_parts->append_column(*column_part);
- Gtk::CellRendererText* renderer_part = Gtk::manage(new Gtk::CellRendererText());
+ auto renderer_part = Gtk::manage(new Gtk::CellRendererText());
column_part->pack_start(*renderer_part);
column_part->set_cell_data_func(*renderer_part, sigc::mem_fun(*this,
&Dialog_Layout_Report::on_cell_data_available_part));
@@ -203,19 +203,19 @@ void Dialog_Layout_Report::setup_model(Gtk::TreeView& treeview, Glib::RefPtr<typ
// Use set_cell_data_func() to give more control over the cell attributes depending on the row:
//Name column:
- Gtk::TreeView::Column* column_part = Gtk::manage( new Gtk::TreeView::Column(_("Part")) );
+ auto column_part = Gtk::manage( new Gtk::TreeView::Column(_("Part")) );
treeview.append_column(*column_part);
- Gtk::CellRendererText* renderer_part = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_part = Gtk::manage(new Gtk::CellRendererText);
column_part->pack_start(*renderer_part);
column_part->set_cell_data_func(*renderer_part,
sigc::bind( sigc::mem_fun(*this, &Dialog_Layout_Report::on_cell_data_part), model));
//Details column:
- Gtk::TreeView::Column* column_details = Gtk::manage( new Gtk::TreeView::Column(_("Details")) );
+ auto column_details = Gtk::manage( new Gtk::TreeView::Column(_("Details")) );
treeview.append_column(*column_details);
- Gtk::CellRendererText* renderer_details = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_details = Gtk::manage(new Gtk::CellRendererText);
column_details->pack_start(*renderer_details);
column_details->set_cell_data_func(*renderer_details,
sigc::bind( sigc::mem_fun(*this, &Dialog_Layout_Report::on_cell_data_details), model));
@@ -409,7 +409,7 @@ void Dialog_Layout_Report::enable_buttons()
std::shared_ptr<LayoutItem> layout_item_parent;
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -490,7 +490,7 @@ Glib::RefPtr<Dialog_Layout_Report::type_model> Dialog_Layout_Report::get_selecte
{
Glib::RefPtr <type_model> model;
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(treeview)
model = Glib::RefPtr<type_model>::cast_dynamic(treeview->get_model());
@@ -499,7 +499,7 @@ Glib::RefPtr<Dialog_Layout_Report::type_model> Dialog_Layout_Report::get_selecte
Glib::RefPtr<const Dialog_Layout_Report::type_model> Dialog_Layout_Report::get_selected_model() const
{
- Dialog_Layout_Report* this_nonconst = const_cast<Dialog_Layout_Report*>(this);
+ auto this_nonconst = const_cast<Dialog_Layout_Report*>(this);
return this_nonconst->get_selected_model();
}
@@ -525,7 +525,7 @@ Gtk::TreeView* Dialog_Layout_Report::get_selected_treeview()
const Gtk::TreeView* Dialog_Layout_Report::get_selected_treeview() const
{
- Dialog_Layout_Report* this_nonconst = const_cast<Dialog_Layout_Report*>(this);
+ auto this_nonconst = const_cast<Dialog_Layout_Report*>(this);
return this_nonconst->get_selected_treeview();
}
@@ -533,7 +533,7 @@ const Gtk::TreeView* Dialog_Layout_Report::get_selected_treeview() const
void Dialog_Layout_Report::on_button_delete()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -554,7 +554,7 @@ void Dialog_Layout_Report::on_button_delete()
void Dialog_Layout_Report::on_button_up()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -591,7 +591,7 @@ void Dialog_Layout_Report::on_button_up()
void Dialog_Layout_Report::on_button_down()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -629,7 +629,7 @@ void Dialog_Layout_Report::on_button_down()
void Dialog_Layout_Report::on_button_add()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -721,7 +721,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Report::get_selected_group_parent() const
Gtk::TreeModel::iterator parent;
- Gtk::TreeView* treeview = const_cast<Gtk::TreeView*>(get_selected_treeview());
+ auto treeview = const_cast<Gtk::TreeView*>(get_selected_treeview());
if(!treeview)
return parent;
@@ -770,7 +770,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Report::get_selected_available() const
void Dialog_Layout_Report::on_button_formatting()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -802,7 +802,7 @@ void Dialog_Layout_Report::on_button_formatting()
void Dialog_Layout_Report::on_button_edit()
{
- Gtk::TreeView* treeview = get_selected_treeview();
+ auto treeview = get_selected_treeview();
if(!treeview)
return;
@@ -946,7 +946,7 @@ void Dialog_Layout_Report::on_cell_data_part(Gtk::CellRenderer* renderer, const
//TODO: If we ever use this as a real layout tree, then let's add icons for each type.
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -965,7 +965,7 @@ void Dialog_Layout_Report::on_cell_data_part(Gtk::CellRenderer* renderer, const
void Dialog_Layout_Report::on_cell_data_details(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter, const Glib::RefPtr<type_model>& model)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -986,7 +986,7 @@ void Dialog_Layout_Report::on_cell_data_available_part(Gtk::CellRenderer* render
//TODO: If we ever use this as a real layout tree, then let's add icons for each type.
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/report_layout/treestore_report_layout.cc
b/glom/mode_design/report_layout/treestore_report_layout.cc
index 2c3a5a7..12ad3aa 100644
--- a/glom/mode_design/report_layout/treestore_report_layout.cc
+++ b/glom/mode_design/report_layout/treestore_report_layout.cc
@@ -88,7 +88,7 @@ bool TreeStore_ReportLayout::row_drop_possible_vfunc(const Gtk::TreeModel::Path&
//Get an iterator for the row at the requested parent's path:
//We must unconst this. This should not be necessary with a future version of gtkmm.
- TreeStore_ReportLayout* unconstThis = const_cast<TreeStore_ReportLayout*>(this); //TODO: Add a const
version of get_iter to TreeModel:
+ auto unconstThis = const_cast<TreeStore_ReportLayout*>(this); //TODO: Add a const version of get_iter to
TreeModel:
const_iterator iter_dest_parent = unconstThis->get_iter(dest_parent);
//const_iterator iter_dest_parent = get_iter(dest);
if(iter_dest_parent)
diff --git a/glom/mode_design/script_library/dialog_script_library.cc
b/glom/mode_design/script_library/dialog_script_library.cc
index 5ae8de2..3c9a9bf 100644
--- a/glom/mode_design/script_library/dialog_script_library.cc
+++ b/glom/mode_design/script_library/dialog_script_library.cc
@@ -88,7 +88,7 @@ void Dialog_ScriptLibrary::on_button_add()
//Save any outstanding changes:
save_current_script();
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -122,7 +122,7 @@ void Dialog_ScriptLibrary::on_button_add()
void Dialog_ScriptLibrary::on_button_remove()
{
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -156,7 +156,7 @@ void Dialog_ScriptLibrary::on_combo_name_changed()
void Dialog_ScriptLibrary::load_current_script()
{
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -178,7 +178,7 @@ void Dialog_ScriptLibrary::load_current_script()
void Dialog_ScriptLibrary::save_current_script()
{
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
@@ -197,7 +197,7 @@ void Dialog_ScriptLibrary::save_current_script()
void Dialog_ScriptLibrary::load_from_document()
{
- const Document* document = get_document();
+ const auto document = get_document();
if(!document)
return;
@@ -228,7 +228,7 @@ void Dialog_ScriptLibrary::load_from_document()
void Dialog_ScriptLibrary::save_to_document()
{
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
diff --git a/glom/mode_design/translation/combobox_locale.cc b/glom/mode_design/translation/combobox_locale.cc
index 3e65549..edb1b92 100644
--- a/glom/mode_design/translation/combobox_locale.cc
+++ b/glom/mode_design/translation/combobox_locale.cc
@@ -49,7 +49,7 @@ ComboBox_Locale::ComboBox_Locale(BaseObjectType* cobject, const Glib::RefPtr<Gtk
//Show this too.
//Create the cell renderer manually, so we can specify the alignment:
- Gtk::CellRendererText* cell = Gtk::manage(new Gtk::CellRendererText());
+ auto cell = Gtk::manage(new Gtk::CellRendererText());
cell->property_xalign() = 0.0f;
pack_start(*cell);
add_attribute(cell->property_text(), m_model_columns.m_name);
diff --git a/glom/mode_design/translation/window_translations.cc
b/glom/mode_design/translation/window_translations.cc
index 7225423..18217f0 100644
--- a/glom/mode_design/translation/window_translations.cc
+++ b/glom/mode_design/translation/window_translations.cc
@@ -62,23 +62,23 @@ Window_Translations::Window_Translations(BaseObjectType* cobject, const Glib::Re
m_treeview->set_model(m_model);
// Append the View columns:
- Gtk::TreeView::Column* column_original = Gtk::manage( new Gtk::TreeView::Column(_("Original")) );
+ auto column_original = Gtk::manage( new Gtk::TreeView::Column(_("Original")) );
m_treeview->append_column(*column_original);
- Gtk::CellRendererText* renderer_name = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_name = Gtk::manage(new Gtk::CellRendererText);
column_original->pack_start(*renderer_name);
column_original->set_cell_data_func(*renderer_name, sigc::mem_fun(*this,
&Window_Translations::on_cell_data_original));
const auto col = m_treeview->append_column_editable(_("Translation"), m_columns.m_col_translation);
- Gtk::CellRendererText* renderer =
dynamic_cast<Gtk::CellRendererText*>(m_treeview->get_column_cell_renderer(col - 1));
+ auto renderer = dynamic_cast<Gtk::CellRendererText*>(m_treeview->get_column_cell_renderer(col - 1));
if(renderer)
renderer->signal_edited().connect(sigc::mem_fun(*this, &Window_Translations::on_treeview_edited));
//This is at the end, because it can contain a long description of the item's context.
- Gtk::TreeView::Column* column_item_typename = Gtk::manage( new Gtk::TreeView::Column(_("Item")) );
+ auto column_item_typename = Gtk::manage( new Gtk::TreeView::Column(_("Item")) );
m_treeview->append_column(*column_item_typename);
- Gtk::CellRendererText* renderer_item_typename = Gtk::manage(new Gtk::CellRendererText);
+ auto renderer_item_typename = Gtk::manage(new Gtk::CellRendererText);
column_item_typename->pack_start(*renderer_item_typename);
column_item_typename->set_cell_data_func(*renderer_item_typename, sigc::mem_fun(*this,
&Window_Translations::on_cell_data_item_itemhint));
}
@@ -180,7 +180,7 @@ void Window_Translations::on_button_identify()
void Window_Translations::on_cell_data_original(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
@@ -206,7 +206,7 @@ void Window_Translations::on_cell_data_original(Gtk::CellRenderer* renderer, con
void Window_Translations::on_cell_data_item_itemhint(Gtk::CellRenderer* renderer, const
Gtk::TreeModel::iterator& iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(!renderer_text)
return;
@@ -227,7 +227,7 @@ void Window_Translations::load_from_document()
{
m_model->clear(); //Remove all rows.
- Document* document = get_document();
+ auto document = get_document();
if(!document)
return;
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index 2021805..77af49c 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -62,8 +62,8 @@ Dialog_GroupsList::Dialog_GroupsList(BaseObjectType* cobject, const Glib::RefPtr
// Append the View columns:
//Groups:
- Gtk::CellRendererText* pCell = Gtk::manage(new Gtk::CellRendererText);
- Gtk::TreeView::Column* pViewColumn = Gtk::manage(new Gtk::TreeView::Column(_("Name"), *pCell) );
+ auto pCell = Gtk::manage(new Gtk::CellRendererText);
+ auto pViewColumn = Gtk::manage(new Gtk::TreeView::Column(_("Name"), *pCell) );
pViewColumn->set_cell_data_func(*pCell, sigc::mem_fun(*this, &Dialog_GroupsList::on_cell_data_group_name));
m_treeview_groups->append_column(*pViewColumn);
@@ -383,7 +383,7 @@ void Dialog_GroupsList::fill_table_list(const Glib::ustring& group_name)
//Fill the model rows:
m_model_tables->clear();
- Document* pDocument = get_document();
+ auto pDocument = get_document();
if(pDocument)
{
// Make sure that these are in the document,
@@ -428,12 +428,12 @@ void Dialog_GroupsList::load_from_document()
void Dialog_GroupsList::treeview_append_bool_column(Gtk::TreeView& treeview, const Glib::ustring& title,
Gtk::TreeModelColumn<bool>& model_column, const sigc::slot<void, const Glib::ustring&>& slot_toggled)
{
- Gtk::CellRendererToggle* pCellRenderer = Gtk::manage( new Gtk::CellRendererToggle() );
+ auto pCellRenderer = Gtk::manage( new Gtk::CellRendererToggle() );
//GTK+'s "activatable" really means "editable":
pCellRenderer->property_activatable() = true;
- Gtk::TreeView::Column* pViewColumn = Gtk::manage( new Gtk::TreeView::Column(title, *pCellRenderer) );
+ auto pViewColumn = Gtk::manage( new Gtk::TreeView::Column(title, *pCellRenderer) );
pViewColumn->set_renderer(*pCellRenderer, model_column); //render it via the default "text" property.
treeview.append_column(*pViewColumn);
@@ -599,7 +599,7 @@ void Dialog_GroupsList::on_treeview_tables_toggled_delete(const Glib::ustring& p
void Dialog_GroupsList::on_cell_data_group_name(Gtk::CellRenderer* renderer, const Gtk::TreeModel::iterator&
iter)
{
//Set the view's cell properties depending on the model's data:
- Gtk::CellRendererText* renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
+ auto renderer_text = dynamic_cast<Gtk::CellRendererText*>(renderer);
if(renderer_text)
{
if(iter)
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index f3e7ffd..ed9a981 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -341,7 +341,7 @@ void Dialog_UsersList::on_button_user_edit()
std::cerr << G_STRFUNC << ": ALTER USER failed." << std::endl;
//Change the password in the current connection, if this is the current user.
- ConnectionPool* connection_pool = ConnectionPool::get_instance();
+ auto connection_pool = ConnectionPool::get_instance();
if(connection_pool->get_user() == user)
connection_pool->set_password(password);
diff --git a/glom/mode_find/box_data_details_find.cc b/glom/mode_find/box_data_details_find.cc
index 7248bb7..1e83880 100644
--- a/glom/mode_find/box_data_details_find.cc
+++ b/glom/mode_find/box_data_details_find.cc
@@ -90,7 +90,7 @@ void Box_Data_Details_Find::fill_related()
/*
for(const auto& item : vecRelationships)
{
- Box_Data_List_Related* pBox = Gtk::manage(new Box_Data_List_Related());
+ auto pBox = Gtk::manage(new Box_Data_List_Related());
std::cout << "Box_Data_Details::fill_related() 2:" << relationship->get_name() << std::endl;
m_Notebook_Related.pages().push_back( Gtk::Notebook_Helpers::TabElem(*pBox, relationship->get_name()) );
std::cout << "Box_Data_Details::fill_related() 2.5:" << std::endl;
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 9e6070b..67e3beb 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -144,7 +144,7 @@ bool Box_Tables::fill_from_database()
//Get the list of hidden tables:
Document::type_listTableInfo listTablesDocument;
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
listTablesDocument = document->get_tables();
@@ -252,7 +252,7 @@ void Box_Tables::on_adddel_Add(const Gtk::TreeModel::iterator& row)
{
//Show the new information for this whole row:
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
std::shared_ptr<TableInfo> table_info = document->get_table(table_name);
@@ -284,7 +284,7 @@ void Box_Tables::on_adddel_Delete(const Gtk::TreeModel::iterator& rowStart, cons
if(!table_name.empty())
{
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
//Don't open a table that the document does not know about, because we need information from the
document:
@@ -411,7 +411,7 @@ void Box_Tables::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint co
set_modified();
//Tell the document that this table's name has changed:
- Document* document = get_document();
+ auto document = get_document();
if(document)
document->change_table_name(table_name, table_name_new);
@@ -428,7 +428,7 @@ void Box_Tables::on_adddel_Edit(const Gtk::TreeModel::iterator& row)
{
Glib::ustring table_name = m_AddDel.get_value_key(row);
- Document* document = get_document();
+ auto document = get_document();
if(document)
{
//Don't open a table that the document does not know about, because we need information from the
document:
@@ -460,7 +460,7 @@ void Box_Tables::save_to_document()
//Save the hidden tables. TODO_usermode: Only if we are in developer mode.
Document::type_listTableInfo listTables;
- Document* document = get_document();
+ auto document = get_document();
for(const auto& row : m_AddDel.get_model()->children())
{
diff --git a/glom/notebook_glom.cc b/glom/notebook_glom.cc
index 39f7577..ff5be39 100644
--- a/glom/notebook_glom.cc
+++ b/glom/notebook_glom.cc
@@ -59,7 +59,7 @@ Notebook_Glom::type_signal_leave_page Notebook_Glom::signal_leave_page()
void Notebook_Glom::on_switch_page_handler(Gtk::Widget* /* page */)
{
//Remove the help hint for the previous page:
- Gtk::Window* pApp = get_app_window();
+ auto pApp = get_app_window();
//if(pAppGlom)
//{
@@ -67,19 +67,19 @@ void Notebook_Glom::on_switch_page_handler(Gtk::Widget* /* page */)
// }
//Load the page as we enter it:
- Gtk::Widget* pChild = get_visible_child();
+ auto pChild = get_visible_child();
if(pChild)
{
- Box_WithButtons* pBox = dynamic_cast<Box_WithButtons*>(pChild);
+ auto pBox = dynamic_cast<Box_WithButtons*>(pChild);
if(pBox)
{
//pBox->load_from_document();
//Set the default button, if there is one:
- AppWindow* pAppGlom = dynamic_cast<AppWindow*>(pApp);
+ auto pAppGlom = dynamic_cast<AppWindow*>(pApp);
if(pAppGlom)
{
- Gtk::Widget* default_button = pBox->get_default_button();
+ auto default_button = pBox->get_default_button();
if(default_button)
{
default_button->grab_default();
@@ -103,7 +103,7 @@ void Notebook_Glom::on_leave_page(guint uiPageNumber)
{
for(const auto& pChild : get_page_children())
{
- Base_DB* pBox = dynamic_cast<Base_DB*>(pChild);
+ auto pBox = dynamic_cast<Base_DB*>(pChild);
if(pBox)
{
pBox->save_to_document();
@@ -126,7 +126,7 @@ void Notebook_Glom::show_hint()
Gtk::Widget* pChild = get_nth_page(iPageCurrent);
if(pChild)
{
- Box_WithButtons* pBox = dynamic_cast<Box_WithButtons*>(pChild);
+ auto pBox = dynamic_cast<Box_WithButtons*>(pChild);
if(pBox)
pBox->show_hint();
}
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 6da1a12..79bac89 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -379,7 +379,7 @@ std::shared_ptr<LayoutItem_Line> Canvas_PrintLayout::offer_line(const std::share
void Canvas_PrintLayout::on_context_menu_edit()
{
- Gtk::Window* parent = dynamic_cast<Gtk::Window*>(get_toplevel());
+ auto parent = dynamic_cast<Gtk::Window*>(get_toplevel());
m_context_item->update_layout_position_from_canvas();
@@ -463,7 +463,7 @@ void Canvas_PrintLayout::on_context_menu_formatting()
Utils::get_glade_widget_derived_with_warning(m_dialog_format);
add_view(m_dialog_format);
- Gtk::Window* window = dynamic_cast<Gtk::Window*>(get_toplevel());
+ auto window = dynamic_cast<Gtk::Window*>(get_toplevel());
if(window)
m_dialog_format->set_transient_for(*window);
@@ -784,7 +784,7 @@ void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& ca
std::shared_ptr<const Relationship> relationship = layoutitem_portal->get_relationship();
if(relationship)
{
- const Document* document = get_document();
+ const auto document = get_document();
const auto from_field = DbUtils::get_fields_for_table_one_field(document,
relationship->get_from_table(), relationship->get_from_field());
const Gnome::Gda::Value from_key_value = get_field_value_in_database(from_field, found_set, 0 /*
TODO: window */);
@@ -1066,7 +1066,7 @@ void Canvas_PrintLayout::set_grid_gap(double gap)
Base_DB::type_vecConstLayoutFields Canvas_PrintLayout::get_portal_fields_to_show(const
std::shared_ptr<LayoutItem_Portal>& portal)
{
- const Document* document = get_document();
+ const auto document = get_document();
if(!document)
std::cerr << G_STRFUNC << ": document is NULL." << std::endl;
diff --git a/glom/python_embed/python_ui_callbacks.cc b/glom/python_embed/python_ui_callbacks.cc
index 8af82ce..add8c01 100644
--- a/glom/python_embed/python_ui_callbacks.cc
+++ b/glom/python_embed/python_ui_callbacks.cc
@@ -40,35 +40,35 @@ AppPythonUICallbacks::AppPythonUICallbacks()
void AppPythonUICallbacks::on_show_table_details(const Glib::ustring& table_name, const Gnome::Gda::Value&
primary_key_value)
{
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->show_table_details(table_name, primary_key_value);
}
void AppPythonUICallbacks::on_show_table_list(const Glib::ustring& table_name)
{
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->show_table_list(table_name);
}
void AppPythonUICallbacks::on_print_report(const Glib::ustring& report_name)
{
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->print_report(report_name);
}
void AppPythonUICallbacks::on_print_layout()
{
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->print_layout();
}
void AppPythonUICallbacks::on_start_new_record()
{
- AppWindow* app = AppWindow::get_appwindow();
+ auto app = AppWindow::get_appwindow();
if(app)
app->start_new_record();
}
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index b1fb35a..1e79df0 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -439,7 +439,7 @@ bool AddDel::select_item(const Gtk::TreeModel::iterator& iter, guint column, boo
bool test = get_view_column_index(column, view_column_index);
if(test)
{
- Gtk::TreeView::Column* pColumn = m_TreeView.get_column(view_column_index);
+ auto pColumn = m_TreeView.get_column(view_column_index);
if(pColumn)
m_TreeView.set_cursor(path, *pColumn, start_editing);
else
@@ -529,7 +529,7 @@ void AddDel::set_column_title(guint col, const Glib::ustring& strText)
bool bPreventUserSignals = get_prevent_user_signals();
set_prevent_user_signals(true);
- Gtk::TreeViewColumn* pColumn = m_TreeView.get_column(col);
+ auto pColumn = m_TreeView.get_column(col);
if(pColumn)
pColumn->set_title(strText);
@@ -609,7 +609,7 @@ void AddDel::construct_specified_columns()
case(AddDelColumnInfo::enumStyles::Choices):
{
//Use a custom CellRenderer:
- CellRendererList* pCellRendererList = Gtk::manage( new CellRendererList() );
+ auto pCellRendererList = Gtk::manage( new CellRendererList() );
//Add the choices:
for(const auto& item : m_ColumnTypes[model_column_index].m_choices)
@@ -631,7 +631,7 @@ void AddDel::construct_specified_columns()
//Cast to the derived type, because append_column<> is templated, and needs the type at
compile-time
//to use the correct specialization:
- Gtk::TreeModelColumn<bool>* pModelColumnDerived = static_cast< Gtk::TreeModelColumn<bool>*
(pModelColumn);
+ auto pModelColumnDerived = static_cast< Gtk::TreeModelColumn<bool>* >(pModelColumn);
if(pModelColumnDerived)
treeview_append_column(Utils::string_escape_underscores(column_name), *pModelColumnDerived,
column_id);
@@ -643,7 +643,7 @@ void AddDel::construct_specified_columns()
//Cast to the derived type, because append_column<> is templated, and needs the type at
compile-time
//to use the correct specialization:
- Gtk::TreeModelColumn<Glib::ustring>* pModelColumnDerived = static_cast<
Gtk::TreeModelColumn<Glib::ustring>* >(pModelColumn);
+ auto pModelColumnDerived = static_cast< Gtk::TreeModelColumn<Glib::ustring>* >(pModelColumn);
if(pModelColumnDerived)
treeview_append_column(Utils::string_escape_underscores(column_name), *pModelColumnDerived,
column_id);
@@ -653,7 +653,7 @@ void AddDel::construct_specified_columns()
if(m_ColumnTypes[model_column_index].m_editable)
{
- Gtk::CellRendererText* pCellRendererText =
dynamic_cast<Gtk::CellRendererText*>(m_TreeView.get_column_cell_renderer(view_column_index));
+ auto pCellRendererText =
dynamic_cast<Gtk::CellRendererText*>(m_TreeView.get_column_cell_renderer(view_column_index));
if(pCellRendererText)
{
//Connect a signal handler:
@@ -669,7 +669,7 @@ void AddDel::construct_specified_columns()
}
else
{
- Gtk::CellRendererToggle* pCellRendererToggle =
dynamic_cast<Gtk::CellRendererToggle*>(m_TreeView.get_column_cell_renderer(view_column_index));
+ auto pCellRendererToggle =
dynamic_cast<Gtk::CellRendererToggle*>(m_TreeView.get_column_cell_renderer(view_column_index));
if(pCellRendererToggle)
{
pCellRendererToggle->property_activatable() = true;
@@ -682,7 +682,7 @@ void AddDel::construct_specified_columns()
}
//Connect other signals:
- Gtk::CellRenderer* pCellRenderer = m_TreeView.get_column_cell_renderer(view_column_index);
+ auto pCellRenderer = m_TreeView.get_column_cell_renderer(view_column_index);
if(pCellRenderer)
pCellRenderer->signal_editing_started().connect(
sigc::bind( sigc::mem_fun(*this, &AddDel::on_treeview_cell_editing_started), model_column_index) );
@@ -706,19 +706,19 @@ void AddDel::construct_specified_columns()
//This is necessary because TreeModelColumnBase's destructor is not virtual.
case(AddDelColumnInfo::enumStyles::Boolean):
{
- Gtk::TreeModelColumn<bool>* pModelColumnDerived = static_cast< Gtk::TreeModelColumn<bool>*
(pModelColumn);
+ auto pModelColumnDerived = static_cast< Gtk::TreeModelColumn<bool>* >(pModelColumn);
delete pModelColumnDerived;
break;
}
case(AddDelColumnInfo::enumStyles::Numerical):
{
- Gtk::TreeModelColumn<int>* pModelColumnDerived = static_cast< Gtk::TreeModelColumn<int>*
(pModelColumn);
+ auto pModelColumnDerived = static_cast< Gtk::TreeModelColumn<int>* >(pModelColumn);
delete pModelColumnDerived;
break;
}
default:
{
- Gtk::TreeModelColumn<Glib::ustring>* pModelColumnDerived = static_cast<
Gtk::TreeModelColumn<Glib::ustring>* >(pModelColumn);
+ auto pModelColumnDerived = static_cast< Gtk::TreeModelColumn<Glib::ustring>* >(pModelColumn);
delete pModelColumnDerived;
break;
}
@@ -920,7 +920,7 @@ void AddDel::set_column_choices(guint col, const type_vec_strings& vecStrings)
bool test = get_view_column_index(col, view_column_index);
if(test)
{
- CellRendererList* pCellRenderer = dynamic_cast<CellRendererList*>(
m_TreeView.get_column_cell_renderer(view_column_index) );
+ auto pCellRenderer = dynamic_cast<CellRendererList*>(
m_TreeView.get_column_cell_renderer(view_column_index) );
if(pCellRenderer)
{
//Add the choices:
@@ -1234,7 +1234,7 @@ void AddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const Gli
refTreeSelection->select(row); //TODO: This does not seem to work.
Gtk::TreeModel::Path path_to_activate = m_refListStore->get_path(row);
- Gtk::TreeView::Column* pColumn = m_TreeView.get_column(model_column_index); //TODO: This
might the the view column index, not the model column index.
+ auto pColumn = m_TreeView.get_column(model_column_index); //TODO: This might the the view
column index, not the model column index.
m_TreeView.set_cursor(path_to_activate, *pColumn, true /* start_editing */); //This
highlights the cell, but does not seem to actually start the editing.
}
}
@@ -1321,7 +1321,7 @@ bool AddDel::on_treeview_column_drop(Gtk::TreeView* /* treeview */, Gtk::TreeVie
guint AddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRenderer& cellrenderer, const
Gtk::TreeModelColumnBase& model_column, const Glib::ustring& column_id)
{
- TreeViewColumnGlom* pViewColumn = Gtk::manage( new TreeViewColumnGlom(title, cellrenderer) );
+ auto pViewColumn = Gtk::manage( new TreeViewColumnGlom(title, cellrenderer) );
pViewColumn->set_renderer(cellrenderer, model_column); //render it via the default "text" property.
guint cols_count = m_TreeView.append_column(*pViewColumn);
diff --git a/glom/utility_widgets/canvas/canvas_group_grid.cc
b/glom/utility_widgets/canvas/canvas_group_grid.cc
index 8080a96..f4c7a26 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
double top = 0.0;
double right = 0.0;
double bottom = 0.0;
- Goocanvas::Canvas* canvas = get_canvas();
+ auto canvas = get_canvas();
if(canvas)
canvas->get_bounds(left, top, right, bottom);
@@ -301,7 +301,7 @@ void CanvasGroupGrid::create_grid_lines()
double top = 0.0;
double right = 0.0;
double bottom = 0.0;
- Goocanvas::Canvas* canvas = get_canvas();
+ auto canvas = get_canvas();
if(canvas)
canvas->get_bounds(left, top, right, bottom);
@@ -344,7 +344,7 @@ void CanvasGroupGrid::show_temp_rule(double x, double y, bool show)
double top = 0.0;
double right = 0.0;
double bottom = 0.0;
- Goocanvas::Canvas* canvas = get_canvas();
+ auto canvas = get_canvas();
if(canvas)
canvas->get_bounds(left, top, right, bottom);
diff --git a/glom/utility_widgets/canvas/canvas_image_movable.cc
b/glom/utility_widgets/canvas/canvas_image_movable.cc
index 3a013b6..10dbfaf 100644
--- a/glom/utility_widgets/canvas/canvas_image_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_image_movable.cc
@@ -172,7 +172,7 @@ void CanvasImageMovable::scale_to_size()
double width = 0;
double height = 0;
get_width_height(width, height);
- Goocanvas::Canvas* canvas = get_canvas();
+ auto canvas = get_canvas();
if(!canvas)
{
std::cerr << G_STRFUNC << ": canvas is null" << std::endl;
diff --git a/glom/utility_widgets/canvas/canvas_item_movable.cc
b/glom/utility_widgets/canvas/canvas_item_movable.cc
index 5c36e2f..50dac4c 100644
--- a/glom/utility_widgets/canvas/canvas_item_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_item_movable.cc
@@ -95,7 +95,7 @@ bool CanvasItemMovable::on_button_press_event(const Glib::RefPtr<Goocanvas::Item
m_drag_latest_position_x = m_drag_start_position_x;
m_drag_latest_position_y = m_drag_start_position_y;
- Goocanvas::Canvas* canvas = get_parent_canvas_widget();
+ auto canvas = get_parent_canvas_widget();
if(canvas)
{
canvas->pointer_grab(item,
@@ -209,7 +209,7 @@ bool CanvasItemMovable::on_button_release_event(const Glib::RefPtr<Goocanvas::It
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.
- Goocanvas::Canvas* canvas = get_parent_canvas_widget();
+ auto canvas = get_parent_canvas_widget();
if(canvas)
canvas->pointer_ungrab(target, event->time);
@@ -285,7 +285,7 @@ void CanvasItemMovable::set_drag_cursor(Gdk::CursorType cursor_type)
void CanvasItemMovable::set_cursor(const Glib::RefPtr<Gdk::Cursor>& cursor)
{
- Goocanvas::Canvas* canvas = get_parent_canvas_widget();
+ auto canvas = get_parent_canvas_widget();
if(!canvas)
return;
@@ -296,7 +296,7 @@ void CanvasItemMovable::set_cursor(const Glib::RefPtr<Gdk::Cursor>& cursor)
void CanvasItemMovable::unset_cursor()
{
- Goocanvas::Canvas* canvas = get_parent_canvas_widget();
+ auto canvas = get_parent_canvas_widget();
if(canvas)
{
Glib::RefPtr<Gdk::Window> window = canvas->get_window();
diff --git a/glom/utility_widgets/dialog_properties.cc b/glom/utility_widgets/dialog_properties.cc
index 4887cec..d72fcb9 100644
--- a/glom/utility_widgets/dialog_properties.cc
+++ b/glom/utility_widgets/dialog_properties.cc
@@ -80,35 +80,35 @@ void Dialog_Properties::widget_connect_changed_signal(Gtk::Widget* widget)
return;
}
- Gtk::ComboBox* pCombo = dynamic_cast<Gtk::ComboBox*>(widget);
+ auto pCombo = dynamic_cast<Gtk::ComboBox*>(widget);
if(pCombo) //If it is actually a Combo:
{
pCombo->signal_changed().connect(sigc::mem_fun(*this, &Dialog_Properties::on_anything_changed));
}
else
{
- Gtk::Entry* pEntry = dynamic_cast<Gtk::Entry*>(widget);
+ auto pEntry = dynamic_cast<Gtk::Entry*>(widget);
if(pEntry) //If it is actually an Entry:
{
pEntry->signal_changed().connect(sigc::mem_fun(*this, &Dialog_Properties::on_anything_changed));
}
else
{
- Gtk::ToggleButton* pToggleButton = dynamic_cast<Gtk::ToggleButton*>(widget);
+ auto pToggleButton = dynamic_cast<Gtk::ToggleButton*>(widget);
if(pToggleButton)
{
pToggleButton->signal_toggled().connect( sigc::mem_fun(*this,
&Dialog_Properties::on_anything_changed) );
}
else
{
- Gtk::TextView* pTextView = dynamic_cast<Gtk::TextView*>(widget);
+ auto pTextView = dynamic_cast<Gtk::TextView*>(widget);
if(pTextView)
{
pTextView->get_buffer()->signal_changed().connect( sigc::mem_fun(*this,
&Dialog_Properties::on_anything_changed) );
}
else
{
- AddDel* pAddDel = dynamic_cast<AddDel*>(widget);
+ auto pAddDel = dynamic_cast<AddDel*>(widget);
if(pAddDel)
{
pAddDel->signal_user_changed().connect( sigc::mem_fun(*this,
&Dialog_Properties::on_adddel_user_changed) );
@@ -152,7 +152,7 @@ void Dialog_Properties::on_foreach_connect(Gtk::Widget& widget)
widget_connect_changed_signal(&widget); //Connect the appropriate signal
//Recurse through children:
- Gtk::Container* pContainer = dynamic_cast<Gtk::Container*>(&widget);
+ auto pContainer = dynamic_cast<Gtk::Container*>(&widget);
if(pContainer)
{
pContainer->foreach( sigc::mem_fun(*this, &Dialog_Properties::on_foreach_connect)); //recursive
diff --git a/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
b/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
index 8b4f955..3a3955d 100644
--- a/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
+++ b/glom/utility_widgets/eggspreadtablemm/test_spreadtablednd.cc
@@ -69,9 +69,9 @@ populate_spread_table_wrappy(Egg::SpreadTableDnd* spread_table)
for(gsize i = 0; i < G_N_ELEMENTS (strings); ++i)
{
- Gtk::Label* label = Gtk::manage(new Gtk::Label(strings[i]));
+ auto label = Gtk::manage(new Gtk::Label(strings[i]));
Gtk::Frame* frame = Gtk::manage(new Gtk::Frame());
- Gtk::EventBox* eventbox = Gtk::manage(new Gtk::EventBox());
+ auto eventbox = Gtk::manage(new Gtk::EventBox());
label->show();
frame->show();
eventbox->show();
@@ -149,10 +149,10 @@ on_togglebutton_toggled(Gtk::ToggleButton* togglebutton, bool& value)
static Gtk::Window *
create_window()
{
- Gtk::Window* window = new Gtk::Window();
- Gtk::Box* hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 2));
+ auto window = new Gtk::Window();
+ auto hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 2));
hbox->show();
- Gtk::Box* vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 6));
+ auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 6));
vbox->show();
window->set_border_width (8);
@@ -160,11 +160,11 @@ create_window()
window->add (*hbox);
hbox->pack_start(*vbox, false, false, 0);
- Gtk::Frame* frame = Gtk::manage(new Gtk::Frame("SpreadTable"));
+ auto frame = Gtk::manage(new Gtk::Frame("SpreadTable"));
frame->show();
hbox->pack_start(*frame, true, true, 0);
- Gtk::ScrolledWindow* swindow = Gtk::manage(new Gtk::ScrolledWindow());
+ auto swindow = Gtk::manage(new Gtk::ScrolledWindow());
swindow->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
swindow->show();
@@ -182,9 +182,9 @@ create_window()
swindow->add(*paper);
/* Add SpreadTable test control frame */
- Gtk::Expander* expander = Gtk::manage(new Gtk::Expander("SpreadTable controls"));
+ auto expander = Gtk::manage(new Gtk::Expander("SpreadTable controls"));
expander->set_expanded();
- Gtk::Box* paper_cntl = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 2));
+ auto paper_cntl = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 2));
paper_cntl->show();;
expander->show();
expander->add(*paper_cntl);
@@ -207,11 +207,11 @@ create_window()
hbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, 2));
hbox->show();
- Gtk::Widget* label = Gtk::manage(new Gtk::Label("H Spacing"));
+ auto label = Gtk::manage(new Gtk::Label("H Spacing"));
label->show();
hbox->pack_start(*label, true, true, 0);
- Gtk::SpinButton* spinbutton = Glib::wrap(GTK_SPIN_BUTTON(gtk_spin_button_new_with_range (0, 30, 1)));
+ auto spinbutton = Glib::wrap(GTK_SPIN_BUTTON(gtk_spin_button_new_with_range (0, 30, 1)));
spinbutton->set_value(INITIAL_HSPACING);
spinbutton->show();
@@ -255,7 +255,7 @@ create_window()
paper_cntl->pack_start(*hbox, false, false, 0);
/* Add widget-drop-possible controls */
- Gtk::ToggleButton* togglebutton = Gtk::manage(new Gtk::ToggleButton("parent accept drop"));
+ auto togglebutton = Gtk::manage(new Gtk::ToggleButton("parent accept drop"));
togglebutton->show();
togglebutton->set_active();
paper_cntl->pack_start(*togglebutton, false, false, 0);
@@ -299,7 +299,7 @@ create_window()
/* Add test items control frame */
expander = Gtk::manage(new Gtk::Expander("Test item controls"));
expander->set_expanded();
- Gtk::Box* items_cntl = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 2));
+ auto items_cntl = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 2));
items_cntl->show();
expander->show();
expander->add(*items_cntl);
@@ -323,7 +323,7 @@ create_window()
populate_spread_table_wrappy(paper);
/* Embed another dnd spread table */
- Egg::SpreadTableDnd* spreadtable_inner =
+ auto spreadtable_inner =
Gtk::manage(new Egg::SpreadTableDnd(
Gtk::ORIENTATION_VERTICAL,
INITIAL_LINES));
@@ -357,6 +357,6 @@ main(int argc, char *argv[])
Glib::RefPtr<Gtk::Application> app =
Gtk::Application::create(argc, argv, "org.glom.test_spreadtablednd");
- Gtk::Window* window = create_window();
+ auto window = create_window();
return app->run(*window);
}
diff --git a/glom/utility_widgets/filechooserdialog_saveextras.cc
b/glom/utility_widgets/filechooserdialog_saveextras.cc
index 9143a16..0d3cc20 100644
--- a/glom/utility_widgets/filechooserdialog_saveextras.cc
+++ b/glom/utility_widgets/filechooserdialog_saveextras.cc
@@ -78,15 +78,15 @@ void FileChooserDialog_SaveExtras::create_child_widgets()
m_label_extra_message.set_halign(Gtk::ALIGN_START);
m_label_extra_message.set_valign(Gtk::ALIGN_CENTER);
- Gtk::Frame* frame = Gtk::manage(new Gtk::Frame());
- Gtk::Label* frame_label = Gtk::manage(new Gtk::Label());
+ auto frame = Gtk::manage(new Gtk::Frame());
+ auto frame_label = Gtk::manage(new Gtk::Label());
frame_label->set_markup(UiUtils::bold_message(_("New Database")));
frame_label->show();
frame->set_label_widget(*frame_label);
frame->set_shadow_type(Gtk::SHADOW_NONE);
frame->show();
- Gtk::Box* vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,
Utils::to_utype(UiUtils::DefaultSpacings::SMALL)));
+ auto vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,
Utils::to_utype(UiUtils::DefaultSpacings::SMALL)));
vbox->set_margin_start(Utils::to_utype(UiUtils::DefaultSpacings::LARGE));
vbox->set_margin_top(Utils::to_utype(UiUtils::DefaultSpacings::SMALL));
frame->add(*vbox);
@@ -94,14 +94,14 @@ void FileChooserDialog_SaveExtras::create_child_widgets()
vbox->pack_start(m_label_extra_message); /* For instance, an extra hint when saving from an example,
saying that a new file must be saved. */
- Gtk::Label* label_newdb = Gtk::manage(new Gtk::Label(_("Please choose a human-readable title for the new
database. You can change this later in the database properties. It may contain any characters.")));
+ auto label_newdb = Gtk::manage(new Gtk::Label(_("Please choose a human-readable title for the new
database. You can change this later in the database properties. It may contain any characters.")));
vbox->pack_start(*label_newdb);
label_newdb->set_halign(Gtk::ALIGN_START);
label_newdb->set_valign(Gtk::ALIGN_CENTER);
label_newdb->show();
- Gtk::Box* box_label = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,
Utils::to_utype(UiUtils::DefaultSpacings::LARGE)));
- Gtk::Label* label_title = Gtk::manage(new Gtk::Label(_("_Title:"), true));
+ auto box_label = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,
Utils::to_utype(UiUtils::DefaultSpacings::LARGE)));
+ auto label_title = Gtk::manage(new Gtk::Label(_("_Title:"), true));
box_label->pack_start(*label_title, Gtk::PACK_SHRINK);
label_title->show();
box_label->pack_start(m_entry_title);
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 052efb1..e6ce0f2 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -41,7 +41,7 @@ FlowTable::~FlowTable()
while(!m_list_hboxes.empty())
{
auto iter = m_list_hboxes.begin();
- Gtk::Box* hbox = *iter;
+ auto hbox = *iter;
delete_and_forget_hbox(hbox);
}
}
@@ -83,7 +83,7 @@ void FlowTable::delete_and_forget_hbox(Gtk::Box* hbox)
type_children children = hbox->get_children();
while(!children.empty())
{
- Gtk::Widget* widget = children[0];
+ auto widget = children[0];
hbox->remove(*widget);
children = hbox->get_children();
}
@@ -139,7 +139,7 @@ void FlowTable::insert(Gtk::Widget* first, Gtk::Widget* second, int index, bool
{
if(first && second)
{
- Gtk::Box* hbox = new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, get_horizontal_spacing());
+ auto hbox = new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL, get_horizontal_spacing());
m_list_hboxes.push_back(hbox); //So we can delete it whenever necessary.
hbox->pack_start(*first, Gtk::PACK_SHRINK);
@@ -169,7 +169,7 @@ void FlowTable::remove_all()
{
for(const auto& item : m_list_first_widgets)
{
- Gtk::Widget* first_widget = const_cast<Gtk::Widget*>(item);
+ auto first_widget = const_cast<Gtk::Widget*>(item);
if(first_widget)
remove(*first_widget);
@@ -191,7 +191,7 @@ void FlowTable::remove(Gtk::Widget& first)
//std::cout << G_STRFUNC << ": debug: remove() first=" << &first << std::endl;
//Handle widgets that were added to an Box:
- Gtk::Box* parent = const_cast<Gtk::Box*>(get_parent_hbox(&first));
+ auto parent = const_cast<Gtk::Box*>(get_parent_hbox(&first));
if(parent)
{
//std::cout << " debug: hbox=" << parent << std::endl;
@@ -283,7 +283,7 @@ bool FlowTable::on_draw(const Cairo::RefPtr<Cairo::Context>& cr)
int real_x = 0;
int real_y = 0;
- Gtk::Widget* unconst = const_cast<Gtk::Widget*>(widget);
+ auto unconst = const_cast<Gtk::Widget*>(widget);
unconst->translate_coordinates(*this, x, y, real_x, real_y);
//std::cout << G_STRFUNC << ": real_x: " << real_x << ", real_y: " << real_y << std::endl;
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 80b784d..347139f 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -71,7 +71,7 @@ void ImageGlom::init()
//Connect the the EvView's button-press-event signal,
//because we don't get it otherwise.
//For some reason this is not necessary with the GtkImage.
- Gtk::Widget* cppEvView = Glib::wrap(GTK_WIDGET(m_ev_view));
+ auto cppEvView = Glib::wrap(GTK_WIDGET(m_ev_view));
cppEvView->signal_button_press_event().connect(
sigc::mem_fun(*this, &ImageGlom::on_button_press_event), false);
@@ -114,7 +114,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event)
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -166,7 +166,7 @@ bool ImageGlom::on_button_press_event(GdkEventButton *button_event)
AppWindow* ImageGlom::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -214,7 +214,7 @@ static void image_glom_ev_job_finished(EvJob* job, void* user_data)
{
g_assert(job);
- ImageGlom* self = (ImageGlom*)user_data;
+ auto self = static_cast<ImageGlom*>(user_data);
g_assert(self);
self->on_ev_job_finished(job);
@@ -280,7 +280,7 @@ void ImageGlom::fill_evince_supported_mime_types()
//Discover what mime types libevview can support.
//Older versions supported image types too, via GdkPixbuf,
//but that support was then removed.
- GList* types_list = ev_backends_manager_get_all_types_info();
+ auto types_list = ev_backends_manager_get_all_types_info();
if(!types_list)
{
return;
@@ -500,7 +500,7 @@ void ImageGlom::on_menupopup_activate_open_file()
void ImageGlom::on_menupopup_activate_open_file_with()
{
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
//Offer the user a choice of suitable applications:
const auto mime_type = get_mime_type();
@@ -671,7 +671,7 @@ static void set_file_filter_images(Gtk::FileChooser& file_chooser)
void ImageGlom::on_menupopup_activate_save_file()
{
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
Gtk::FileChooserDialog dialog(_("Save Image"), Gtk::FILE_CHOOSER_ACTION_SAVE);
if(pApp)
@@ -737,7 +737,7 @@ bool ImageGlom::save_file(const Glib::ustring& uri)
// Automatically delete the dialog when we no longer need it:
std::shared_ptr<Gtk::Dialog> dialog_keeper(dialog_save);
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
dialog_save->set_transient_for(*pApp);
@@ -758,7 +758,7 @@ void ImageGlom::on_menupopup_activate_select_file()
if(m_read_only)
return;
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
Gtk::FileChooserDialog dialog(_("Choose Image"), Gtk::FILE_CHOOSER_ACTION_OPEN);
if(pApp)
diff --git a/glom/utility_widgets/layouttoolbarbutton.cc b/glom/utility_widgets/layouttoolbarbutton.cc
index 3623229..0fde766 100644
--- a/glom/utility_widgets/layouttoolbarbutton.cc
+++ b/glom/utility_widgets/layouttoolbarbutton.cc
@@ -30,7 +30,7 @@ LayoutToolbarButton::LayoutToolbarButton(const std::string& icon_name, LayoutWid
const Glib::ustring& title, const Glib::ustring& tooltip)
: Gtk::ToolButton()
{
- Gtk::Image* image = Gtk::manage (new Gtk::Image());
+ auto image = Gtk::manage (new Gtk::Image());
const auto resource_path = UiUtils::get_icon_path(icon_name);
if(!Utils::get_resource_exists(resource_path))
diff --git a/glom/utility_widgets/layoutwidgetbase.cc b/glom/utility_widgets/layoutwidgetbase.cc
index d6aa9fc..db2a0cf 100644
--- a/glom/utility_widgets/layoutwidgetbase.cc
+++ b/glom/utility_widgets/layoutwidgetbase.cc
@@ -90,15 +90,15 @@ void LayoutWidgetBase::set_read_only(bool /* read_only */)
void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const std::shared_ptr<const
LayoutItem_WithFormatting>& layout_item)
{
- Gtk::Widget* widget_to_change = &widget;
+ auto widget_to_change = &widget;
- Gtk::Button* button = dynamic_cast<Gtk::Button*>(&widget);
- DataWidgetChildren::Label* labelglom = dynamic_cast<DataWidgetChildren::Label*>(&widget);
+ auto button = dynamic_cast<Gtk::Button*>(&widget);
+ auto labelglom = dynamic_cast<DataWidgetChildren::Label*>(&widget);
if(button)
widget_to_change = button->get_child();
else
{
- DataWidgetChildren::TextView* textview = dynamic_cast<DataWidgetChildren::TextView*>(&widget);
+ auto textview = dynamic_cast<DataWidgetChildren::TextView*>(&widget);
if(textview)
widget_to_change = textview->get_textview();
else if(labelglom)
@@ -125,7 +125,7 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const std::shared_p
const Gtk::Align x_align =
(alignment == Formatting::HorizontalAlignment::LEFT ? Gtk::ALIGN_START : Gtk::ALIGN_END);
- Gtk::Label* label = dynamic_cast<Gtk::Label*>(widget_to_change);
+ auto label = dynamic_cast<Gtk::Label*>(widget_to_change);
if(label)
{
//Note that set_justify() does nothing for single lines of text,
@@ -135,7 +135,7 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const std::shared_p
label->set_justify(justification);
label->set_xalign(x_align);
} else {
- Gtk::TextView* textview = dynamic_cast<Gtk::TextView*>(widget_to_change);
+ auto textview = dynamic_cast<Gtk::TextView*>(widget_to_change);
if(textview)
{
//Note that, unlike Gtk::Label::set_justify(), this does have an effect
@@ -143,7 +143,7 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const std::shared_p
//See http://www.murrayc.com/permalink/2015/03/02/gtk-aligning-justification-in-text-widgets/
textview->set_justification(justification);
} else {
- Gtk::Entry* entry = dynamic_cast<Gtk::Entry*>(widget_to_change);
+ auto entry = dynamic_cast<Gtk::Entry*>(widget_to_change);
if(entry)
{
//See http://www.murrayc.com/permalink/2015/03/02/gtk-aligning-justification-in-text-widgets/
diff --git a/glom/utility_widgets/layoutwidgetmenu.cc b/glom/utility_widgets/layoutwidgetmenu.cc
index d2fc64c..8c27779 100644
--- a/glom/utility_widgets/layoutwidgetmenu.cc
+++ b/glom/utility_widgets/layoutwidgetmenu.cc
@@ -100,7 +100,7 @@ void LayoutWidgetMenu::setup_menu(Gtk::Widget* widget)
sigc::mem_fun(*this, &LayoutWidgetMenu::on_menupopup_activate_delete) );
//TODO: This does not work until this widget is in a container in the window:s
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp)
{
pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
@@ -159,7 +159,7 @@ void LayoutWidgetMenu::on_menupopup_activate_layout_properties()
void LayoutWidgetMenu::on_menupopup_activate_delete()
{
- Gtk::Widget* parent = dynamic_cast<Gtk::Widget*>(this);
+ auto parent = dynamic_cast<Gtk::Widget*>(this);
if(!parent)
{
// Should never happen:
diff --git a/glom/utility_widgets/layoutwidgetutils.cc b/glom/utility_widgets/layoutwidgetutils.cc
index a26a33d..74d4d86 100644
--- a/glom/utility_widgets/layoutwidgetutils.cc
+++ b/glom/utility_widgets/layoutwidgetutils.cc
@@ -65,7 +65,7 @@ void LayoutWidgetUtils::setup_util_menu(Gtk::Widget* widget)
void LayoutWidgetUtils::on_menu_delete_activate()
{
- Gtk::Widget* parent = dynamic_cast<Gtk::Widget*>(this);
+ auto parent = dynamic_cast<Gtk::Widget*>(this);
if(!parent)
{
// Should never happen!
diff --git a/glom/utility_widgets/notebook_noframe.cc b/glom/utility_widgets/notebook_noframe.cc
index f820641..219d12e 100644
--- a/glom/utility_widgets/notebook_noframe.cc
+++ b/glom/utility_widgets/notebook_noframe.cc
@@ -106,7 +106,7 @@ std::vector<Gtk::Widget*> NotebookNoFrame::get_page_children()
void NotebookNoFrame::on_visible_child_changed()
{
- Gtk::Widget* widget = get_visible_child();
+ auto widget = get_visible_child();
m_signal_switch_page.emit(widget);
}
diff --git a/glom/utility_widgets/notebookglom.cc b/glom/utility_widgets/notebookglom.cc
index e19fc1e..e226028 100644
--- a/glom/utility_widgets/notebookglom.cc
+++ b/glom/utility_widgets/notebookglom.cc
@@ -55,7 +55,7 @@ void NotebookGlom::init()
AppWindow* NotebookGlom::get_appwindow() const
{
- Gtk::Container* pWindow = const_cast<Gtk::Container*>(get_toplevel());
+ auto pWindow = const_cast<Gtk::Container*>(get_toplevel());
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
diff --git a/glom/utility_widgets/notebooklabelglom.cc b/glom/utility_widgets/notebooklabelglom.cc
index 64bcc09..bc009ad 100644
--- a/glom/utility_widgets/notebooklabelglom.cc
+++ b/glom/utility_widgets/notebooklabelglom.cc
@@ -65,7 +65,7 @@ void NotebookLabel::set_label (const Glib::ustring& title)
AppWindow* NotebookLabel::get_appwindow()
{
- Gtk::Container* pWindow = get_toplevel();
+ auto pWindow = get_toplevel();
//TODO: This only works when the child widget is already in its parent.
return dynamic_cast<AppWindow*>(pWindow);
@@ -130,7 +130,7 @@ void NotebookLabel::setup_menu(Gtk::Widget* /* widget */)
bool NotebookLabel::on_button_press_event(GdkEventButton *button_event)
{
- AppWindow* pApp = get_appwindow();
+ auto pApp = get_appwindow();
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
diff --git a/glom/utility_widgets/test_flowtable.cc b/glom/utility_widgets/test_flowtable.cc
index d6e8e89..db38df2 100644
--- a/glom/utility_widgets/test_flowtable.cc
+++ b/glom/utility_widgets/test_flowtable.cc
@@ -46,34 +46,34 @@ type_vec_widgets vec_child_widgets;
static void fill_flowtable(Glom::FlowTable& flowtable)
{
- Gtk::Entry* button1 = Gtk::manage(new Gtk::Entry());
+ auto button1 = Gtk::manage(new Gtk::Entry());
button1->set_text("one");
button1->show();
//button1->set_size_request(100, 100);
vec_child_widgets.push_back(button1);
- Gtk::Entry* button2 = Gtk::manage(new Gtk::Entry());
+ auto button2 = Gtk::manage(new Gtk::Entry());
button2->set_text("two");
flowtable.add_widgets(*button1, *button2);
button2->show();
//button2->set_size_request(100, 100);
vec_child_widgets.push_back(button2);
- Gtk::Label* button3 = Gtk::manage(new Gtk::Label());
+ auto button3 = Gtk::manage(new Gtk::Label());
button3->set_text("three"); //TODO: valgrind says that something here is leaked.
button3->show();
//button1->set_size_request(100, 100);
vec_child_widgets.push_back(button3);
- Gtk::Entry* button4 = Gtk::manage(new Gtk::Entry());
+ auto button4 = Gtk::manage(new Gtk::Entry());
button4->set_text("four");
flowtable.add_widgets(*button3, *button4);
button4->show();
vec_child_widgets.push_back(button4);
- Gtk::Entry* button5 = Gtk::manage(new Gtk::Entry());
+ auto button5 = Gtk::manage(new Gtk::Entry());
button5->set_text("five");
- Gtk::Entry* button6 = Gtk::manage(new Gtk::Entry());
+ auto button6 = Gtk::manage(new Gtk::Entry());
button6->set_text("size");
flowtable.add_widgets(*button5, *button6);
button5->show();
diff --git a/glom/variablesmap.cc b/glom/variablesmap.cc
index e53e253..c957bf1 100644
--- a/glom/variablesmap.cc
+++ b/glom/variablesmap.cc
@@ -52,8 +52,8 @@ void VariablesMap::connect_widget(const Glib::ustring& widget_name, Glib::ustrin
Gtk::Widget* pWidget = nullptr;
m_builder->get_widget(widget_name, pWidget);
- Gtk::Entry* pEntry = dynamic_cast<Gtk::Entry*>(pWidget); //it mange both Gtk::entry and Gtk::SpinButton
- Gtk::ComboBox* pComboBox = dynamic_cast<Gtk::ComboBox*>(pWidget);
+ auto pEntry = dynamic_cast<Gtk::Entry*>(pWidget); //it mange both Gtk::entry and Gtk::SpinButton
+ auto pComboBox = dynamic_cast<Gtk::ComboBox*>(pWidget);
if(pEntry)
{
m_mapWidgetsToVariables[pEntry] = (void*)(&variable);
@@ -70,7 +70,7 @@ void VariablesMap::connect_widget(const Glib::ustring& widget_name, double& vari
Gtk::Widget* pWidget = nullptr;
m_builder->get_widget(widget_name, pWidget);
- Gtk::Scale* pScale = dynamic_cast<Gtk::Scale*>(pWidget);
+ auto pScale = dynamic_cast<Gtk::Scale*>(pWidget);
if(pScale)
{
m_mapWidgetsToVariables[pScale] = (void*)(&variable);
@@ -82,7 +82,7 @@ void VariablesMap::connect_widget(const Glib::ustring& widget_name, Glib::Date&
Gtk::Widget* pWidget = nullptr;
m_builder->get_widget(widget_name, pWidget);
- Gtk::Calendar* pCalendar = dynamic_cast<Gtk::Calendar*>(pWidget);
+ auto pCalendar = dynamic_cast<Gtk::Calendar*>(pWidget);
if(pCalendar)
{
m_mapWidgetsToVariables[pCalendar] = (void*)(&variable);
@@ -116,20 +116,20 @@ void VariablesMap::transfer_one_widget(Gtk::Widget* pWidget, bool to_variable)
if(iterFind != m_mapWidgetsToVariables.end())
{
//Get the variable for the widget:
- void* pVariable = iterFind->second;
+ auto pVariable = iterFind->second;
if(pVariable)
{
//Cast the variable appropriately and set it appropriately:
- Gtk::Entry* pEntry = dynamic_cast<Gtk::Entry*>(pWidget);
- Gtk::ComboBox* pComboBox = dynamic_cast<Gtk::ComboBox*>(pWidget);
+ auto pEntry = dynamic_cast<Gtk::Entry*>(pWidget);
+ auto pComboBox = dynamic_cast<Gtk::ComboBox*>(pWidget);
- Gtk::ToggleButton* pToggleButton = dynamic_cast<Gtk::ToggleButton*>(pWidget); //CheckButtons and
RadioButtons.
- Gtk::Scale* pScale = dynamic_cast<Gtk::Scale*>(pWidget);
- Gtk::Calendar* pCalendar = dynamic_cast<Gtk::Calendar*>(pWidget);
+ auto pToggleButton = dynamic_cast<Gtk::ToggleButton*>(pWidget); //CheckButtons and RadioButtons.
+ auto pScale = dynamic_cast<Gtk::Scale*>(pWidget);
+ auto pCalendar = dynamic_cast<Gtk::Calendar*>(pWidget);
if(pEntry)
{
- Glib::ustring* pVar = (Glib::ustring*)(pVariable);
+ auto pVar = static_cast<Glib::ustring*>(pVariable);
if(to_variable)
(*pVar) = pEntry->get_text();
@@ -139,8 +139,8 @@ void VariablesMap::transfer_one_widget(Gtk::Widget* pWidget, bool to_variable)
if(pComboBox)
{
- Glib::ustring* pVar = (Glib::ustring*)(pVariable);
- Gtk::Entry* pIEntry = dynamic_cast<Gtk::Entry*>(pComboBox->get_child());
+ auto pVar = static_cast<Glib::ustring*>(pVariable);
+ auto pIEntry = dynamic_cast<Gtk::Entry*>(pComboBox->get_child());
if(to_variable)
{
@@ -154,7 +154,7 @@ void VariablesMap::transfer_one_widget(Gtk::Widget* pWidget, bool to_variable)
if(pToggleButton)
{
- bool* pVar = (bool*)(pVariable);
+ auto pVar = static_cast<bool*>(pVariable);
if(to_variable)
(*pVar) = pToggleButton->get_active();
@@ -164,7 +164,7 @@ void VariablesMap::transfer_one_widget(Gtk::Widget* pWidget, bool to_variable)
if(pScale)
{
- double* pVar = (double*)(pVariable);
+ auto pVar = static_cast<double*>(pVariable);
if(to_variable)
(*pVar) = pScale->get_value();
@@ -174,7 +174,7 @@ void VariablesMap::transfer_one_widget(Gtk::Widget* pWidget, bool to_variable)
if(pCalendar)
{
- Glib::Date* pVar = (Glib::Date*)(pVariable);
+ auto pVar = static_cast<Glib::Date*>(pVariable);
if(to_variable)
{
diff --git a/glom/window_boxholder.cc b/glom/window_boxholder.cc
index b9f1420..4d83f00 100644
--- a/glom/window_boxholder.cc
+++ b/glom/window_boxholder.cc
@@ -42,7 +42,7 @@ Window_BoxHolder::Window_BoxHolder(Box_WithButtons* pBox, const Glib::ustring& t
pBox->show();
//Set the default button, if there is one:
- Gtk::Widget* default_button = pBox->get_default_button();
+ auto default_button = pBox->get_default_button();
if(default_button)
set_default(*default_button);
}
diff --git a/tests/glade_toplevels_instantiation.cc b/tests/glade_toplevels_instantiation.cc
index 575c179..94a75f5 100644
--- a/tests/glade_toplevels_instantiation.cc
+++ b/tests/glade_toplevels_instantiation.cc
@@ -120,7 +120,7 @@ int main(int argc, char* argv[])
for(const auto& item : root->get_children("object"))
{
- const xmlpp::Element* child = dynamic_cast<const xmlpp::Element*>(item);
+ const auto child = dynamic_cast<const xmlpp::Element*>(item);
//Try to instante the object with Gtk::Builder:
if(child && !attempt_instantiation(filepath, child))
diff --git a/tests/python/test_python_execute_func_with_record.cc
b/tests/python/test_python_execute_func_with_record.cc
index a041126..b361256 100644
--- a/tests/python/test_python_execute_func_with_record.cc
+++ b/tests/python/test_python_execute_func_with_record.cc
@@ -20,7 +20,7 @@ static void on_cleanup_progress()
void cleanup()
{
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
const auto stopped = connection_pool->cleanup( sigc::ptr_fun(&on_cleanup_progress) );
g_assert(stopped);
@@ -67,7 +67,7 @@ int main()
g_assert(!document.get_is_example_file());;
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
connection_pool->setup_from_document(&document);
//This is not really necessary for sqlite-based databases.
diff --git a/tests/python/test_python_execute_func_with_record_field_types.cc
b/tests/python/test_python_execute_func_with_record_field_types.cc
index fdcff6d..b22a6e5 100644
--- a/tests/python/test_python_execute_func_with_record_field_types.cc
+++ b/tests/python/test_python_execute_func_with_record_field_types.cc
@@ -104,7 +104,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
return false;
}
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
std::shared_ptr<Glom::SharedConnection> connection = connection_pool->connect();
g_assert(connection);
diff --git a/tests/test_glade_derived_instantiation.cc b/tests/test_glade_derived_instantiation.cc
index c4d3444..253d1ee 100644
--- a/tests/test_glade_derived_instantiation.cc
+++ b/tests/test_glade_derived_instantiation.cc
@@ -99,7 +99,7 @@ bool instantiate_widget()
//GTK+ complains if the a Gtk::Dialog has no transient parent.
Gtk::Window* parent_window = nullptr;
- Gtk::Dialog* dialog = dynamic_cast<Gtk::Dialog*>(widget);
+ auto dialog = dynamic_cast<Gtk::Dialog*>(widget);
if(dialog)
{
parent_window = new Gtk::Window();
diff --git a/tests/test_selfhosting_new_from_example_operator.cc
b/tests/test_selfhosting_new_from_example_operator.cc
index de800d9..5d0e856 100644
--- a/tests/test_selfhosting_new_from_example_operator.cc
+++ b/tests/test_selfhosting_new_from_example_operator.cc
@@ -125,7 +125,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
}
//Check that the operator user still has access to database metadata:
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
connection_pool->connect();
const auto field_types = connection_pool->get_field_types();
if(!field_types)
diff --git a/tests/test_selfhosting_new_then_change_columns.cc
b/tests/test_selfhosting_new_then_change_columns.cc
index 10153be..58230d3 100644
--- a/tests/test_selfhosting_new_then_change_columns.cc
+++ b/tests/test_selfhosting_new_then_change_columns.cc
@@ -60,7 +60,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
}
field_new->set_glom_type(Glom::Field::glom_field_type::TEXT);
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
if(!connection_pool)
{
std::cerr << G_STRFUNC << ": Failure: connection_pool is null." << std::endl;
diff --git a/tests/test_selfhosting_utils.cc b/tests/test_selfhosting_utils.cc
index a988253..b305f49 100644
--- a/tests/test_selfhosting_utils.cc
+++ b/tests/test_selfhosting_utils.cc
@@ -119,7 +119,7 @@ static bool delete_directory(const std::string& uri)
void test_selfhosting_cleanup(bool delete_file)
{
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
const auto stopped = connection_pool->cleanup( sigc::ptr_fun(&on_cleanup_progress) );
g_assert(stopped);
@@ -152,7 +152,7 @@ void test_selfhosting_cleanup(bool delete_file)
bool test_selfhost(Glom::Document& document, const Glib::ustring& user, const Glib::ustring& password)
{
//TODO: Let this happen automatically on first connection?
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
connection_pool->setup_from_document(&document);
@@ -208,7 +208,7 @@ bool test_create_and_selfhost_new_empty(Glom::Document& document, Glom::Document
g_assert(saved);
//Specify the backend and backend-specific details to be used by the connectionpool.
- Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
+ auto connection_pool = Glom::ConnectionPool::get_instance();
connection_pool->setup_from_document(&document);
//We must specify a default username and password:
diff --git a/tests/test_xml_utils.cc b/tests/test_xml_utils.cc
index 956e3ac..df6a3f7 100644
--- a/tests/test_xml_utils.cc
+++ b/tests/test_xml_utils.cc
@@ -33,7 +33,7 @@ xmlpp::Element* create_element()
static bool test_value(Glom::Field::glom_field_type field_type, const Gnome::Gda::Value& value)
{
- xmlpp::Element* element = create_element();
+ auto element = create_element();
Glom::XmlUtils::set_node_text_child_as_value(element, value, field_type);
const Gnome::Gda::Value value_retrieved =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]