{
gchar* sqlcmd;
char* errmsg = NULL;
+ KatzeItem* old_parent;
gchar* parent;
gchar* uri;
else
uri = g_strdup ("");
- if (folder)
+ /* Use folder, otherwise fallback to parent folder */
+ old_parent = katze_item_get_parent (item);
+ if (folder && *folder)
parent = g_strdup (folder);
- else if (katze_item_get_name (katze_item_get_parent (item)))
- parent = g_strdup (katze_item_get_name (katze_item_get_parent (item)));
+ else if (old_parent && katze_item_get_name (old_parent))
+ parent = g_strdup (katze_item_get_name (old_parent));
else
parent = g_strdup ("");