Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcommhistory offset vs limit #5

Merged
merged 4 commits into from
Apr 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.deb
*.log
*.o

src/smsbackuprestore
src/moc_catcher.cpp

Makefile
build-stamp
configure-stamp

debian/smsbackuprestore/
debian/files
debian/smsbackuprestore.aegis
debian/smsbackuprestore.substvars
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
dir=$(dirname `readlink -f $0`)
project=$(basename "$dir")
debname="smsbackuprestore"
mnt=/scratchbox/users/$USER/home/$USER/$project

if ! mount | grep "$project on $mnt"; then
sudo /scratchbox/sbin/sbox_ctl start
sudo /scratchbox/sbin/sbox_sync

mkdir -p $mnt
sudo mount -o bind $dir $mnt
fi


/scratchbox/login -d $HOME find -maxdepth 2 -name $debname*.deb -delete
/scratchbox/login -d $HOME find -maxdepth 2 -name $debname*.changes -delete
/scratchbox/login -d $HOME find -maxdepth 2 -name $debname*.dsc -delete
/scratchbox/login -d $HOME find -maxdepth 2 -name $debname*.gz -delete

/scratchbox/login -d $HOME/$project qmake
/scratchbox/login -d $HOME/$project dpkg-buildpackage

deb=`/scratchbox/login -d $HOME find -maxdepth 1 -name $debname*.deb`
echo copying $deb from sbox $HOME to $HOME/$project
/scratchbox/login -d $HOME cp $deb $HOME/$project
6 changes: 3 additions & 3 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ void Util::exportSMS(QTextStream &out) {
model.getEvents(g.id());
std::cout << " got " << model.rowCount() << " events for group " << g.id() << std::endl;
count = model.rowCount();
offset += count;
offset += limit;

// If we got less than limit events, then it's the last batch
keepgoing = (count == limit);
// Stop when no more events found
keepgoing = (count > 0);

// the events got by getEvents is reversed-ordered
for (int i = count - 1; i >= 0; i--) {
Expand Down