+2008-05-28 [colin] 3.4.0cvs71
+
+ * src/compose.c
+ * src/compose.h
+ * src/grouplistdialog.c
+ * src/image_viewer.c
+ * src/imap.c
+ * src/inc.c
+ * src/main.c
+ * src/matcher.c
+ * src/messageview.c
+ * src/mimeview.c
+ * src/prefs_themes.c
+ * src/procmsg.h
+ * src/summaryview.c
+ * src/summaryview.h
+ * src/textview.c
+ * src/common/smtp.c
+ * src/common/utils.c
+ * src/common/utils.h
+ Use goffset instead of off_t for MsgInfo's size
+ Allows using MsgInfo structure from plugins
+ compiled with largefile support
+
2008-05-26 [colin] 3.4.0cvs70
* src/mainwindow.c
( cvs diff -u -r 1.20.2.61 -r 1.20.2.62 src/common/utils.h; ) > 3.4.0cvs68.patchset
( cvs diff -u -r 1.83.2.131 -r 1.83.2.132 src/mimeview.c; ) > 3.4.0cvs69.patchset
( cvs diff -u -r 1.274.2.244 -r 1.274.2.245 src/mainwindow.c; cvs diff -u -r 1.39.2.45 -r 1.39.2.46 src/mainwindow.h; cvs diff -u -r 1.14.2.62 -r 1.14.2.63 src/plugins/trayicon/trayicon.c; ) > 3.4.0cvs70.patchset
+( cvs diff -u -r 1.382.2.450 -r 1.382.2.451 src/compose.c; cvs diff -u -r 1.50.2.45 -r 1.50.2.46 src/compose.h; cvs diff -u -r 1.14.2.19 -r 1.14.2.20 src/grouplistdialog.c; cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/image_viewer.c; cvs diff -u -r 1.179.2.222 -r 1.179.2.223 src/imap.c; cvs diff -u -r 1.149.2.90 -r 1.149.2.91 src/inc.c; cvs diff -u -r 1.115.2.195 -r 1.115.2.196 src/main.c; cvs diff -u -r 1.75.2.59 -r 1.75.2.60 src/matcher.c; cvs diff -u -r 1.94.2.177 -r 1.94.2.178 src/messageview.c; cvs diff -u -r 1.83.2.132 -r 1.83.2.133 src/mimeview.c; cvs diff -u -r 1.3.2.56 -r 1.3.2.57 src/prefs_themes.c; cvs diff -u -r 1.60.2.52 -r 1.60.2.53 src/procmsg.h; cvs diff -u -r 1.395.2.369 -r 1.395.2.370 src/summaryview.c; cvs diff -u -r 1.68.2.46 -r 1.68.2.47 src/summaryview.h; cvs diff -u -r 1.96.2.201 -r 1.96.2.202 src/textview.c; cvs diff -u -r 1.11.2.23 -r 1.11.2.24 src/common/smtp.c; cvs diff -u -r 1.36.2.141 -r 1.36.2.142 src/common/utils.c; cvs diff -u -r 1.20.2.62 -r 1.20.2.63 src/common/utils.h; ) > 3.4.0cvs71.patchset
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=70
+EXTRA_VERSION=71
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
log_warning(LOG_PROTOCOL, _("Message is too big "
"(Maximum size is %s)\n"),
to_human_readable(
- (off_t)(smtp_session->max_message_size)));
+ (goffset)(smtp_session->max_message_size)));
smtp_session->state = SMTP_ERROR;
smtp_session->error_val = SM_ERROR;
return -1;
d = (d*100) >> divisor; \
}
-gchar *to_human_readable(size_t size)
+gchar *to_human_readable(goffset size)
{
static gchar str[14];
static gchar *b_format = NULL, *kb_format = NULL,
mb_format = _("%d.%02dMB");
gb_format = _("%.2fGB");
}
-
- if (size < (size_t)1024) {
+
+ if (size < (goffset)1024) {
g_snprintf(str, sizeof(str), b_format, (gint)size);
return str;
- } else if (size >> 10 < (size_t)1024) {
+ } else if (size >> 10 < (goffset)1024) {
divide(size, 10, t, r);
g_snprintf(str, sizeof(str), kb_format, t, r);
return str;
- } else if (size >> 20 < (size_t)1024) {
+ } else if (size >> 20 < (goffset)1024) {
divide(size, 20, t, r);
g_snprintf(str, sizeof(str), mb_format, t, r);
return str;
} else {
- g_snprintf(str, sizeof(str), gb_format, (gfloat)(size) / (1 << 30));
+ g_snprintf(str, sizeof(str), gb_format, (gfloat)(size >> 30));
return str;
}
}
#endif /* !GLIB_CHECK_VERSION */
-/* The AC_CHECK_SIZEOF() in configure fails for some machines.
- * we provide some fallback values here */
-#if !SIZEOF_UNSIGNED_SHORT
- #undef SIZEOF_UNSIGNED_SHORT
- #define SIZEOF_UNSIGNED_SHORT 2
-#endif
-#if !SIZEOF_UNSIGNED_INT
- #undef SIZEOF_UNSIGNED_INT
- #define SIZEOF_UNSIGNED_INT 4
-#endif
-#if !SIZEOF_UNSIGNED_LONG
- #undef SIZEOF_UNSIGNED_LONG
- #define SIZEOF_UNSIGNED_LONG 4
-#endif
-
#ifndef HAVE_U32_TYPEDEF
#undef u32 /* maybe there is a macro with this name */
typedef guint32 u32;
gchar *itos_buf (gchar *nstr,
gint n);
gchar *itos (gint n);
-gchar *to_human_readable (size_t size);
+gchar *to_human_readable (goffset size);
/* alternative string functions */
gint strcmp2 (const gchar *s1,
ainfo->content_type = g_strdup("application/octet-stream");
}
- ainfo->size = size;
- size_text = to_human_readable(size);
+ ainfo->size = (goffset)size;
+ size_text = to_human_readable((goffset)size);
store = GTK_LIST_STORE(gtk_tree_view_get_model
(GTK_TREE_VIEW(compose->attach_clist)));
ainfo->file = file;
}
if (size)
- ainfo->size = size;
+ ainfo->size = (goffset)size;
/* update tree store */
text = to_human_readable(ainfo->size);
procmsg_msginfo_free(compose->targetinfo);
compose->targetinfo = procmsg_msginfo_new();
compose->targetinfo->msgnum = msgnum;
- compose->targetinfo->size = s.st_size;
+ compose->targetinfo->size = (goffset)s.st_size;
compose->targetinfo->mtime = s.st_mtime;
compose->targetinfo->folder = draft;
if (target_locked)
gchar *content_type;
EncodingType encoding;
gchar *name;
- off_t size;
+ goffset size;
};
typedef enum
g_snprintf(buf, sizeof(buf),
_("%d newsgroups received (%s read)"),
- count, to_human_readable(read_bytes));
+ count, to_human_readable((goffset)read_bytes));
gtk_label_set_text(GTK_LABEL(status_label), buf);
GTK_EVENTS_FLUSH();
if (ack == FALSE)
gtk_label_set_text(GTK_LABEL(imageviewer->filename),
procmime_mimeinfo_get_parameter(mimeinfo, "name"));
- gtk_label_set_text(GTK_LABEL(imageviewer->filesize), to_human_readable(mimeinfo->length));
+ gtk_label_set_text(GTK_LABEL(imageviewer->filesize), to_human_readable((goffset)mimeinfo->length));
gtk_label_set_text(GTK_LABEL(imageviewer->content_type), mimeinfo->subtype);
gtk_label_set_text(GTK_LABEL(imageviewer->error_lbl), "");
gtk_label_set_text(GTK_LABEL(imageviewer->error_msg), "");
{
MsgInfo *msginfo = NULL;
guint32 uid = 0;
- size_t size = 0;
+ goffset size = 0;
MsgFlags flags = {0, 0};
if (info->headers == NULL)
flags.perm_flags = info->flags;
uid = info->uid;
- size = info->size;
+ size = (goffset) info->size;
msginfo = procheader_parse_str(info->headers, flags, FALSE, FALSE);
if (msginfo) {
"Done (%d messages (%s) received)",
pop3_session->cur_total_num),
pop3_session->cur_total_num,
- to_human_readable(pop3_session->cur_total_recv_bytes));
+ to_human_readable((goffset)pop3_session->cur_total_recv_bytes));
else
msg = g_strdup_printf(_("Done (no new messages)"));
SET_PIXMAP_AND_TEXT(okpix, msg);
if (pop3_session->state == POP3_RETR ||
pop3_session->state == POP3_RETR_RECV ||
pop3_session->state == POP3_DELETE) {
- Xstrdup_a(total_size_str, to_human_readable(total), return);
+ Xstrdup_a(total_size_str, to_human_readable((goffset)total), return);
g_snprintf(buf, sizeof(buf),
_("Retrieving message (%d / %d) (%s / %s)"),
pop3_session->cur_msg, pop3_session->count,
- to_human_readable(cur_total), total_size_str);
+ to_human_readable((goffset)cur_total), total_size_str);
progress_dialog_set_label(inc_dialog->dialog, buf);
}
pop3_session->cur_total_num),
pop3_session->cur_total_num,
to_human_readable
- (pop3_session->cur_total_recv_bytes));
+ ((goffset)pop3_session->cur_total_recv_bytes));
progress_dialog_list_set_status(inc_dialog->dialog,
inc_dialog->cur_row,
buf);
#include "news_gtk.h"
#include "matcher.h"
#include "tags.h"
+
#ifdef HAVE_LIBETPAN
#include "imap-thread.h"
#include "nntp-thread.h"
gint num_folder_class = 0;
gboolean asked_for_migration = FALSE;
gboolean start_done = TRUE;
-
- START_TIMING("startup");
+ START_TIMING("startup");
+
sc_starting = TRUE;
#ifdef G_OS_WIN32
}
case MATCHCRITERIA_SIZE_GREATER:
{
- /* FIXME: info->size is an off_t */
- gboolean ret = (info->size > (off_t) prop->value);
+ /* FIXME: info->size is a goffset */
+ gboolean ret = (info->size > (goffset) prop->value);
/* debug output */
if (debug_filtering_session
&& prefs_common.filtering_debug_level >= FILTERING_DEBUG_LEVEL_HIGH) {
if (ret) {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is greater than [ %d ]\n",
- info->size, prop->value);
+ "message size is greater than [ %d ]\n",
+ prop->value);
} else {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is not greater than [ %d ]\n",
- info->size, prop->value);
+ "message size is not greater than [ %d ]\n",
+ prop->value);
}
}
return ret;
}
case MATCHCRITERIA_SIZE_SMALLER:
{
- /* FIXME: info->size is an off_t */
- gboolean ret = (info->size < (off_t) prop->value);
+ /* FIXME: info->size is a goffset */
+ gboolean ret = (info->size < (goffset) prop->value);
/* debug output */
if (debug_filtering_session
&& prefs_common.filtering_debug_level >= FILTERING_DEBUG_LEVEL_HIGH) {
if (ret) {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is smaller than [ %d ]\n",
- info->size, prop->value);
+ "message size is smaller than [ %d ]\n",
+ prop->value);
} else {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is not smaller than [ %d ]\n",
- info->size, prop->value);
+ "message size is not smaller than [ %d ]\n",
+ prop->value);
}
}
return ret;
}
case MATCHCRITERIA_SIZE_EQUAL:
{
- /* FIXME: info->size is an off_t */
- gboolean ret = (info->size == (off_t) prop->value);
+ /* FIXME: info->size is a goffset */
+ gboolean ret = (info->size == (goffset) prop->value);
/* debug output */
if (debug_filtering_session
&& prefs_common.filtering_debug_level >= FILTERING_DEBUG_LEVEL_HIGH) {
if (ret) {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is equal to [ %d ]\n",
- info->size, prop->value);
+ "message size is equal to [ %d ]\n",
+ prop->value);
} else {
log_print(LOG_DEBUG_FILTERING,
- "message size [ %ld ] is not equal to [ %d ]\n",
- info->size, prop->value);
+ "message size is not equal to [ %d ]\n",
+ prop->value);
}
}
return ret;
}
case MATCHCRITERIA_PARTIAL:
{
- /* FIXME: info->size is an off_t */
- gboolean ret = (info->total_size != 0 && info->size != (off_t)info->total_size);
+ /* FIXME: info->size is a goffset */
+ gboolean ret = (info->total_size != 0 && info->size != (goffset)info->total_size);
/* debug output */
if (debug_filtering_session
&& prefs_common.filtering_debug_level >= FILTERING_DEBUG_LEVEL_HIGH) {
if (ret) {
log_print(LOG_DEBUG_FILTERING,
- "message is partially downloaded, size [ %ld ] is less than total size [ %d ])\n",
- info->size, info->total_size);
+ "message is partially downloaded, size is less than total size [ %d ])\n",
+ info->total_size);
} else {
log_print(LOG_DEBUG_FILTERING,
"message is not partially downloaded\n");
}
case MATCHCRITERIA_NOT_PARTIAL:
{
- /* FIXME: info->size is an off_t */
- gboolean ret = (info->total_size == 0 || info->size == (off_t)info->total_size);
+ /* FIXME: info->size is a goffset */
+ gboolean ret = (info->total_size == 0 || info->size == (goffset)info->total_size);
/* debug output */
if (debug_filtering_session
"message is not partially downloaded\n");
} else {
log_print(LOG_DEBUG_FILTERING,
- "message is partially downloaded, size [ %ld ] is less than total size [ %d ])\n",
- info->size, info->total_size);
+ "message is partially downloaded, size is less than total size [ %d ])\n",
+ info->total_size);
}
}
return ret;
void messageview_show_partial_display(MessageView *messageview, MsgInfo *msginfo,
size_t length)
{
- gchar *msg = g_strdup_printf(_("Show all %s."), to_human_readable(length));
+ gchar *msg = g_strdup_printf(_("Show all %s."), to_human_readable((goffset)length));
noticeview_set_icon(messageview->noticeview, STOCK_PIXMAP_NOTICE_WARN);
noticeview_set_text(messageview->noticeview, _("Only the first megabyte of text is shown."));
noticeview_set_button_text(messageview->noticeview, msg);
text = g_strdup_printf(_("This message has been "
"partially retrieved;\nit is %s."),
to_human_readable(
- (off_t)(msginfo->total_size)));
+ (goffset)(msginfo->total_size)));
button1 = _("Mark for download");
button2 = _("Mark for deletion");
button1_cb = partial_recv_dload_clicked;
"partially retrieved;\nit is %s and "
"will be downloaded."),
to_human_readable(
- (off_t)(msginfo->total_size)));
+ (goffset)(msginfo->total_size)));
button1 = _("Unmark");
button1_cb = partial_recv_unmark_clicked;
button2 = _("Mark for deletion");
"partially retrieved;\nit is %s and "
"will be deleted."),
to_human_readable(
- (off_t)(msginfo->total_size)));
+ (goffset)(msginfo->total_size)));
button1 = _("Mark for download");
button1_cb = partial_recv_dload_clicked;
button2 = _("Unmark");
}
str[COL_MIMETYPE] = content_type;
- str[COL_SIZE] = to_human_readable(partinfo->length);
+ str[COL_SIZE] = to_human_readable((goffset)partinfo->length);
if (prefs_common.attach_desc)
str[COL_NAME] = (gchar *) get_part_description(partinfo);
else
mimeinfo->subtype);
tip = g_strjoin("\n", content_type,
- to_human_readable(mimeinfo->length), NULL);
+ to_human_readable((goffset)mimeinfo->length), NULL);
g_free(content_type);
if (desc && *desc) {
gchar *tmp = NULL;
prefs_themes_foreach_file(dirname, prefs_themes_file_stats, dinfo);
stats = g_strdup_printf(_("%d files (%d icons), size: %s"),
- dinfo->files, dinfo->pixms, to_human_readable(dinfo->bytes));
+ dinfo->files, dinfo->pixms, to_human_readable((goffset)dinfo->bytes));
g_free(dinfo);
return stats;
guint refcnt;
guint msgnum;
- off_t size;
+ goffset size;
time_t mtime;
time_t date_t;
time_t thread_date;
GList *rowlist, *cur;
guint n_selected = 0, n_new = 0, n_unread = 0, n_total = 0;
guint n_marked = 0, n_replied = 0, n_forwarded = 0, n_locked = 0, n_ignored = 0, n_watched = 0;
- off_t sel_size = 0, n_size = 0;
+ goffset sel_size = 0, n_size = 0;
MsgInfo *msginfo;
gchar *name;
#if GTK_CHECK_VERSION(2, 12, 0)
spc = "";
if (n_selected) {
- sel = g_strdup_printf(" (%s)", to_human_readable(sel_size));
+ sel = g_strdup_printf(" (%s)", to_human_readable((goffset)sel_size));
if (n_selected == 1)
itstr = g_strdup(_(" item selected"));
else
str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
n_new, n_unread, n_total,
- to_human_readable(n_size));
+ to_human_readable((goffset)n_size));
gtk_label_set_text(GTK_LABEL(summaryview->statlabel_msgs), str);
"<b>Ignored:</b> %d\n"
"<b>Watched:</b> %d"),
n_new, n_unread, n_total,
- to_human_readable(n_size),
+ to_human_readable((goffset)n_size),
n_marked,n_replied,n_forwarded,
n_locked,n_ignored,n_watched);
} else {
gchar *ssize, *tsize;
if (n_selected) {
- ssize = g_strdup(to_human_readable(sel_size));
- tsize = g_strdup(to_human_readable(n_size));
+ ssize = g_strdup(to_human_readable((goffset)sel_size));
+ tsize = g_strdup(to_human_readable((goffset)n_size));
str = g_strdup_printf(_("%d/%d selected (%s/%s), %d unread"),
n_selected, n_total, ssize, tsize, n_unread);
g_free(ssize);
g_free(tsize);
} else
str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
- n_new, n_unread, n_total, to_human_readable(n_size));
+ n_new, n_unread, n_total, to_human_readable((goffset)n_size));
g_free(sel);
g_free(del);
g_free(mv);
GtkCTreeNode *row = GTK_CTREE_NODE(cur->data);
msginfo = gtk_ctree_node_get_row_data(ctree, row);
if (msginfo && msginfo->total_size != 0 &&
- msginfo->size != (off_t)msginfo->total_size)
+ msginfo->size != (goffset)msginfo->total_size)
partial_mark_for_delete(msginfo);
}
/* current message status */
gint unreadmarked;
- off_t total_size;
+ goffset total_size;
gint deleted;
gint moved;
gint copied;
TEXTVIEW_INSERT(" (");
TEXTVIEW_INSERT(content_type);
TEXTVIEW_INSERT(", ");
- TEXTVIEW_INSERT(to_human_readable(partinfo->length));
+ TEXTVIEW_INSERT(to_human_readable((goffset)partinfo->length));
TEXTVIEW_INSERT("):\n\n");
g_free(content_type);