]> granicus.if.org Git - mutt/commitdiff
Remove refresh parameter from mutt_enter_fname().
authorKevin McCarthy <kevin@8t8.us>
Sat, 1 Apr 2017 01:15:31 +0000 (18:15 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sat, 1 Apr 2017 01:15:31 +0000 (18:15 -0700)
Also remove it from mutt_save_message(), which used it to pass through
to mutt_enter_fname().  The callers of this already had redraw logic,
to which REDRAW_STATUS merely needed to be added.

commands.c
compose.c
curs_lib.c
curs_main.c
pager.c
protos.h

index f3fbc582b342c0d22f17c295b27d34b85de0d3bd..58b9c8d0611dbee3301c981a8b5c814721a9c9ad 100644 (file)
@@ -727,8 +727,7 @@ int _mutt_save_message (HEADER *h, CONTEXT *ctx, int delete, int decode, int dec
 }
 
 /* returns 0 if the copy/save was successful, or -1 on error/abort */
-int mutt_save_message (HEADER *h, int delete, 
-                      int decode, int decrypt, int *redraw)
+int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
 {
   int i, need_buffy_cleanup;
   int need_passphrase = 0, app=0;
@@ -736,9 +735,6 @@ int mutt_save_message (HEADER *h, int delete,
   CONTEXT ctx;
   struct stat st;
 
-  *redraw = 0;
-
-  
   snprintf (prompt, sizeof (prompt),
            decode  ? (delete ? _("Decode-save%s to mailbox") :
                       _("Decode-copy%s to mailbox")) :
@@ -786,17 +782,9 @@ int mutt_save_message (HEADER *h, int delete,
   }
 
   mutt_pretty_mailbox (buf, sizeof (buf));
-  if (mutt_enter_fname (prompt, buf, sizeof (buf), redraw, 0) == -1)
+  if (mutt_enter_fname (prompt, buf, sizeof (buf), 0) == -1)
     return (-1);
 
-  if (*redraw != REDRAW_FULL)
-  {
-    if (!h)
-      *redraw = REDRAW_INDEX | REDRAW_STATUS;
-    else
-      *redraw = REDRAW_STATUS;
-  }
-
   if (!buf[0])
     return (-1);
  
index 6bce097f37110edd432ece4686ffb29377374345..235bf1d0679ba1907bc7538f9310c36623818fdf 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -673,7 +673,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
          numfiles = 0;
          files = NULL;
 
-         if (_mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw, 0, 1, &files, &numfiles) == -1 ||
+         if (_mutt_enter_fname (prompt, fname, sizeof (fname), 0, 1, &files, &numfiles) == -1 ||
              *fname == '\0')
            break;
 
@@ -724,7 +724,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
            mutt_pretty_mailbox (fname, sizeof (fname));
          }
 
-         if (mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw, 1) == -1 || !fname[0])
+         if (mutt_enter_fname (prompt, fname, sizeof (fname), 1) == -1 || !fname[0])
            break;
 
          mutt_expand_path (fname, sizeof (fname));
@@ -1234,7 +1234,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
        if (idxlen)
          msg->content = idx[0]->content;
        if (mutt_enter_fname (_("Write message to mailbox"), fname, sizeof (fname),
-                             &menu->redraw, 1) != -1 && fname[0])
+                             1) != -1 && fname[0])
        {
          mutt_message (_("Writing message to %s ..."), fname);
          mutt_expand_path (fname, sizeof (fname));
index 273e84b2aa55877e68336a7859181393089db0c1..041375741f2c9140d293ddefcfe39d4ddaf22c9d 100644 (file)
@@ -735,7 +735,7 @@ int mutt_do_pager (const char *banner,
   return rc;
 }
 
-int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, int *redraw, int buffy, int multiple, char ***files, int *numfiles)
+int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, int buffy, int multiple, char ***files, int *numfiles)
 {
   event_t ch;
 
@@ -760,7 +760,6 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, int *redraw,
     buf[0] = 0;
     _mutt_select_file (buf, blen, MUTT_SEL_FOLDER | (multiple ? MUTT_SEL_MULTI : 0), 
                       files, numfiles);
-    *redraw = REDRAW_FULL;
   }
   else
   {
index 108e0f5b497a0b12dfea6085da4167ea84de2751..a1b69e8de579c328dc0e76ae0ce35c4b5805cdb9 100644 (file)
@@ -1216,7 +1216,7 @@ int mutt_index_menu (void)
        {
          mutt_buffy (buf, sizeof (buf));
 
-          if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
+          if (mutt_enter_fname (cp, buf, sizeof (buf), 1) == -1)
           {
             if (menu->menu == MENU_PAGER)
             {
@@ -1561,11 +1561,11 @@ int mutt_index_menu (void)
                               (op == OP_SAVE) || (op == OP_DECODE_SAVE),
                               (op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
                               (op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY) ||
-                              0,
-                              &menu->redraw) == 0 &&
+                              0) == 0 &&
             (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
            )
        {
+          menu->redraw |= REDRAW_STATUS;
          if (tag)
            menu->redraw |= REDRAW_INDEX;
          else if (option (OPTRESOLVE))
diff --git a/pager.c b/pager.c
index 632e1073e79b8d67dbfbf46aeea14163ae2911f5..8dd001fa91178207520b5fa33859921a90694219 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2686,8 +2686,7 @@ search_next:
                               (ch == OP_SAVE) || (ch == OP_DECODE_SAVE),
                               (ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
                               (ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY) ||
-                              0,
-                              &pager_menu->redraw) == 0 && (ch == OP_SAVE || ch == OP_DECODE_SAVE
+                              0) == 0 && (ch == OP_SAVE || ch == OP_DECODE_SAVE
                                                 || ch == OP_DECRYPT_SAVE
                                                 ))
        {
index b9a30dd2d03adf4445053f918bc4d6a27690c847..96c74fbfcec3d1f7b3882a56e1dda939293cce6d 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -309,8 +309,8 @@ int mutt_chscmp (const char *s, const char *chs);
 int mutt_parent_message (CONTEXT *, HEADER *, int);
 int mutt_prepare_template(FILE*, CONTEXT *, HEADER *, HEADER *, short);
 int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
-#define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
-int _mutt_enter_fname (const char *, char *, size_t, int *, int, int, char ***, int *);
+#define mutt_enter_fname(A,B,C,D) _mutt_enter_fname(A,B,C,D,0,NULL,NULL)
+int _mutt_enter_fname (const char *, char *, size_t, int, int, char ***, int *);
 int  mutt_enter_string (char *buf, size_t buflen, int col, int flags);
 int _mutt_enter_string (char *, size_t, int, int, int, char ***, int *, ENTER_STATE *);
 #define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
@@ -360,7 +360,7 @@ int mutt_query_complete (char *, size_t);
 int mutt_query_variables (LIST *queries);
 int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *);
 int _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
-int mutt_save_message (HEADER *, int, int, int, int *);
+int mutt_save_message (HEADER *, int, int, int);
 int mutt_search_command (int, int);
 #ifdef USE_SMTP
 int mutt_smtp_send (const ADDRESS *, const ADDRESS *, const ADDRESS *,