* fix some small issues
This commit is contained in:
@ -228,7 +228,7 @@ mu_msg_field_id_from_name (const char* str, gboolean err)
|
|||||||
g_return_val_if_fail (str, MU_MSG_FIELD_ID_NONE);
|
g_return_val_if_fail (str, MU_MSG_FIELD_ID_NONE);
|
||||||
|
|
||||||
for (i = 0; i != G_N_ELEMENTS(FIELD_DATA); ++i)
|
for (i = 0; i != G_N_ELEMENTS(FIELD_DATA); ++i)
|
||||||
if (strcmp(str, FIELD_DATA[i]._name) == 0)
|
if (g_strcmp0(str, FIELD_DATA[i]._name) == 0)
|
||||||
return FIELD_DATA[i]._id;
|
return FIELD_DATA[i]._id;
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
|
|||||||
@ -33,11 +33,10 @@
|
|||||||
#include "mu-maildir.h"
|
#include "mu-maildir.h"
|
||||||
#include "mu-msg-priv.h"
|
#include "mu-msg-priv.h"
|
||||||
|
|
||||||
static gboolean init_file_metadata (MuMsgFile *self, const char* path, const char *mdir,
|
static gboolean init_file_metadata (MuMsgFile *self, const char* path,
|
||||||
GError **err);
|
const char *mdir, GError **err);
|
||||||
static gboolean init_mime_msg (MuMsgFile *msg, GError **err);
|
static gboolean init_mime_msg (MuMsgFile *msg, GError **err);
|
||||||
|
|
||||||
|
|
||||||
#define CACHE(MFID) (self->_str_cache[(MFID)])
|
#define CACHE(MFID) (self->_str_cache[(MFID)])
|
||||||
#define SET_CACHE(MFID,V)(self->_str_cache[(MFID)]=(V))
|
#define SET_CACHE(MFID,V)(self->_str_cache[(MFID)]=(V))
|
||||||
|
|
||||||
@ -50,6 +49,9 @@ mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
|
|||||||
g_return_val_if_fail (filepath, NULL);
|
g_return_val_if_fail (filepath, NULL);
|
||||||
self = g_slice_new0 (MuMsgFile);
|
self = g_slice_new0 (MuMsgFile);
|
||||||
|
|
||||||
|
for (i = 0; i != MU_MSG_FIELD_ID_NUM; ++i)
|
||||||
|
SET_CACHE(i,NULL);
|
||||||
|
|
||||||
if (!init_file_metadata (self, filepath, mdir, err)) {
|
if (!init_file_metadata (self, filepath, mdir, err)) {
|
||||||
mu_msg_file_destroy (self);
|
mu_msg_file_destroy (self);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -60,9 +62,6 @@ mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i != MU_MSG_FIELD_ID_NUM; ++i)
|
|
||||||
SET_CACHE(i,NULL);
|
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user