Commit b4539c95 authored by Murray Cumming's avatar Murray Cumming
Browse files

C++11: More use of auto.

parent 78ad9e6b
......@@ -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();
......
......@@ -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;
......
......@@ -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.
......
......@@ -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();
}
......
......@@ -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)
......
......@@ -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.
......
......@@ -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
......
......@@ -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");
......
......@@ -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();