[PATCH] alternate claws mark file
Jindrich Makovicka <[email protected]>
| Newsgroups | gmane.comp.gnome.apps.gkrellm |
|---|---|
| Message-ID | <20070703215116.30ea1373@holly> |
Hi, Claws-Mail 2.10.0 (formerly Sylpheed-Claws) renames the mark file from .sylpheed_mark to .claws_mark. The attached patch modifies the mail checker to look for both variants. Regards, -- Jindrich Makovicka _______________________________________________ Gkrellm mailing list [email protected] http://lists.jutley.org/cgi-bin/mailman/listinfo/gkrellm
claws.patch
(text/x-patch, 926 B)
--- gkrellm-2.2.10/src/mail.c.orig 2006-08-09 00:31:30.000000000 +0200
+++ gkrellm-2.2.10/src/mail.c 2007-07-03 21:00:00.000000000 +0200
@@ -1271,17 +1271,26 @@
static gboolean
sylpheed_mark_new_count(Mailbox *mbox)
{
- FILE *f;
+ FILE *f = NULL;
gchar *path;
gint msgnum, flags, ver, mark_files = 0;
+ static const gchar *mark_file_names[] = {
+ ".sylpheed_mark", ".claws_mark", NULL
+ };
+ const gchar **fname;
- path = g_strconcat(mbox->account->path, G_DIR_SEPARATOR_S,
- ".sylpheed_mark", NULL);
- f = fopen(path, "rb");
- g_free(path);
- if (!f)
- return FALSE;
+ for (fname = mark_file_names; *fname; fname++) {
+ path = g_strconcat(mbox->account->path, G_DIR_SEPARATOR_S,
+ *fname, NULL);
+ f = fopen(path, "rb");
+ g_free(path);
+ if (f)
+ break;
+ }
+ if (!f)
+ return FALSE;
+
if ( fread(&ver, sizeof(ver), 1, f) == 1
&& SYLPHEED_MARK_VERSION == ver
)