return account;
}
+/*
+ * It's probably better to use a query to get the folders that match
+ * new_name but currently tinymail only provides a match by name using
+ * regular expressions and we want an exact matching. We're not using
+ * a regular expression for the exact name because we'd need first to
+ * escape @new_name and it's not easy sometimes.
+ *
+ * The code that uses the query is available in revision 3152.
+ */
gboolean
-modest_tny_folder_same_subfolder (TnyFolderStore *parent,
- const gchar *new_name)
+modest_tny_folder_has_subfolder_with_name (TnyFolderStore *parent,
+ const gchar *new_name)
{
TnyList *subfolders = NULL;
TnyIterator *iter = NULL;
TnyFolder *folder = NULL;
GError *err = NULL;
- const gchar *name = NULL;
gboolean same_subfolder = FALSE;
g_return_val_if_fail (TNY_IS_FOLDER_STORE (parent), FALSE);
/* Check names */
iter = tny_list_create_iterator (subfolders);
while (!tny_iterator_is_done (iter) && !same_subfolder) {
+ const gchar *name = NULL;
+
folder = TNY_FOLDER(tny_iterator_get_current (iter));
name = tny_folder_get_name (folder);