[gtkmm] Gtk::TreePath::get_from_selection_data(): const TreeModel
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk::TreePath::get_from_selection_data(): const TreeModel
- Date: Wed, 8 Mar 2017 08:35:24 +0000 (UTC)
commit 809e21c8ada93ef2f02526473619ae857823f436
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Wed Mar 8 09:32:28 2017 +0100
Gtk::TreePath::get_from_selection_data(): const TreeModel
The Glib::RefPtr<const Gtk::TreeModel> is an output parameter that gets a
reference to a TreeModel (a GtkTreeModel) in the const Gtk::SelectionData
input parameter. The TreeModel shall also be const.
Mark output parameters in Doxygen comments in treepath.hg.
gtk/src/treepath.ccg | 6 ++++--
gtk/src/treepath.hg | 26 ++++++++++++--------------
2 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/gtk/src/treepath.ccg b/gtk/src/treepath.ccg
index 4951df3..1748772 100644
--- a/gtk/src/treepath.ccg
+++ b/gtk/src/treepath.ccg
@@ -119,7 +119,8 @@ TreePath::const_iterator TreePath::end() const
return gtk_tree_path_get_indices(gobject_) + gtk_tree_path_get_depth(gobject_);
}
-bool TreePath::get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<TreeModel>& model,
TreePath& path) //static
+//static
+bool TreePath::get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<const TreeModel>&
model, TreePath& path)
{
GtkTreeModel* src_model = nullptr;
GtkTreePath* src_path = nullptr;
@@ -133,7 +134,8 @@ bool TreePath::get_from_selection_data(const SelectionData& selection_data, Glib
return result;
}
-bool TreePath::get_from_selection_data(const SelectionData& selection_data, TreePath& path) //static
+//static
+bool TreePath::get_from_selection_data(const SelectionData& selection_data, TreePath& path)
{
GtkTreePath* src_path = nullptr;
gboolean result = gtk_tree_get_row_drag_data(const_cast<GtkSelectionData*>(selection_data.gobj()),
nullptr, &src_path);
diff --git a/gtk/src/treepath.hg b/gtk/src/treepath.hg
index 05e0448..0f02a5f 100644
--- a/gtk/src/treepath.hg
+++ b/gtk/src/treepath.hg
@@ -158,15 +158,13 @@ public:
* you can assume that selection data of type "GTK_TREE_MODEL_ROW" is
* from the current process.
*
- * @param selection_data a #SelectionData
- * @param model a Gtk::TreeModel
- * @param path a row in model
- *
- * @return true if the selection_data had target type "GTK_TREE_MODEL_ROW" and
- * is otherwise valid
- **/
- static bool get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<TreeModel>& model,
TreePath& path);
- //TODO: Add an override that takes a const TreeModel (and deprecate the current version).
+ * @param selection_data A SelectionData
+ * @param[out] model A Gtk::TreeModel
+ * @param[out] path A row in @a model
+ * @return <tt>true</tt> if the @a selection_data had target type GTK_TREE_MODEL_ROW
+ * and is otherwise valid.
+ */
+ static bool get_from_selection_data(const SelectionData& selection_data, Glib::RefPtr<const TreeModel>&
model, TreePath& path);
/// See description in the other overload.
static bool get_from_selection_data(const SelectionData& selection_data, TreePath& path);
@@ -175,11 +173,11 @@ public:
* Sets selection data of target type "GTK_TREE_MODEL_ROW". Normally used
* in a drag_data_get signal handler.
*
- * @param selection_data some #SelectionData
- * @param model: a Gtk::TreeModel
- *
- * @return true if the selection_data had the proper target type to allow us to set a tree row
- **/
+ * @param[in,out] selection_data Some SelectionData
+ * @param model A Gtk::TreeModel
+ * @return <tt>true</tt> if the @a selection_data had the proper target type
+ * to allow us to set a tree row.
+ */
bool set_in_selection_data(SelectionData& selection_data, const Glib::RefPtr<const TreeModel>& model)
const;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]