aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-07-11 06:45:46 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-07-11 06:45:46 +0000
commit4acd459c3cd42a7cbde6f884cee2720537183452 (patch)
tree4b17b77d682a89889f912a9ad63355536a40acce /libsylph
parent55dac1ad8c46dd9911566a4e46db1d67da0f8da7 (diff)
code cleanup.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1854 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/folder.c18
-rw-r--r--libsylph/folder.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/libsylph/folder.c b/libsylph/folder.c
index 6527c848..0649ca21 100644
--- a/libsylph/folder.c
+++ b/libsylph/folder.c
@@ -728,6 +728,24 @@ FolderItem *folder_find_item_from_identifier(const gchar *identifier)
return d[1];
}
+FolderItem *folder_find_item_and_num_from_id(const gchar *identifier, gint *num)
+{
+ gchar *id;
+ gchar *msg;
+ FolderItem *item;
+
+ g_return_val_if_fail(identifier != NULL, NULL);
+
+ id = g_path_get_dirname(identifier);
+ msg = g_path_get_basename(identifier);
+ item = folder_find_item_from_identifier(id);
+ *num = to_number(msg);
+ g_free(msg);
+ g_free(id);
+
+ return item;
+}
+
Folder *folder_get_default_folder(void)
{
return folder_list ? FOLDER(folder_list->data) : NULL;
diff --git a/libsylph/folder.h b/libsylph/folder.h
index 96107261..38907551 100644
--- a/libsylph/folder.h
+++ b/libsylph/folder.h
@@ -352,6 +352,8 @@ FolderItem *folder_find_child_item_by_name (FolderItem *item,
gchar *folder_get_identifier (Folder *folder);
gchar *folder_item_get_identifier (FolderItem *item);
FolderItem *folder_find_item_from_identifier (const gchar *identifier);
+FolderItem *folder_find_item_and_num_from_id (const gchar *identifier,
+ gint *num);
Folder *folder_get_default_folder (void);
FolderItem *folder_get_default_inbox (void);