[Commits] [SCM] claws branch, quota-info, updated. 4.3.1-54-ga66e83e53
miras at claws-mail.org
miras at claws-mail.org
Mon Mar 10 20:14:51 UTC 2025
The branch, quota-info has been updated
via a66e83e53b2dd95f3e5939b347e55e1c4653a44f (commit)
from 8bff079251fe972bed1cb0b6de6c241912589b44 (commit)
Summary of changes:
src/summaryview.c | 45 ++++++++++++++++++++++++++++++---------------
1 file changed, 30 insertions(+), 15 deletions(-)
- Log -----------------------------------------------------------------
commit a66e83e53b2dd95f3e5939b347e55e1c4653a44f
Author: Michael Rasmussen <mir at datanom.net>
Date: Mon Mar 10 21:14:40 2025 +0100
Fix 1 and 2 on TODO list. Input required to fix 3
Signed-off-by: Michael Rasmussen <mir at datanom.net>
diff --git a/src/summaryview.c b/src/summaryview.c
index 6d377a8e5..0dca26a99 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2645,8 +2645,6 @@ static void summary_status_show(SummaryView *summaryview)
MsgInfo *msginfo;
gchar *name;
gchar *tooltip;
-// uint32_t size = 0;
-// uint32_t limit = 0;
guint size = 0;
guint limit = 0;
gint has_quota = 1;
@@ -2752,11 +2750,18 @@ static void summary_status_show(SummaryView *summaryview)
}
Folder* folder = summaryview->folder_item->folder;
- int err = imap_folder_quotaroot(FOLDER(folder), &size, &limit);
- if (err > 0) {
- has_quota = 0;
- debug_print("%s: Error getting quota status\n", FOLDER(folder)->name);
- }
+ if (folder && FOLDER_TYPE(folder) == F_IMAP) {
+ int err = imap_folder_quotaroot(FOLDER(folder), &size, &limit);
+ if (err > 0) {
+ has_quota = 0;
+ debug_print("%s: Error getting quota status\n", FOLDER(folder)->name);
+ } else {
+ debug_print("Size: %lu - Limit: %lu\n", size, limit);
+ has_quota = 1;
+ }
+ } else {
+ has_quota = 0;
+ }
if (prefs_common.layout_mode != SMALL_LAYOUT) {
str = g_strconcat(n_selected ? itos(n_selected) : "",
@@ -2771,15 +2776,15 @@ static void summary_status_show(SummaryView *summaryview)
g_free(str);
if (has_quota) {
- str = g_strdup_printf(_("%d new, %d unread, %d total (%s) [used: %d%%]"),
+ str = g_strdup_printf(_("%d new, %d unread, %d total (%s) [used: %d%%]"),
n_new, n_unread, n_total,
to_human_readable((goffset)n_size),
(size*100)/limit);
- } else {
- str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
- n_new, n_unread, n_total,
- to_human_readable((goffset)n_size));
- }
+ } else {
+ str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
+ n_new, n_unread, n_total,
+ to_human_readable((goffset)n_size));
+ }
g_signal_connect(G_OBJECT(summaryview->popupmenu), "selection-done",
G_CALLBACK(popup_menu_selection_done), summaryview);
@@ -2849,13 +2854,23 @@ static void summary_status_show(SummaryView *summaryview)
if (n_selected) {
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"),
+ if (has_quota) {
+ str = g_strdup_printf(_("%d/%d selected (%s/%s), %d unread [used: %d%%]"),
+ n_selected, n_total, ssize, tsize, n_unread, (size*100)/limit);
+ } else {
+ 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)"),
+ if (has_quota) {
+ str = g_strdup_printf(_("%d new, %d unread, %d total (%s) [used: %d%%]"),
+ n_new, n_unread, n_total, to_human_readable((goffset)n_size), (size*100)/limit);
+ } else {
+ str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
n_new, n_unread, n_total, to_human_readable((goffset)n_size));
+ }
g_free(sel);
g_free(del);
g_free(mv);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list