diff --git a/harbour/ChangeLog b/harbour/ChangeLog index efd36e7a90..ecab5b75b7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,20 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-28 08:44 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/hbqt/hbqt.h + * harbour/contrib/hbqt/hbqt_qftp.cpp + * harbour/contrib/hbqt/hbqt_qhttp.cpp + * harbour/contrib/hbqt/qth/QFtp.qth + * harbour/contrib/hbqt/qth/QHttp.qth + * harbour/contrib/hbqt/TQFtp.prg + * 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 + never be known to first parameter. + 2009-06-27 20:47 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbxbp/Makefile * harbour/contrib/hbxbp/xbp.ch diff --git a/harbour/contrib/hbqt/TQFtp.prg b/harbour/contrib/hbqt/TQFtp.prg index 192913332a..124e105a71 100644 --- a/harbour/contrib/hbqt/TQFtp.prg +++ b/harbour/contrib/hbqt/TQFtp.prg @@ -81,7 +81,6 @@ CREATE CLASS QFtp INHERIT QObject METHOD put( pDev, cFile, nType ) INLINE Qt_QFtp_put( ::pPtr, pDev, cFile, nType ) METHOD put_1( pData, cFile, nType ) INLINE Qt_QFtp_put_1( ::pPtr, pData, cFile, nType ) METHOD rawCommand( cCommand ) INLINE Qt_QFtp_rawCommand( ::pPtr, cCommand ) - METHOD read( pData, nMaxlen ) INLINE Qt_QFtp_read( ::pPtr, pData, nMaxlen ) METHOD readAll() INLINE Qt_QFtp_readAll( ::pPtr ) METHOD remove( cFile ) INLINE Qt_QFtp_remove( ::pPtr, cFile ) METHOD rename( cOldname, cNewname ) INLINE Qt_QFtp_rename( ::pPtr, cOldname, cNewname ) diff --git a/harbour/contrib/hbqt/TQHttp.prg b/harbour/contrib/hbqt/TQHttp.prg index 450b0b05e8..02726ce4c1 100644 --- a/harbour/contrib/hbqt/TQHttp.prg +++ b/harbour/contrib/hbqt/TQHttp.prg @@ -78,7 +78,6 @@ CREATE CLASS QHttp INHERIT QObject METHOD lastResponse() INLINE Qt_QHttp_lastResponse( ::pPtr ) METHOD post( cPath, pData, pTo ) INLINE Qt_QHttp_post( ::pPtr, cPath, pData, pTo ) METHOD post_1( cPath, pData, pTo ) INLINE Qt_QHttp_post_1( ::pPtr, cPath, pData, pTo ) - METHOD read( pData, nMaxlen ) INLINE Qt_QHttp_read( ::pPtr, pData, nMaxlen ) METHOD readAll() INLINE Qt_QHttp_readAll( ::pPtr ) METHOD request( pHeader, pData, pTo ) INLINE Qt_QHttp_request( ::pPtr, pHeader, pData, pTo ) METHOD request_1( pHeader, pData, pTo ) INLINE Qt_QHttp_request_1( ::pPtr, pHeader, pData, pTo ) diff --git a/harbour/contrib/hbqt/hbqt.h b/harbour/contrib/hbqt/hbqt.h index a38b13aa86..2b900b6e26 100644 --- a/harbour/contrib/hbqt/hbqt.h +++ b/harbour/contrib/hbqt/hbqt.h @@ -335,7 +335,7 @@ #define hbqt_par_QString( n ) ( ( QString ) hb_parcx( n ) ) #define hbqt_par_QRgb( n ) ( hb_parnint( n ) ) #define hbqt_par_Bool( n ) ( hb_parl( n ) ) -#define hbqt_par_char( n ) ( ( char * ) hb_parcx( n ) ) +#define hbqt_par_char( n ) ( hb_parcx( n ) ) #define hbqt_ret_QWidget( p ) ( hb_retptr( ( QWidget* ) p ) ) #define hbqt_ret_QAbstractItemDelegate( p ) ( hb_retptr( ( QAbstractItemDelegate* ) p ) ) diff --git a/harbour/contrib/hbqt/hbqt_qftp.cpp b/harbour/contrib/hbqt/hbqt_qftp.cpp index 062bf2cb73..5b25672e05 100644 --- a/harbour/contrib/hbqt/hbqt_qftp.cpp +++ b/harbour/contrib/hbqt/hbqt_qftp.cpp @@ -72,6 +72,21 @@ HB_FUNC( QT_QFTP ) hb_retptr( new QFtp( hbqt_par_QObject( 1 ) ) ); } +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QFTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) ); + qint64 iRead; + + iRead = hbqt_par_QFtp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + hb_storclen( iData, iRead, 2 ); + hb_xfree( iData ); +} + /* * qint64 bytesAvailable () const */ @@ -216,14 +231,6 @@ HB_FUNC( QT_QFTP_RAWCOMMAND ) hb_retni( hbqt_par_QFtp( 1 )->rawCommand( hbqt_par_QString( 2 ) ) ); } -/* - * qint64 read ( char * data, qint64 maxlen ) - */ -HB_FUNC( QT_QFTP_READ ) -{ - hb_retnint( hbqt_par_QFtp( 1 )->read( hbqt_par_char( 2 ), hb_parnint( 3 ) ) ); -} - /* * QByteArray readAll () */ diff --git a/harbour/contrib/hbqt/hbqt_qhttp.cpp b/harbour/contrib/hbqt/hbqt_qhttp.cpp index 5122a251c8..9e85d1198d 100644 --- a/harbour/contrib/hbqt/hbqt_qhttp.cpp +++ b/harbour/contrib/hbqt/hbqt_qhttp.cpp @@ -74,6 +74,21 @@ HB_FUNC( QT_QHTTP ) hb_retptr( new QHttp( hbqt_par_QObject( 1 ) ) ); } +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QHTTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) ); + qint64 iRead; + + iRead = hbqt_par_QHttp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + hb_storclen( iData, iRead, 2 ); + hb_xfree( iData ); +} + /* * qint64 bytesAvailable () const */ @@ -194,14 +209,6 @@ HB_FUNC( QT_QHTTP_POST_1 ) hb_retni( hbqt_par_QHttp( 1 )->post( hbqt_par_QString( 2 ), *hbqt_par_QByteArray( 3 ), hbqt_par_QIODevice( 4 ) ) ); } -/* - * qint64 read ( char * data, qint64 maxlen ) - */ -HB_FUNC( QT_QHTTP_READ ) -{ - hb_retnint( hbqt_par_QHttp( 1 )->read( hbqt_par_char( 2 ), hb_parnint( 3 ) ) ); -} - /* * QByteArray readAll () */ diff --git a/harbour/contrib/hbqt/qth/QFtp.qth b/harbour/contrib/hbqt/qth/QFtp.qth index 8c9bebe2c3..f8307653ce 100644 --- a/harbour/contrib/hbqt/qth/QFtp.qth +++ b/harbour/contrib/hbqt/qth/QFtp.qth @@ -74,6 +74,21 @@ HB_FUNC( QT_QFTP ) { hb_retptr( new QFtp( hbqt_par_QObject( 1 ) ) ); } + +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QFTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) ); + qint64 iRead; + + iRead = hbqt_par_QFtp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + hb_storclen( iData, iRead, 2 ); + hb_xfree( iData ); +} @@ -103,7 +118,9 @@ 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 ) -qint64 read ( char * data, qint64 maxlen ) +# Never uncomment it : See above +// qint64 read ( char * data, qint64 maxlen ) +# QByteArray readAll () int remove ( const QString & file ) int rename ( const QString & oldname, const QString & newname ) diff --git a/harbour/contrib/hbqt/qth/QHttp.qth b/harbour/contrib/hbqt/qth/QHttp.qth index 3ed0a2c052..66c094d2c1 100644 --- a/harbour/contrib/hbqt/qth/QHttp.qth +++ b/harbour/contrib/hbqt/qth/QHttp.qth @@ -76,6 +76,21 @@ HB_FUNC( QT_QHTTP ) { hb_retptr( new QHttp( hbqt_par_QObject( 1 ) ) ); } + +/* + * qint64 read ( char * data, qint64 maxlen ) + */ +HB_FUNC( QT_QHTTP_READ ) +{ + char * iData = ( char * ) hb_xgrab( hb_parnint( 3 ) ); + qint64 iRead; + + iRead = hbqt_par_QHttp( 1 )->read( iData, hb_parnint( 3 ) ); + + hb_retnint( iRead ); + hb_storclen( iData, iRead, 2 ); + hb_xfree( iData ); +} @@ -100,7 +115,11 @@ int head ( const QString & path ) QHttpResponseHeader lastResponse () const int post ( const QString & path, QIODevice * data, QIODevice * to = 0 ) int post ( const QString & path, const QByteArray & data, QIODevice * to = 0 ) -qint64 read ( char * data, qint64 maxlen ) +# +# NEVER UNCOMMENT IT +// qint64 read ( char * data, qint64 maxlen ) +# +# QByteArray readAll () int request ( const QHttpRequestHeader & header, QIODevice * data = 0, QIODevice * to = 0 ) int request ( const QHttpRequestHeader & header, const QByteArray & data, QIODevice * to = 0 )