gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnokii 0.6.26


From: Yoni Rabkin
Subject: Re: gnokii 0.6.26
Date: Sat, 31 May 2008 13:11:24 +0300
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

"Pawel Kot" <address@hidden> writes:

> Hi,
>
> On Sat, May 31, 2008 at 8:42 AM, Yoni Rabkin <address@hidden> wrote:
>> I noticed that my trivial patch to make the progress percentage update
>> in place against common/phones/nk6510.c has not been applied.
>
> Sorry, I forgot about it. Could you please resend?

This works against today's CVS:

Index: nk6510.c
===================================================================
RCS file: /sources/gnokii/gnokii/common/phones/nk6510.c,v
retrieving revision 1.262
diff -u -r1.262 nk6510.c
--- nk6510.c    31 May 2008 09:52:34 -0000      1.262
+++ nk6510.c    31 May 2008 10:08:02 -0000
@@ -1701,7 +1701,7 @@
 
        /* Get the data */
        while (data->file->togo > 0) {
-               int progress;
+               int progress, prev_progress = 0;
 
                memcpy(req3+4, data->file->id, NK6510_FILE_ID_LENGTH);
                i = data->file->file_length - data->file->togo;
@@ -1721,8 +1721,12 @@
                if (err != GN_ERR_NONE)
                        return err;
                progress = 100 * (data->file->file_length - data->file->togo) / 
data->file->file_length;
-               fprintf(stderr, _("\rProgress: %3d%% completed\n"), progress);
+               if (progress != prev_progress) {
+                       fprintf(stderr, _("\rProgress: %d%% completed"), 
progress);
+               }
+               prev_progress = progress;
        }
+       fprintf(stderr, _("\n"));
        
        /* Finish the transfer */
        memcpy(req4+4, data->file->id, NK6510_FILE_ID_LENGTH);
-- 
   "Cut your own wood and it will warm you twice"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]