Предупреждение кода Vala о том, что функция ожидает неконстантный аргумент, но ей присваивается постоянное значение.
Код Vala:
Gtk.TreeSelection treeSelection = treeview.get_selection();
Gtk.TreeModel treeModel = treeview.get_model();
List<Gtk.TreePath> treePaths = treeSelection.get_selected_rows(out treeModel);
Gtk.TreeIter treeIter;
List<Gtk.TreeRowReference> treeRowRefs = new List<Gtk.TreeRowReference>();
foreach (unowned Gtk.TreePath treePath in treePaths) {
treeRowRefs.append(new Gtk.TreeRowReference(treeModel, treePath));
}
foreach (unowned Gtk.TreeRowReference treeRowRef in treeRowRefs) {
if (treeModel.get_iter(out treeIter, treeRowRef.get_path())) {
fileListStore.remove(treeIter);
}
}
Предупреждение компилятора Vala:
warning: passing argument 1 of ‘gtk_tree_row_reference_get_path’ discards ‘const’ qualifier from pointer target type [enabled by default]
_tmp17_ = gtk_tree_row_reference_get_path (_tmp16_);
In file included from /usr/include/gtk-3.0/gtk/gtkcombobox.h:26:0,
from /usr/include/gtk-3.0/gtk/gtkappchooserbutton.h:29,
from /usr/include/gtk-3.0/gtk/gtk.h:42,
from /home/user/syswrite/syswrite.vala.c:9:
/usr/include/gtk-3.0/gtk/gtktreemodel.h:267:22: note: expected ‘struct GtkTreeRowReference *’ but argument is of type ‘const struct GtkTreeRowReference *’
GtkTreePath *gtk_tree_row_reference_get_path (GtkTreeRowReference *reference);
Как побороть это предупреждение?