[glom/glom-1-8] Pass some sharedptr&s as const.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glom/glom-1-8] Pass some sharedptr&s as const.
- Date: Thu, 28 May 2009 11:54:37 -0400 (EDT)
commit c57f737a57ac790504be6791b80a66edf9a23b08
Author: Murray Cumming <murrayc murrayc com>
Date: Thu May 28 17:48:51 2009 +0200
Pass some sharedptr&s as const.
* glom/utility_widgets/flowtable_dnd.h: on_dnd_add_layout_item()
* glom/mode_data/flowtablewithfields.[h|cc]: on_dnd_add_layout_item(),
on_entry_edited(), on_entry_open_details_requested(),
on_dnd_add_layout_item(): Pass the sharedptr& as const.
---
ChangeLog | 10 ++++++++++
glom/mode_data/flowtablewithfields.cc | 19 ++++++++-----------
glom/mode_data/flowtablewithfields.h | 23 +++++++++++------------
glom/utility_widgets/flowtable_dnd.h | 4 +---
4 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ca9abe2..b7e04bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+
+2009-05-07 Murray Cumming <murrayc murrayc com>
+
+ Pass some sharedptr&s as const.
+
+ * glom/utility_widgets/flowtable_dnd.h: on_dnd_add_layout_item()
+ * glom/mode_data/flowtablewithfields.[h|cc]: on_dnd_add_layout_item(),
+ on_entry_edited(), on_entry_open_details_requested(),
+ on_dnd_add_layout_item(): Pass the sharedptr& as const.
+
1.8.8:
2009-04-14 Murray Cumming <murrayc murrayc com>
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 742037a..4fe2fcc 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -989,12 +989,12 @@ void FlowTableWithFields::on_script_button_clicked(const sharedptr< LayoutItem_B
m_signal_script_button_clicked.emit(layout_item);
}
-void FlowTableWithFields::on_entry_edited(const Gnome::Gda::Value& value, sharedptr<const LayoutItem_Field> field)
+void FlowTableWithFields::on_entry_edited(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field)
{
m_signal_field_edited.emit(field, value);
}
-void FlowTableWithFields::on_entry_open_details_requested(const Gnome::Gda::Value& value, sharedptr<const LayoutItem_Field> field)
+void FlowTableWithFields::on_entry_open_details_requested(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field)
{
m_signal_field_open_details_requested.emit(field, value);
}
@@ -1195,7 +1195,7 @@ void FlowTableWithFields::on_dnd_add_layout_item_field(LayoutWidgetBase* above)
return;
}
sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(layout_item_field);
- dnd_add_to_layout_group (item, above);
+ dnd_add_to_layout_group(item, above);
//Tell the parent to tell the document to save the layout
signal_layout_changed().emit();
@@ -1212,7 +1212,7 @@ void FlowTableWithFields::on_dnd_add_layout_notebook (LayoutWidgetBase* above)
group->set_name (_("Group"));
notebook->m_list_items.push_back(group);
- dnd_add_to_layout_group (item, above);
+ dnd_add_to_layout_group(item, above);
//Tell the parent to tell the document to save the layout
signal_layout_changed().emit();
@@ -1284,8 +1284,7 @@ void FlowTableWithFields::on_dnd_add_layout_item_image(LayoutWidgetBase* above)
signal_layout_changed().emit();
}
-void FlowTableWithFields::on_dnd_add_layout_item (LayoutWidgetBase* above,
- sharedptr<LayoutItem>& item)
+void FlowTableWithFields::on_dnd_add_layout_item(LayoutWidgetBase* above, const sharedptr<LayoutItem>& item)
{
dnd_add_to_layout_group (item, above);
@@ -1307,8 +1306,8 @@ void FlowTableWithFields::on_dnd_add_placeholder(LayoutWidgetBase* above)
above);
sharedptr<LayoutItem_Placeholder> placeholder_field(new LayoutItem_Placeholder);
sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(placeholder_field);
- add_layout_item_at_position (placeholder_field, cur_widget);
- dnd_add_to_layout_group (item, above, true /* ignore error*/);
+ add_layout_item_at_position(placeholder_field, cur_widget);
+ dnd_add_to_layout_group(item, above, true /* ignore error*/);
}
void FlowTableWithFields::on_dnd_remove_placeholder()
@@ -1345,9 +1344,7 @@ void FlowTableWithFields::dnd_notify_failed_drop()
dialog.run();
}
-bool FlowTableWithFields::dnd_add_to_layout_group (sharedptr<LayoutItem>& item,
- LayoutWidgetBase* layoutwidget,
- bool ignore_error)
+bool FlowTableWithFields::dnd_add_to_layout_group(const sharedptr<LayoutItem>& item, LayoutWidgetBase* layoutwidget, bool ignore_error)
{
//Get the layout group that the "above" widget's layout item is in:
sharedptr<LayoutGroup> layout_group = get_layout_group();
diff --git a/glom/mode_data/flowtablewithfields.h b/glom/mode_data/flowtablewithfields.h
index 7faa969..d59df23 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -148,8 +148,8 @@ protected:
//int get_suitable_width(Field::glom_field_type field_type);
- void on_entry_edited(const Gnome::Gda::Value& value, sharedptr<const LayoutItem_Field> field);
- void on_entry_open_details_requested(const Gnome::Gda::Value& value, sharedptr<const LayoutItem_Field> field);
+ void on_entry_edited(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field);
+ void on_entry_open_details_requested(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field);
void on_flowtable_entry_edited(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
void on_flowtable_entry_open_details_requested(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
void on_flowtable_related_record_changed(const Glib::ustring& relationship_name);
@@ -213,19 +213,18 @@ protected:
// Methods for the different layout object
virtual void on_dnd_add_layout_item_field (LayoutWidgetBase* above);
virtual void on_dnd_add_layout_group(LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_item_button (LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_item_text (LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_item_image (LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_notebook (LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_portal (LayoutWidgetBase* above);
- virtual void on_dnd_add_layout_item (LayoutWidgetBase* above,
- sharedptr<LayoutItem>& item);
+
+ virtual void on_dnd_add_layout_item_button(LayoutWidgetBase* above);
+ virtual void on_dnd_add_layout_item_text(LayoutWidgetBase* above);
+ virtual void on_dnd_add_layout_item_image(LayoutWidgetBase* above);
+ virtual void on_dnd_add_layout_notebook(LayoutWidgetBase* above);
+ virtual void on_dnd_add_layout_portal(LayoutWidgetBase* above);
+ virtual void on_dnd_add_layout_item(LayoutWidgetBase* above, const sharedptr<LayoutItem>& item);
+
sharedptr<LayoutItem_Portal> get_portal_relationship ();
void dnd_notify_failed_drop();
- bool dnd_add_to_layout_group (sharedptr<LayoutItem>& item,
- LayoutWidgetBase* layoutwidget,
- bool ignore_error = false);
+ bool dnd_add_to_layout_group(const sharedptr<LayoutItem>& item, LayoutWidgetBase* layoutwidget, bool ignore_error = false);
#endif // !GLOM_ENABLE_CLIENT_ONLY
diff --git a/glom/utility_widgets/flowtable_dnd.h b/glom/utility_widgets/flowtable_dnd.h
index 9a825d6..f55249a 100644
--- a/glom/utility_widgets/flowtable_dnd.h
+++ b/glom/utility_widgets/flowtable_dnd.h
@@ -69,9 +69,7 @@ protected:
virtual void on_dnd_add_layout_item_image(LayoutWidgetBase* above) = 0;
virtual void on_dnd_add_layout_notebook(LayoutWidgetBase* above) = 0;
virtual void on_dnd_add_layout_portal(LayoutWidgetBase* above) = 0;
- virtual void on_dnd_add_layout_item(LayoutWidgetBase* above,
- sharedptr<LayoutItem>& item) = 0;
-
+ virtual void on_dnd_add_layout_item(LayoutWidgetBase* above, const sharedptr<LayoutItem>& item) = 0;
virtual void on_dnd_add_placeholder(LayoutWidgetBase* above) = 0;
virtual void on_dnd_remove_placeholder() = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]