[glom/gtkmm4v4: 31/37] gtkmm4: Pass TreeModel::iterator instead of Row.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/gtkmm4v4: 31/37] gtkmm4: Pass TreeModel::iterator instead of Row.
- Date: Wed, 15 Mar 2017 14:56:34 +0000 (UTC)
commit f86550f5496918f56485c20aff2a2d2f5ac2360e
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Mar 15 11:26:05 2017 +0100
gtkmm4: Pass TreeModel::iterator instead of Row.
Because there doesn't seem to be an implicit conversion now.
See https://bugzilla.gnome.org/show_bug.cgi?id=134520#c16
glom/mode_data/db_adddel/db_adddel.cc | 11 ++++++-----
glom/mode_design/box_db_table_relationships.cc | 19 ++++++++++---------
glom/mode_design/fields/combo_fieldtype.cc | 3 ++-
glom/mode_design/layout/combobox_fields.cc | 3 ++-
glom/mode_design/layout/combobox_relationship.cc | 6 ++++--
.../layout/dialog_choose_relationship.cc | 3 ++-
glom/mode_design/layout/dialog_layout_details.cc | 4 ++--
.../layout/layout_item_dialogs/box_formatting.cc | 2 +-
.../layout_item_dialogs/combo_summarytype.cc | 2 +-
.../report_layout/dialog_layout_report.cc | 4 ++--
glom/mode_design/translation/combobox_locale.cc | 2 +-
glom/navigation/box_tables.cc | 13 +++++++------
12 files changed, 40 insertions(+), 32 deletions(-)
---
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 2c5c046..50efaea 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -1329,7 +1329,7 @@ void DbAddDel::on_treeview_cell_edited_bool(const Glib::ustring& path_string, in
{
//Existing item changed:
- user_changed(row, model_column_index);
+ user_changed(iter, model_column_index);
}
}
}
@@ -1340,7 +1340,8 @@ void DbAddDel::on_idle_treeview_cell_edited_revert(const Gtk::TreeModel::Row& ro
if(!refTreeSelection)
return;
- refTreeSelection->select(row); //TODO: This does not seem to work.
+ const auto iter = row.get_iter();
+ refTreeSelection->select(iter); //TODO: This does not seem to work.
guint view_column_index = 0;
get_view_column_index(model_column_index, view_column_index);
@@ -1358,7 +1359,7 @@ void DbAddDel::on_idle_treeview_cell_edited_revert(const Gtk::TreeModel::Row& ro
return;
}
- const auto path = get_model()->get_path(row);
+ const auto path = get_model()->get_path(iter);
//Highlights the cell, and start the editing:
m_tree_view.set_cursor(path, *pColumn, *pCell, true /* start_editing */);
@@ -1493,7 +1494,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
{
//Signal that a new key was added:
if(m_allow_add)
- user_added(row);
+ user_added(iter);
}
else if(is_change)
{
@@ -1502,7 +1503,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
if(value != valOld)
{
if(do_change)
- user_changed(row, model_column_index);
+ user_changed(iter, model_column_index);
}
}
}
diff --git a/glom/mode_design/box_db_table_relationships.cc b/glom/mode_design/box_db_table_relationships.cc
index b79149f..54d0432 100644
--- a/glom/mode_design/box_db_table_relationships.cc
+++ b/glom/mode_design/box_db_table_relationships.cc
@@ -138,9 +138,10 @@ void Box_DB_Table_Relationships::save_to_document()
for(const auto& item : m_AddDel.get_model()->children())
{
- const auto old_name = m_AddDel.get_value_key(item);
+ const auto iter = item.get_iter();
+ const auto old_name = m_AddDel.get_value_key(iter);
- const auto name = m_AddDel.get_value(item, m_colName);
+ const auto name = m_AddDel.get_value(iter, m_colName);
if(!name.empty())
{
//If it is a rename:
@@ -154,14 +155,14 @@ void Box_DB_Table_Relationships::save_to_document()
relationship = std::make_shared<Relationship>();
relationship->set_name(name);
- relationship->set_title(m_AddDel.get_value(item, m_colTitle), AppWindow::get_current_locale());
- relationship->set_title_singular(m_AddDel.get_value(item, m_colTitleSingular),
AppWindow::get_current_locale());
+ relationship->set_title(m_AddDel.get_value(iter, m_colTitle), AppWindow::get_current_locale());
+ relationship->set_title_singular(m_AddDel.get_value(iter, m_colTitleSingular),
AppWindow::get_current_locale());
relationship->set_from_table(m_table_name);
- relationship->set_from_field(m_AddDel.get_value(item, m_colFromField));
- relationship->set_to_table(m_AddDel.get_value(item, m_colToTable));
- relationship->set_to_field(m_AddDel.get_value(item, m_colToField));
- relationship->set_allow_edit(m_AddDel.get_value_as_bool(item, m_colAllowEdit));
- relationship->set_auto_create(m_AddDel.get_value_as_bool(item, m_colAutoCreate));
+ relationship->set_from_field(m_AddDel.get_value(iter, m_colFromField));
+ relationship->set_to_table(m_AddDel.get_value(iter, m_colToTable));
+ relationship->set_to_field(m_AddDel.get_value(iter, m_colToField));
+ relationship->set_allow_edit(m_AddDel.get_value_as_bool(iter, m_colAllowEdit));
+ relationship->set_auto_create(m_AddDel.get_value_as_bool(iter, m_colAutoCreate));
vecRelationships.emplace_back(relationship);
}
diff --git a/glom/mode_design/fields/combo_fieldtype.cc b/glom/mode_design/fields/combo_fieldtype.cc
index d0746aa..c276987 100644
--- a/glom/mode_design/fields/combo_fieldtype.cc
+++ b/glom/mode_design/fields/combo_fieldtype.cc
@@ -68,7 +68,8 @@ void Combo_FieldType::set_field_type(Field::glom_field_type fieldType)
{
if( row[m_columns.m_col_type] == fieldType )
{
- set_active(row);
+ const auto iter = row.get_iter();
+ set_active(iter);
//TODO: What was this?
//Glib::ustring temp = row[m_columns.m_col_name];
diff --git a/glom/mode_design/layout/combobox_fields.cc b/glom/mode_design/layout/combobox_fields.cc
index 9599f22..121f603 100644
--- a/glom/mode_design/layout/combobox_fields.cc
+++ b/glom/mode_design/layout/combobox_fields.cc
@@ -88,7 +88,8 @@ void ComboBox_Fields::set_selected_field(const Glib::ustring& field_name)
//(An empty name means Select the parent table item.)
if(this_name == field_name)
{
- set_active(row);
+ const auto iter = row.get_iter();
+ set_active(iter);
return; //success
}
}
diff --git a/glom/mode_design/layout/combobox_relationship.cc
b/glom/mode_design/layout/combobox_relationship.cc
index 767f156..aa56e56 100644
--- a/glom/mode_design/layout/combobox_relationship.cc
+++ b/glom/mode_design/layout/combobox_relationship.cc
@@ -117,7 +117,8 @@ void ComboBox_Relationship::set_selected_relationship(const Glib::ustring& relat
{
if(related_relationship_name.empty())
{
- set_active(row);
+ const auto iter = row.get_iter();
+ set_active(iter);
return; //success
}
else
@@ -128,7 +129,8 @@ void ComboBox_Relationship::set_selected_relationship(const Glib::ustring& relat
const auto rel_name = glom_get_sharedptr_name(sub_relationship);
if(rel_name == related_relationship_name)
{
- set_active(sub_row);
+ const auto iter = sub_row.get_iter();
+ set_active(iter);
return; //success
}
}
diff --git a/glom/mode_design/layout/dialog_choose_relationship.cc
b/glom/mode_design/layout/dialog_choose_relationship.cc
index 2a4ab5b..0a2c042 100644
--- a/glom/mode_design/layout/dialog_choose_relationship.cc
+++ b/glom/mode_design/layout/dialog_choose_relationship.cc
@@ -103,7 +103,8 @@ void Dialog_ChooseRelationship::select_item(const std::shared_ptr<const Relation
if(glom_get_sharedptr_name(relationship_item) == relationship_name)
{
//Select the item:
- refTreeSelection->select(row);
+ const auto iter = row.get_iter();
+ refTreeSelection->select(iter);
}
}
}
diff --git a/glom/mode_design/layout/dialog_layout_details.cc
b/glom/mode_design/layout/dialog_layout_details.cc
index 131042d..3906b55 100644
--- a/glom/mode_design/layout/dialog_layout_details.cc
+++ b/glom/mode_design/layout/dialog_layout_details.cc
@@ -245,7 +245,7 @@ void Dialog_Layout_Details::fill_group(const Gtk::TreeModel::iterator& iter, std
{
//Recurse:
auto group_child = glom_sharedptr_clone(layout_group);
- fill_group(rowChild, group_child);
+ fill_group(rowChild.get_iter(), group_child);
group->add_item(group_child);
}
else if(layout_item)
@@ -1070,7 +1070,7 @@ void Dialog_Layout_Details::save_to_document()
group = std::make_shared<LayoutGroup>();
}
- fill_group(row, group);
+ fill_group(row.get_iter(), group);
list_groups.emplace_back(group);
}
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 7347ba0..f0fa315 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -250,7 +250,7 @@ void Box_Formatting::set_formatting_for_non_field(const Formatting& format, bool
{
if(row[m_columns_alignment.m_col_alignment] == alignment)
{
- m_combo_format_text_horizontal_alignment->set_active(row);
+ m_combo_format_text_horizontal_alignment->set_active(row.get_iter());
break;
}
}
diff --git a/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
b/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
index e71eff9..62022ea 100644
--- a/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc
@@ -56,7 +56,7 @@ void Combo_SummaryType::set_summary_type(LayoutItem_FieldSummary::summaryType su
if(this_value == summary_type)
{
- set_active(row);
+ set_active(row.get_iter());
return; //success
}
}
diff --git a/glom/mode_design/report_layout/dialog_layout_report.cc
b/glom/mode_design/report_layout/dialog_layout_report.cc
index 08253b8..ae84502 100644
--- a/glom/mode_design/report_layout/dialog_layout_report.cc
+++ b/glom/mode_design/report_layout/dialog_layout_report.cc
@@ -264,7 +264,7 @@ void Dialog_Layout_Report::fill_group_children(const std::shared_ptr<LayoutGroup
//Recurse:
auto child_group = std::dynamic_pointer_cast<LayoutGroup>(item);
if(child_group)
- fill_group_children(child_group, child_row, model);
+ fill_group_children(child_group, child_row.get_iter(), model);
//std::cout << "debug: " << G_STRFUNC << ": Adding group child: parent part type=" <<
group->get_part_type_name() << ", child part type=" << item->get_part_type_name() << std::endl;
group->add_item(item);
@@ -1047,7 +1047,7 @@ void Dialog_Layout_Report::fill_report_parts(std::shared_ptr<LayoutGroup>& group
for(const auto& row : parts_model->children())
{
//Recurse into a group if necessary:
- auto group_child = fill_group(row, parts_model);
+ auto group_child = fill_group(row.get_iter(), parts_model);
if(group_child)
{
//Add the group:
diff --git a/glom/mode_design/translation/combobox_locale.cc b/glom/mode_design/translation/combobox_locale.cc
index 1f63ec4..26e59fe 100644
--- a/glom/mode_design/translation/combobox_locale.cc
+++ b/glom/mode_design/translation/combobox_locale.cc
@@ -79,7 +79,7 @@ void ComboBox_Locale::set_selected_locale(const Glib::ustring& locale)
if(this_text == locale)
{
- set_active(row);
+ set_active(row.get_iter());
return; //success
}
}
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 54e051c..99bd86c 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -389,7 +389,7 @@ void Box_Tables::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint co
auto model = m_AddDel.get_model();
for(const auto& child_row : model->children())
{
- m_AddDel.set_value(child_row, m_col_default, false);
+ m_AddDel.set_value(child_row.get_iter(), m_col_default, false);
}
}
@@ -487,15 +487,16 @@ void Box_Tables::save_to_document()
auto table_info = document->get_table(table_name); //Start with the existing table_info, to preserve
extra information, such as translations.
if(table_info)
{
- table_info->set_name( m_AddDel.get_value(row, m_col_table_name) );
+ const auto iter = row.get_iter();
+ table_info->set_name( m_AddDel.get_value(iter, m_col_table_name) );
if(!table_info->get_name().empty())
{
- table_info->set_hidden( m_AddDel.get_value_as_bool(row, m_col_hidden) );
- table_info->set_title( m_AddDel.get_value(row, m_col_title) , AppWindow::get_current_locale());
//TODO_Translations: Store the TableInfo in the TreeView.
- table_info->set_title_singular( m_AddDel.get_value(row, m_col_title_singular),
AppWindow::get_current_locale()); //TODO_Translations: Store the TableInfo in the TreeView.
+ table_info->set_hidden( m_AddDel.get_value_as_bool(iter, m_col_hidden) );
+ table_info->set_title( m_AddDel.get_value(iter, m_col_title) , AppWindow::get_current_locale());
//TODO_Translations: Store the TableInfo in the TreeView.
+ table_info->set_title_singular( m_AddDel.get_value(iter, m_col_title_singular),
AppWindow::get_current_locale()); //TODO_Translations: Store the TableInfo in the TreeView.
//std::cout << "debug: " << G_STRFUNC << ": title=" << item_get_title(table_info) << std::endl;
- table_info->set_default( m_AddDel.get_value_as_bool(row, m_col_default) );
+ table_info->set_default( m_AddDel.get_value_as_bool(iter, m_col_default) );
listTables.emplace_back(table_info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]