From 6c4f7ba5d1cb50e3694b2a6fafceebf94095fccb Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 28 Jun 2009 16:10:15 +0000 Subject: [PATCH] 2009-06-28 18:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qth/QFtp.qth * contrib/hbqt/qth/QHttp.qth * contrib/hbqt/hbqt_qhttp.cpp * contrib/hbqt/hbqt_qftp.cpp % Little optimization. --- harbour/ChangeLog | 29 ++++++++++++++++++----------- harbour/contrib/hbqt/hbqt_qftp.cpp | 4 ++-- harbour/contrib/hbqt/hbqt_qhttp.cpp | 4 ++-- harbour/contrib/hbqt/qth/QFtp.qth | 7 +++---- harbour/contrib/hbqt/qth/QHttp.qth | 6 ++---- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ecab5b75b7..03224d532f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-28 18:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qth/QFtp.qth + * contrib/hbqt/qth/QHttp.qth + * contrib/hbqt/hbqt_qhttp.cpp + * contrib/hbqt/hbqt_qftp.cpp + % Little optimization. + 2009-06-28 08:44 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbqt/hbqt.h * harbour/contrib/hbqt/hbqt_qftp.cpp @@ -27,8 +34,8 @@ * harbour/contrib/hbqt/TQHttp.prg ! Fixed ( char * ) argument usage in QFtp and QHttp classes. Infact are written - as is in the header. I could not find a solution to - auto generate it because of argument which could + as is in the header. I could not find a solution to + auto generate it because of argument which could never be known to first parameter. 2009-06-27 20:47 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) @@ -40,20 +47,20 @@ * harbour/contrib/hbxbp/xbpsle.prg * harbour/contrib/hbxbp/xbptreeview.prg * harbour/contrib/hbxbp/xbpwindow.prg - ! Rewrote the event management system exactly like + ! Rewrote the event management system exactly like Xbase++. Now it is possible to sub-class methods and callback slots. + harbour/contrib/hbxbp/xbpappevent.prg + Added PRG level events conversion mechanism. - I wanted it to be C code for speed purposes, anyhow, + I wanted it to be C code for speed purposes, anyhow, as agreed we do not want any C code in hbxbp. * harbour/contrib/hbxbp/tests/demoxbp.prg ! Few experiments. You may viaualize some artifacts. - /* NOTE: I am struggling to receive events from another + /* NOTE: I am struggling to receive events from another thread of Harbour code in the event filter. - It seems default event dispatched can be + It seems default event dispatched can be invoked only from main thread. Anybody to rescue ? */ @@ -153,12 +160,12 @@ * harbour/contrib/hbqt/hbqt_qftp.cpp * harbour/contrib/hbqt/hbqt_qhttp.cpp ! Result of #define hbqt_par_char( n ) ( ( char* ) hb_parcx( n ) ) - NOTE: QT sources are generated dynamically so please do not make - changes to them directly. I do not know if above casting + NOTE: QT sources are generated dynamically so please do not make + changes to them directly. I do not know if above casting will work or not but it is just to pacify the warnings. - Alternatively we can comment out the relevant functions in - /qth/QHttp.qth and /qth/QFtp.qth. I kept it like this - as if someone could test if it works. + Alternatively we can comment out the relevant functions in + /qth/QHttp.qth and /qth/QFtp.qth. I kept it like this + as if someone could test if it works. 2009-06-27 09:47 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbapifs.h diff --git a/harbour/contrib/hbqt/hbqt_qftp.cpp b/harbour/contrib/hbqt/hbqt_qftp.cpp index 5b25672e05..6f2c39c8ec 100644 --- a/harbour/contrib/hbqt/hbqt_qftp.cpp +++ b/harbour/contrib/hbqt/hbqt_qftp.cpp @@ -83,8 +83,8 @@ HB_FUNC( QT_QFTP_READ ) iRead = hbqt_par_QFtp( 1 )->read( iData, hb_parnint( 3 ) ); hb_retnint( iRead ); - hb_storclen( iData, iRead, 2 ); - hb_xfree( iData ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); } /* diff --git a/harbour/contrib/hbqt/hbqt_qhttp.cpp b/harbour/contrib/hbqt/hbqt_qhttp.cpp index 9e85d1198d..6e22a5c047 100644 --- a/harbour/contrib/hbqt/hbqt_qhttp.cpp +++ b/harbour/contrib/hbqt/hbqt_qhttp.cpp @@ -85,8 +85,8 @@ HB_FUNC( QT_QHTTP_READ ) iRead = hbqt_par_QHttp( 1 )->read( iData, hb_parnint( 3 ) ); hb_retnint( iRead ); - hb_storclen( iData, iRead, 2 ); - hb_xfree( iData ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); } /* diff --git a/harbour/contrib/hbqt/qth/QFtp.qth b/harbour/contrib/hbqt/qth/QFtp.qth index f8307653ce..cadc489cf6 100644 --- a/harbour/contrib/hbqt/qth/QFtp.qth +++ b/harbour/contrib/hbqt/qth/QFtp.qth @@ -86,8 +86,8 @@ HB_FUNC( QT_QFTP_READ ) iRead = hbqt_par_QFtp( 1 )->read( iData, hb_parnint( 3 ) ); hb_retnint( iRead ); - hb_storclen( iData, iRead, 2 ); - hb_xfree( iData ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); } @@ -118,7 +118,7 @@ int mkdir ( const QString & dir ) int put ( QIODevice * dev, const QString & file, TransferType type = Binary ) int put ( const QByteArray & data, const QString & file, TransferType type = Binary ) int rawCommand ( const QString & command ) -# Never uncomment it : See above +# Never uncomment it : See above // qint64 read ( char * data, qint64 maxlen ) # QByteArray readAll () @@ -144,4 +144,3 @@ void rawCommandReply ( int replyCode, const QString & detail ) void readyRead () void stateChanged ( int state ) - diff --git a/harbour/contrib/hbqt/qth/QHttp.qth b/harbour/contrib/hbqt/qth/QHttp.qth index 66c094d2c1..4c22a47685 100644 --- a/harbour/contrib/hbqt/qth/QHttp.qth +++ b/harbour/contrib/hbqt/qth/QHttp.qth @@ -88,8 +88,8 @@ HB_FUNC( QT_QHTTP_READ ) iRead = hbqt_par_QHttp( 1 )->read( iData, hb_parnint( 3 ) ); hb_retnint( iRead ); - hb_storclen( iData, iRead, 2 ); - hb_xfree( iData ); + if( ! hb_storclen_buffer( iData, iRead, 2 ) ) + hb_xfree( iData ); } @@ -150,5 +150,3 @@ void responseHeaderReceived ( const QHttpResponseHeader & resp ) void sslErrors ( const QList & errors ) void stateChanged ( int state ) - -