[glom/glom-1-10] Pass some sharedptr&s as const.
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [glom/glom-1-10] Pass some sharedptr&s as const.
- Date: Mon, 1 Jun 2009 05:03:40 -0400 (EDT)
commit d9a830ecb0fe5de4669699e4951a9225e141adcb
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 | 12 +++++++-----
glom/mode_data/flowtablewithfields.cc | 19 ++++++++-----------
glom/mode_data/flowtablewithfields.h | 23 +++++++++++------------
glom/utility_widgets/flowtable_dnd.h | 4 +---
4 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5481028..3535690 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,11 @@
-2009-02-24 Murray Cumming <murrayc murrayc com>
+2009-05-07 Murray Cumming <murrayc murrayc com>
- * glom/utility_widgets/flowtable.cc: on_size_allocate(): Change an
- accidental += to the = that it should be, to stop columns getting
- increasingly large amounts of extra width when there are >2 columns.
- Bug #539369 (maximiliano)
+ 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.
2009-04-02 Armin Burgmeier <armin openismus com>
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 6a11c49..9cbf18a 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()
@@ -1347,9 +1346,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 0339fcb..fe82708 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -148,8 +148,8 @@ private:
//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 @@ private:
// 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 250864e..3509df5 100644
--- a/glom/utility_widgets/flowtable_dnd.h
+++ b/glom/utility_widgets/flowtable_dnd.h
@@ -71,9 +71,7 @@ private:
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]