Commit 601fd228 authored by Murray Cumming's avatar Murray Cumming
Browse files

C++11: More use of auto.

parent e5519f1c
......@@ -821,7 +821,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
//std::cerr << G_STRFUNC << ": field_name=" << field_name << std::endl;
//Do we already have this in our list?
type_field_calcs::iterator iterFind = m_FieldsCalculationInProgress.find(field_name);
auto iterFind = m_FieldsCalculationInProgress.find(field_name);
if(iterFind == m_FieldsCalculationInProgress.end()) //If it was not found.
{
//Add it:
......
......@@ -199,7 +199,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
std::cerr << G_STRFUNC << ": INSERT failed." << std::endl;
else
{
Gtk::TreeModel::iterator row = get_row_selected(); //Null and ignored for details views.
auto row = get_row_selected(); //Null and ignored for details views.
set_primary_key_value(row, primary_key_value); //Needed by Box_Data_List::on_adddel_user_changed().
//Update any lookups, related fields, or calculations:
......
......@@ -109,7 +109,7 @@ bool Box_Reports::fill_from_database()
std::shared_ptr<Report> report = document->get_report(m_table_name, item);
if(report)
{
Gtk::TreeModel::iterator row = m_AddDel.add_item(report->get_name());
auto row = m_AddDel.add_item(report->get_name());
fill_row(row, report);
}
}
......
......@@ -174,7 +174,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
{
if(info->get_mime_type() == "application/x-glom")
{
Gtk::TreeModel::iterator iter = m_existing_model->append(m_iter_existing_recent->children());
auto iter = m_existing_model->append(m_iter_existing_recent->children());
(*iter)[m_existing_columns.m_col_title] = info->get_display_name();
(*iter)[m_existing_columns.m_col_time] = info->get_modified();
(*iter)[m_existing_columns.m_col_recent_info] = info;
......@@ -310,7 +310,7 @@ Dialog_ExistingOrNew::~Dialog_ExistingOrNew()
bool Dialog_ExistingOrNew::on_existing_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool /* path_currently_selected */)
{
Gtk::TreeModel::iterator iter = model->get_iter(path);
auto iter = model->get_iter(path);
#ifndef G_OS_WIN32
if(iter == m_iter_existing_network)
return false; /* Do not allow parent nodes to be selected. */
......@@ -324,7 +324,7 @@ bool Dialog_ExistingOrNew::on_existing_select_func(const Glib::RefPtr<Gtk::TreeM
#ifndef GLOM_ENABLE_CLIENT_ONLY
bool Dialog_ExistingOrNew::on_new_select_func(const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool /* path_currently_selected */)
{
Gtk::TreeModel::iterator iter = model->get_iter(path);
auto iter = model->get_iter(path);
if(iter == m_iter_new_template)
return false; /* Do not allow parent nodes to be selected. */
else
......@@ -434,7 +434,7 @@ Glib::ustring Dialog_ExistingOrNew::get_service_name() const
std::shared_ptr<Gtk::TreeModel::iterator> Dialog_ExistingOrNew::create_dummy_item_existing(const Gtk::TreeModel::iterator& parent, const Glib::ustring& text)
{
Gtk::TreeModel::iterator iter = m_existing_model->append(parent->children());
auto iter = m_existing_model->append(parent->children());
(*iter)[m_existing_columns.m_col_title] = text;
return std::shared_ptr<Gtk::TreeModel::iterator>(new Gtk::TreeModel::iterator(iter));
}
......@@ -442,7 +442,7 @@ std::shared_ptr<Gtk::TreeModel::iterator> Dialog_ExistingOrNew::create_dummy_ite
#ifndef GLOM_ENABLE_CLIENT_ONLY
std::shared_ptr<Gtk::TreeModel::iterator> Dialog_ExistingOrNew::create_dummy_item_new(const Gtk::TreeModel::iterator& parent, const Glib::ustring& text)
{
Gtk::TreeModel::iterator iter = m_new_model->append(parent->children());
auto iter = m_new_model->append(parent->children());
(*iter)[m_new_columns.m_col_title] = text;
return std::shared_ptr<Gtk::TreeModel::iterator>(new Gtk::TreeModel::iterator(iter));
}
......@@ -603,7 +603,7 @@ void Dialog_ExistingOrNew::update_ui_sensitivity()
}
else
{
Gtk::TreeModel::iterator sel = m_existing_view->get_selection()->get_selected();
auto sel = m_existing_view->get_selection()->get_selected();
sensitivity = (sel != m_iter_existing_recent);
#ifndef G_OS_WIN32
sensitivity = sensitivity && (sel != m_iter_existing_network);
......@@ -626,7 +626,7 @@ void Dialog_ExistingOrNew::update_ui_sensitivity()
}
else
{
Gtk::TreeModel::iterator sel = m_new_view->get_selection()->get_selected();
auto sel = m_new_view->get_selection()->get_selected();
sensitivity = (sel != m_iter_new_template &&
(!m_iter_new_template_dummy.get() || sel != *m_iter_new_template_dummy));
}
......@@ -683,7 +683,7 @@ void Dialog_ExistingOrNew::append_example(const Glib::ustring& title, const std:
const auto is_first_item = m_iter_new_template_dummy.get();
// Add to list.
Gtk::TreeModel::iterator iter = m_new_model->append(m_iter_new_template->children());
auto iter = m_new_model->append(m_iter_new_template->children());
(*iter)[m_new_columns.m_col_title] = title;
(*iter)[m_new_columns.m_col_template_uri] = "resource://" + resource_name; //GFile understands this for actual files, though not directories.
......@@ -718,7 +718,7 @@ void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServic
{
//Translator hint: This is <Service Name> on <Host> (via Network Interface such as eth0).
gchar* title = g_strdup_printf(_("%s on %s (via %s)"), name.c_str(), epc_service_info_get_host(info), epc_service_info_get_interface(info));
Gtk::TreeModel::iterator iter = m_existing_model->prepend(m_iter_existing_network->children());
auto iter = m_existing_model->prepend(m_iter_existing_network->children());
(*iter)[m_existing_columns.m_col_title] = title;
(*iter)[m_existing_columns.m_col_time] = std::time(0); /* sort more recently discovered items above */
(*iter)[m_existing_columns.m_col_service_name] = name;
......
......@@ -1447,7 +1447,7 @@ void Frame_Glom::update_table_in_document_from_database()
if(field_database)
{
//Is the field already in the document?
type_vec_fields::iterator iterFindDoc = std::find_if( fieldsDocument.begin(), fieldsDocument.end(), predicate_FieldHasName<Field>( field_database->get_name() ) );
auto iterFindDoc = std::find_if( fieldsDocument.begin(), fieldsDocument.end(), predicate_FieldHasName<Field>( field_database->get_name() ) );
if(iterFindDoc == fieldsDocument.end()) //If it was not found:
{
//Add it
......@@ -1492,7 +1492,7 @@ void Frame_Glom::update_table_in_document_from_database()
for(const auto& field : fieldsDocument)
{
//Check whether it's in the database:
type_vec_fields::iterator iterFindDatabase = std::find_if( fieldsDatabase.begin(), fieldsDatabase.end(), predicate_FieldHasName<Field>( field->get_name() ) );
auto iterFindDatabase = std::find_if( fieldsDatabase.begin(), fieldsDatabase.end(), predicate_FieldHasName<Field>( field->get_name() ) );
if(iterFindDatabase != fieldsDatabase.end()) //If it was found
{
fieldsActual.push_back(field);
......
......@@ -97,7 +97,7 @@ Dialog_Import_CSV::Dialog_Import_CSV(BaseObjectType* cobject, const Glib::RefPtr
//Fill the list of encodings:
m_encoding_model = Gtk::ListStore::create(m_encoding_columns);
Gtk::TreeModel::iterator iter = m_encoding_model->append();
auto iter = m_encoding_model->append();
(*iter)[m_encoding_columns.m_col_name] = _("Auto Detect");
// Separator:
......@@ -196,7 +196,7 @@ void Dialog_Import_CSV::import(const Glib::ustring& uri, const Glib::ustring& in
m_target_table->set_markup("<b>" + Glib::Markup::escape_text(into_table) + "</b>");
m_field_model = Gtk::ListStore::create(m_field_columns);
Gtk::TreeModel::iterator tree_iter = m_field_model->append();
auto tree_iter = m_field_model->append();
(*tree_iter)[m_field_columns.m_col_field_name] = _("<None>");
const Document::type_vec_fields fields(document->get_table_fields(into_table));
......@@ -210,7 +210,7 @@ void Dialog_Import_CSV::import(const Glib::ustring& uri, const Glib::ustring& in
// automatically anyway.
if(!field->get_primary_key() || !field->get_auto_increment())
{
Gtk::TreeModel::iterator tree_iter = m_field_model->append();
auto tree_iter = m_field_model->append();
(*tree_iter)[m_field_columns.m_col_field] = field;
(*tree_iter)[m_field_columns.m_col_field_name] = field->get_name();
}
......@@ -323,7 +323,7 @@ void Dialog_Import_CSV::on_first_line_as_title_toggled()
{
m_sample_view->set_headers_visible(true);
Gtk::TreeModel::Path path("1");
Gtk::TreeModel::iterator iter = m_sample_model->get_iter(path);
auto iter = m_sample_model->get_iter(path);
// Remove the first row from the view
if(iter && (*iter)[m_sample_columns.m_col_row] == 0)
......@@ -342,7 +342,7 @@ void Dialog_Import_CSV::on_first_line_as_title_toggled()
// Check whether row 0 is displayed
Gtk::TreeModel::Path path("1");
Gtk::TreeModel::iterator iter = m_sample_model->get_iter(path);
auto iter = m_sample_model->get_iter(path);
//if((!iter || (*iter)[m_sample_columns.m_col_row] != 0) && !m_parser->get_rows_empty() && m_sample_rows->get_value_as_int() > 0)
if((!iter || (*iter)[m_sample_columns.m_col_row] != 0) &&
......@@ -384,7 +384,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
// +1 for the "target field" row
Gtk::TreeModel::Path path(1);
path[0] = new_sample_rows + 1;
Gtk::TreeModel::iterator iter = m_sample_model->get_iter(path);
auto iter = m_sample_model->get_iter(path);
while(iter != m_sample_model->children().end())
iter = m_sample_model->erase(iter);
......@@ -398,7 +398,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
for(guint i = current_sample_rows; i < new_sample_rows; ++i, ++row_index)
{
Gtk::TreeModel::iterator iter = m_sample_model->append();
auto iter = m_sample_model->append();
(*iter)[m_sample_columns.m_col_row] = row_index;
}
}
......@@ -406,7 +406,7 @@ void Dialog_Import_CSV::on_sample_rows_changed()
Glib::ustring Dialog_Import_CSV::get_current_encoding() const
{
Gtk::TreeModel::iterator iter = m_encoding_combo->get_active();
auto iter = m_encoding_combo->get_active();
const Glib::ustring encoding = (*iter)[m_encoding_columns.m_col_charset];
if(encoding.empty())
......@@ -478,7 +478,7 @@ void Dialog_Import_CSV::on_parser_line_scanned(CsvParser::type_row_strings row,
if(!m_sample_model)
{
setup_sample_model(row);
Gtk::TreeModel::iterator iter = m_sample_model->append();
auto iter = m_sample_model->append();
// -1 means the row to select target fields (see special handling in cell data funcs)
(*iter)[m_sample_columns.m_col_row] = -1;
}
......@@ -493,7 +493,7 @@ void Dialog_Import_CSV::on_parser_line_scanned(CsvParser::type_row_strings row,
{
if(sample_rows < static_cast<guint>(m_sample_rows->get_value_as_int()))
{
Gtk::TreeModel::iterator tree_iter = m_sample_model->append();
auto tree_iter = m_sample_model->append();
(*tree_iter)[m_sample_columns.m_col_row] = row_number;
}
}
......@@ -639,7 +639,7 @@ void Dialog_Import_CSV::field_data_func(Gtk::CellRenderer* renderer, const Gtk::
void Dialog_Import_CSV::on_field_edited(const Glib::ustring& path, const Glib::ustring& new_text, guint column_number)
{
Gtk::TreeModel::Path treepath(path);
Gtk::TreeModel::iterator iter = m_sample_model->get_iter(treepath);
auto iter = m_sample_model->get_iter(treepath);
// Lookup field indicated by new_text
const Gtk::TreeNodeChildren& children = m_field_model->children();
......@@ -649,7 +649,7 @@ void Dialog_Import_CSV::on_field_edited(const Glib::ustring& path, const Glib::u
{
std::shared_ptr<Field> field = (*field_iter)[m_field_columns.m_col_field];
// Check whether another column is already using that field
type_vec_fields::iterator vec_field_iter = std::find(m_fields.begin(), m_fields.end(), field);
auto vec_field_iter = std::find(m_fields.begin(), m_fields.end(), field);
// Reset the old column since two different columns cannot be imported into the same field
if(vec_field_iter != m_fields.end()) *vec_field_iter = std::shared_ptr<Field>();
......
......@@ -952,7 +952,7 @@ type_vec_fields get_fields_for_table_from_database(const Glib::ustring& table_na
}
//Hide system fields.
type_vec_fields::iterator iterFind = std::find_if(result.begin(), result.end(), predicate_FieldHasName<Field>(GLOM_STANDARD_FIELD_LOCK));
auto iterFind = std::find_if(result.begin(), result.end(), predicate_FieldHasName<Field>(GLOM_STANDARD_FIELD_LOCK));
if(iterFind != result.end())
result.erase(iterFind);
......@@ -1035,7 +1035,7 @@ std::shared_ptr<Field> get_fields_for_table_one_field(const Document* document,
return result;
type_vec_fields fields = get_fields_for_table(document, table_name); //TODO_Performance
type_vec_fields::iterator iter = std::find_if(fields.begin(), fields.end(), predicate_FieldHasName<Field>(field_name));
auto iter = std::find_if(fields.begin(), fields.end(), predicate_FieldHasName<Field>(field_name));
if(iter != fields.end()) //TODO: Handle error?
{
return *iter;
......
......@@ -58,7 +58,7 @@ public:
virtual void remove_view(type_view* pView)
{
typename type_vec_views::iterator iter = std::find(m_vecViews.begin(), m_vecViews.end(), pView);
auto iter = std::find(m_vecViews.begin(), m_vecViews.end(), pView);
if(iter != m_vecViews.end())
m_vecViews.erase(iter);
}
......
......@@ -735,7 +735,7 @@ void Document::remove_field(const Glib::ustring& table_name, const Glib::ustring
if(info)
{
auto vecFields = info->m_fields;
type_vec_fields::iterator iterFind = std::find_if( vecFields.begin(), vecFields.end(), predicate_FieldHasName<Field>(field_name) );
auto iterFind = std::find_if( vecFields.begin(), vecFields.end(), predicate_FieldHasName<Field>(field_name) );
if(iterFind != vecFields.end()) //If it was found:
{
//Remove it:
......@@ -4023,7 +4023,7 @@ Document::type_list_groups Document::get_groups() const
void Document::set_group(GroupInfo& group)
{
const auto name = group.get_name();
type_map_groups::iterator iter = m_groups.find(name);
auto iter = m_groups.find(name);
if(iter == m_groups.end())
{
//Add it if necesary:
......@@ -4043,7 +4043,7 @@ void Document::set_group(GroupInfo& group)
void Document::remove_group(const Glib::ustring& group_name)
{
type_map_groups::iterator iter = m_groups.find(group_name);
auto iter = m_groups.find(group_name);
if(iter != m_groups.end())
{
m_groups.erase(iter);
......@@ -4098,7 +4098,7 @@ void Document::remove_report(const Glib::ustring& table_name, const Glib::ustrin
const auto info = get_table_info(table_name);
if(info)
{
DocumentTableInfo::type_reports::iterator iterFindReport = info->m_reports.find(report_name);
auto iterFindReport = info->m_reports.find(report_name);
if(iterFindReport != info->m_reports.end())
{
info->m_reports.erase(iterFindReport);
......@@ -4157,7 +4157,7 @@ void Document::remove_print_layout(const Glib::ustring& table_name, const Glib::
const auto info = get_table_info(table_name);
if(info)
{
DocumentTableInfo::type_print_layouts::iterator iterFindPrintLayout = info->m_print_layouts.find(print_layout_name);
auto iterFindPrintLayout = info->m_print_layouts.find(print_layout_name);
if(iterFindPrintLayout != info->m_print_layouts.end())
{
info->m_print_layouts.erase(iterFindPrintLayout);
......@@ -4708,7 +4708,7 @@ void Document::set_library_module(const Glib::ustring& name, const Glib::ustring
if(name.empty())
return;
type_map_library_scripts::iterator iter = m_map_library_scripts.find(name);
auto iter = m_map_library_scripts.find(name);
if(iter != m_map_library_scripts.end())
{
//Change the existing script, if necessary:
......@@ -4739,7 +4739,7 @@ Glib::ustring Document::get_library_module(const Glib::ustring& name) const
void Document::remove_library_module(const Glib::ustring& name)
{
type_map_library_scripts::iterator iter = m_map_library_scripts.find(name);
auto iter = m_map_library_scripts.find(name);
if(iter != m_map_library_scripts.end())
{
m_map_library_scripts.erase(iter);
......
......@@ -424,7 +424,7 @@ bool Privs::on_privs_privileges_cache_timeout(const Glib::ustring& table_name)
//std::cout << "debug: " << G_STRFUNC << ": table=" << table_name << std::endl;
//Forget the cached privileges after a few seconds:
type_map_privileges::iterator iter = m_privileges_cache.find(table_name);
auto iter = m_privileges_cache.find(table_name);
if(iter != m_privileges_cache.end())
{
//std::cout << "debug: " << G_STRFUNC << ": Cleared cache for table=" << table_name << std::endl;
......@@ -514,7 +514,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
//TODO: Make sure we handle the failure well in that unlikely case.
//Stop the existing timeout if it has not run yet.
type_map_cache_timeouts::iterator iter_connection = m_map_cache_timeouts.find(table_name);
auto iter_connection = m_map_cache_timeouts.find(table_name);
if(iter_connection != m_map_cache_timeouts.end())
iter_connection->second.disconnect();
......
......@@ -53,7 +53,7 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
if(!key.empty())
{
//Return a cached item if possible:
PyGlomRelated::type_map_relatedrecords::iterator iterCacheFind = m_map_relatedrecords.find(key);
auto iterCacheFind = m_map_relatedrecords.find(key);
if(iterCacheFind != m_map_relatedrecords.end())
{
//Return a reference to the cached item:
......
......@@ -254,7 +254,7 @@ void Box_Data_List::on_details_nav_first()
void Box_Data_List::on_details_nav_previous()
{
Gtk::TreeModel::iterator iter = m_AddDel.get_item_selected();
auto iter = m_AddDel.get_item_selected();
if(iter)
{
//Don't try to select a negative record number.
......@@ -270,7 +270,7 @@ void Box_Data_List::on_details_nav_previous()
void Box_Data_List::on_details_nav_next()
{
Gtk::TreeModel::iterator iter = m_AddDel.get_item_selected();
auto iter = m_AddDel.get_item_selected();
if(iter)
{
//Don't go past the last record:
......@@ -290,7 +290,7 @@ void Box_Data_List::on_details_nav_next()
void Box_Data_List::on_details_nav_last()
{
Gtk::TreeModel::iterator iter = m_AddDel.get_last_row();
auto iter = m_AddDel.get_last_row();
if(iter)
{
m_AddDel.select_item(iter);
......@@ -304,11 +304,11 @@ void Box_Data_List::on_details_nav_last()
void Box_Data_List::on_details_record_deleted(const Gnome::Gda::Value& primary_key_value)
{
//Find out which row is affected:
Gtk::TreeModel::iterator iter = m_AddDel.get_row(primary_key_value);
auto iter = m_AddDel.get_row(primary_key_value);
if(iter)
{
//Remove the row:
Gtk::TreeModel::iterator iterNext = iter;
auto iterNext = iter;
iterNext++;
m_AddDel.remove_item(iter);
......@@ -351,7 +351,7 @@ Gnome::Gda::Value Box_Data_List::get_primary_key_value_first() const
Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
if(model)
{
Gtk::TreeModel::iterator iter = model->children().begin();
auto iter = model->children().begin();
while(iter != model->children().end())
{
Gnome::Gda::Value value = get_primary_key_value(iter);
......@@ -506,7 +506,7 @@ void Box_Data_List::set_open_button_title(const Glib::ustring& title)
void Box_Data_List::set_primary_key_value_selected(const Gnome::Gda::Value& primary_key_value)
{
Gtk::TreeModel::iterator iter = m_AddDel.get_row(primary_key_value);
auto iter = m_AddDel.get_row(primary_key_value);
if(iter)
{
m_AddDel.select_item(iter);
......
......@@ -297,7 +297,7 @@ void ComboGlom::set_value(const Gnome::Gda::Value& value)
Gnome::Gda::Value ComboGlom::get_value() const
{
//Get the active row:
Gtk::TreeModel::iterator iter = get_active();
auto iter = get_active();
if(iter)
{
......@@ -366,7 +366,7 @@ void ComboGlom::on_changed()
//This signal is emitted for every key press, but sometimes it's just to say that the active item has changed to "no active item",
//if the text is not in the dropdown list:
Gtk::TreeModel::iterator iter = get_active();
auto iter = get_active();
if(iter)
{
......
......@@ -220,7 +220,7 @@ void ComboAsRadioButtons::set_text(const Glib::ustring& text)
{
m_old_text = text;
type_map_buttons::iterator iter = m_map_buttons.find(text);
auto iter = m_map_buttons.find(text);
if(iter != m_map_buttons.end())
{
Gtk::RadioButton* button = iter->second;
......
......@@ -160,7 +160,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
for(const auto& the_pair : list_values)
{
Gtk::TreeModel::iterator iterTree = list_store->append();
auto iterTree = list_store->append();
Gtk::TreeModel::Row row = *iterTree;
if(layout_choice_first)
......@@ -215,7 +215,7 @@ void ComboChoicesWithTreeModel::set_choices_fixed(const Formatting::type_list_va
for(const auto& choicevalue : list_values)
{
Gtk::TreeModel::iterator iterTree = list_store->append();
auto iterTree = list_store->append();
Gtk::TreeModel::Row row = *iterTree;
std::shared_ptr<const LayoutItem_Field> layout_item = std::dynamic_pointer_cast<LayoutItem_Field>(get_layout_item());
......
......@@ -846,7 +846,7 @@ DbTreeModel::DbValue DbTreeModel::get_key_value(const TreeModel::iterator& iter)
if(check_treeiter_validity(iter))
{
type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
type_map_rows::iterator iterFind = m_map_rows.find(datamodel_row);
auto iterFind = m_map_rows.find(datamodel_row);
if(iterFind != m_map_rows.end())
return iterFind->second.m_key;
else
......
......@@ -152,7 +152,7 @@ void DbAddDel::set_height_rows_actual(gulong rows_count)
void DbAddDel::do_user_requested_edit()
{
Gtk::TreeModel::iterator iter = get_item_selected();
auto iter = get_item_selected();
if(iter)
{
signal_user_requested_edit()(iter);
......@@ -171,7 +171,7 @@ void DbAddDel::on_cell_button_clicked(const Gtk::TreeModel::Path& path)
if(!m_refListStore)
return;
Gtk::TreeModel::iterator iter = m_refListStore->get_iter(path);
auto iter = m_refListStore->get_iter(path);
if(iter)
{
select_item(iter, false /* start_editing */);
......@@ -204,7 +204,7 @@ void DbAddDel::on_MenuPopup_activate_Delete()
Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView.get_selection();
if(refSelection)
{
Gtk::TreeModel::iterator iter = refSelection->get_selected();
auto iter = refSelection->get_selected();
if(iter && !get_is_placeholder_row(iter))
{
//TODO: We can't handle multiple-selections yet.
......@@ -355,7 +355,7 @@ Gnome::Gda::Value DbAddDel::get_value(const Gtk::TreeModel::iterator& iter, cons
Gnome::Gda::Value DbAddDel::get_value_key_selected() const
{
Gtk::TreeModel::iterator iter = get_item_selected();
auto iter = get_item_selected();
if(iter)
{
return get_value_key(iter);
......@@ -404,7 +404,7 @@ Gtk::TreeModel::iterator DbAddDel::get_row(const Gnome::Gda::Value& key)
if(!m_refListStore)
return Gtk::TreeModel::iterator();
for(Gtk::TreeModel::iterator iter = m_refListStore->children().begin(); iter != m_refListStore->children().end(); ++iter)
for(auto iter = m_refListStore->children().begin(); iter != m_refListStore->children().end(); ++iter)
{
//Gtk::TreeModel::Row row = *iter;
const auto valTemp = get_value_key(iter);
......@@ -519,7 +519,7 @@ guint DbAddDel::get_fixed_cell_height()
m_fixed_cell_height = height;
//Look at each column:
for(type_column_items::iterator iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
for(auto iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
{
Glib::ustring font_name;
......@@ -694,7 +694,7 @@ void DbAddDel::construct_specified_columns()
const auto has_expandable_column = get_column_to_expand(column_to_expand);
//std::cout << "DEBUG: column_to_expand=" << column_to_expand << ", has=" << has_expandable_column << std::endl;
for(type_column_items::iterator iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
for(auto iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
{
const std::shared_ptr<LayoutItem> layout_item = m_column_items[model_column_index]; //TODO: Inefficient.
if(layout_item) //column_info.m_visible)
......@@ -1254,7 +1254,7 @@ void DbAddDel::on_cell_layout_button_clicked(const Gtk::TreeModel::Path& path, i
if(!m_refListStore)
return;
Gtk::TreeModel::iterator iter = m_refListStore->get_iter(path);
auto iter = m_refListStore->get_iter(path);
if(iter)
{
std::shared_ptr<const LayoutItem> layout_item = m_column_items[model_column_index];
......@@ -1279,7 +1279,7 @@ void DbAddDel::on_treeview_cell_edited_bool(const Glib::ustring& path_string, in
const Gtk::TreeModel::Path path(path_string);
//Get the row from the path:
Gtk::TreeModel::iterator iter = m_refListStore->get_iter(path);
auto iter = m_refListStore->get_iter(path);
if(iter)
{
Gtk::TreeModel::Row row = *iter;
......@@ -1398,7 +1398,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
}
//Get the row from the path:
Gtk::TreeModel::iterator iter = m_refListStore->get_iter(path);
auto iter = m_refListStore->get_iter(path);
if(iter != get_model()->children().end())
{
Gtk::TreeModel::Row row = *iter;
......@@ -1626,9 +1626,9 @@ void DbAddDel::on_treeview_columns_changed()
typedef std::vector<Gtk::TreeViewColumn*> type_vecViewColumns;
type_vecViewColumns vecViewColumns = m_TreeView.get_columns();
for(type_vecViewColumns::iterator iter = vecViewColumns.begin(); iter != vecViewColumns.end(); ++iter)
for(auto iter = vecViewColumns.begin(); iter != vecViewColumns.end(); ++iter)
{
DbTreeViewColumnGlom* pViewColumn = dynamic_cast<DbTreeViewColumnGlom*>(*iter);
auto pViewColumn = dynamic_cast<DbTreeViewColumnGlom*>(*iter);
if(pViewColumn)
{
const auto column_id = pViewColumn->get_column_id();
......@@ -2055,7 +2055,7 @@ void DbAddDel::show_hint_model()
m_treeviewcolumn_button = 0; //When we removed the view columns, this was deleted because it's manage()ed.
m_model_hint = Gtk::ListStore::create(m_columns_hint);
Gtk::TreeModel::iterator iter = m_model_hint->append();
auto iter = m_model_hint->append();
(*iter)[m_columns_hint.m_col_hint] = _("Right-click to layout, to specify the related fields.");
m_TreeView.set_model(m_model_hint);
......@@ -2065,7 +2065,7 @@ void DbAddDel::show_hint_model()
bool DbAddDel::start_new_record()
{
Gtk::TreeModel::iterator iter = get_item_placeholder();
auto iter = get_item_placeholder();
if(!iter)
return false;
......@@ -2081,7 +2081,7 @@ bool DbAddDel::start_new_record()
if(fieldPrimaryKey && fieldPrimaryKey->get_auto_increment())
{
//Start editing in the first cell that is not auto_increment:
for(type_column_items::iterator iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
for(auto iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
{