Permalink
Browse files

Use g_str_has_prefix instead of g_strrstr to filter out automatic dar…

…ktable|* tags
  • Loading branch information...
1 parent 4869f10 commit 84afaca627a4a73154a4ad2f9b17aaf138d4ac32 @jcsogo jcsogo committed Apr 8, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/common/tags.c
View
@@ -307,7 +307,7 @@ gchar* dt_tag_get_list(gint imgid, gchar *separator)
value = g_strdup(t->tag);
gchar *pch;
- if (g_strrstr(value, "|") && !g_strrstr(value, "darktable|"))
+ if (g_strrstr(value, "|") && !g_str_has_prefix(value, "darktable|"))
{
pch = strtok(value, "|");
@@ -317,7 +317,7 @@ gchar* dt_tag_get_list(gint imgid, gchar *separator)
pch = strtok(NULL, "|");
}
}
- else if (!g_strrstr(value, "darktable|"))
+ else if (!g_str_has_prefix(value, "darktable|"))
tags = g_list_prepend(tags, g_strdup(value));
g_free (t);
}
@@ -349,7 +349,7 @@ gchar *dt_tag_get_hierarchical(gint imgid, gchar *separator)
value = g_strdup(t->tag);
/* Only return hierarchical tags */
- if (g_strrstr(value, "|") && !g_strrstr(value, "darktable"))
+ if (g_strrstr(value, "|") && !g_str_has_prefix(value, "darktable|"))
tags = g_list_prepend(tags, value);
g_free (t);

0 comments on commit 84afaca

Please sign in to comment.