author | mickeyl <mickeyl> | 2004-04-05 13:49:07 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 13:49:07 (UTC) |
commit | f44b1d4abe82cfb74db68bffcaf240f6f6134708 (patch) (side-by-side diff) | |
tree | c150abb3cbc842fd930d3ab7543a0b34ec3145ad /rsync | |
parent | 997a521a3ee84f614e2781a663911096ffb4a91a (diff) | |
download | opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.zip opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.tar.gz opie-f44b1d4abe82cfb74db68bffcaf240f6f6134708.tar.bz2 |
use opie debugging
-rw-r--r-- | rsync/qrsync.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rsync/qrsync.cpp b/rsync/qrsync.cpp index fe5f1bc..a2dbafc 100644 --- a/rsync/qrsync.cpp +++ b/rsync/qrsync.cpp @@ -1,15 +1,20 @@ #include "qrsync.h" #include <stdio.h> extern "C" { #include "rsync.h" } #include <stdlib.h> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qfile.h> static const char *rdiffNewFile = "/tmp/rdiff/result"; static size_t block_len = RS_DEFAULT_BLOCK_LEN; static size_t strong_len = RS_DEFAULT_STRONG_LEN; void QRsync::generateSignature( QString baseFile, QString sigFile ) @@ -40,25 +45,25 @@ void QRsync::generateDiff( QString baseFile, QString sigFile, QString deltaFile rs_signature_t *sumset; sig_file = fopen(sigFile.latin1(), "rb"); new_file = fopen(baseFile.latin1(), "rb"); delta_file = fopen(deltaFile.latin1(), "wb"); result = rs_loadsig_file(sig_file, &sumset, 0); if (result != RS_DONE) { - qDebug( "rdiffGenDiff: loading of sig file failed, error=%d", result ); + odebug << "rdiffGenDiff: loading of sig file failed, error=" << result << "" << oendl; } else { result = rs_build_hash_table(sumset); if ( result != RS_DONE) { - qDebug( "rdiffGenDiff: building of hash table failed, error=%d", result ); + odebug << "rdiffGenDiff: building of hash table failed, error=" << result << "" << oendl; } else { result = rs_delta_file(sumset, new_file, delta_file, 0); if ( result != RS_DONE) { - qDebug( "rdiffGenDiff: writing of diff file failed, error=%d", result ); + odebug << "rdiffGenDiff: writing of diff file failed, error=" << result << "" << oendl; } } } if ( sumset ) rs_free_sumset( sumset ); fclose( new_file ); fclose( delta_file ); @@ -83,17 +88,17 @@ void QRsync::applyDiff( QString baseFile, QString deltaFile ) result = rs_patch_file(basis_file, delta_file, new_file, 0); fclose( basis_file ); fclose( delta_file ); fclose( new_file ); if (result != RS_DONE) { - qDebug( "rdiffApplyDiff failed with result %d", result ); + odebug << "rdiffApplyDiff failed with result " << result << "" << oendl; return; } #ifdef Q_WS_WIN QDir dir; QFile backup = baseFile + "~"; dir.rename( baseFile, backup ); |