[Github-comments] [geany/geany] gtk_tree_model_get failed at begining loop (#2278)
duanwujie
notifications at xxxxx
Wed Aug 28 02:04:23 UTC 2019
This will be failed in first loop, **how to get first TAG ?**
**gtk_tree_model_get(model, &iter, SYMBOLS_COLUMN_TAG, &tag, -1);**
```
static void on_update_all_index(GtkWidget *widget, gpointer user_data)
{
GtkTreeIter iter;
GeanyDocument * doc = document_get_current();
gboolean cont = TRUE;
gint line_num;
gint index_chr = 0;
GtkTreeStore * store = doc->priv->tag_store;
GtkTreeModel *model = GTK_TREE_MODEL(store);
unsigned int * seg = 0;
int count = 0;
if (!gtk_tree_model_get_iter_first(model, &iter)){
return;
}
do
{
TMTag * tag;
gtk_tree_model_get(model, &iter, SYMBOLS_COLUMN_TAG, &tag, -1);
if(!tag){
cont = ui_tree_model_iter_any_next(model, &iter, TRUE);
}else{
line_num = tag->line;
#if 1
if(line_num >= 0){
index_chr++;
//editor_udpate_chapter_index_quickly(doc->editor,index_chr,line_num);
}
#endif
tm_tag_unref(tag);
}
}
while (gtk_tree_model_iter_next(model, &iter));
}
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/2278
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190827/6a0a319c/attachment.html>
More information about the Github-comments
mailing list