Reply
Thread Tools
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#141
still cant see the code; is this the repo?
https://github.com/wwwjfy/MeegoCallBackupRestore
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#142
nevermind, found it
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#143
one note: this is false when you have exactly 1000 calls.
Code:
        // If we got less than limit events, then it's the last batch
        keepgoing = (count == limit);
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#144
im pretty sure EventModel::getEvents() makes no promises that it will return the full limit, only that it will not return more.
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#145
yea, if you make it just wait until it gets 0 events, it works fine
Code:
  getEvents() from 0 to 1000
libqtcontacts-tracker: initializing libqtcontacts-tracker 4.19.2-1+0m8 for /usr/bin/callbackuprestore [22419]
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................  got 992 events
  getEvents() from 992 to 1992
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................  got 539 events
  getEvents() from 1531 to 2531
..............  got 7 events
  getEvents() from 1538 to 2538
  got 0 events
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#146
nevermind, it gets duplicates.
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#147
ok, so libcommhistory is buggy. not sure what to do about it, unfortunately.
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#148
a note: it works correctly if you do 0..1000, 1000..2000, 2000..3000, even though it only gets part of it.

this works:
Code:
        model.setLimit(limit);
        model.setOffset(offset);
        model.getEvents();
        offset += limit;

        // Stop when we get nothing
        keepgoing = (model.rowCount() > 0);
i get all my calls correctly with the above, 992 + 534 == 1526
__________________
~ teleshoes ~
 
Posts: 986 | Thanked: 1,526 times | Joined on Jul 2010
#149
sent pull requests for both that seem to work from my end.
__________________
~ teleshoes ~
 
Posts: 39 | Thanked: 37 times | Joined on Mar 2012 @ Beijing
#150
Thanks a lot. Merged and new deb package generated, updated in #1
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:19.