From 3f9645239b1f0e08141889c295818a32110d93cc Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Mon, 5 Jul 2010 20:47:20 +0000 Subject: [PATCH] 2010-07-05 13:41 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/doc/en/class_qmimedata.txt * contrib/hbqt/qtcore/QMimeData.cpp * contrib/hbqt/qtcore/TQMimeData.prg * contrib/hbqt/qth/QMimeData.qth + Added method QStrinList * hbUrlList() which returns list of Urls as strings. It is a workarount until proper QList implementation is not in place. --- harbour/ChangeLog | 9 +++++++++ .../contrib/hbqt/doc/en/class_qmimedata.txt | 1 + harbour/contrib/hbqt/qtcore/QMimeData.cpp | 20 ++++++++++++++++++- harbour/contrib/hbqt/qtcore/TQMimeData.prg | 5 +++++ harbour/contrib/hbqt/qth/QMimeData.qth | 15 ++++++++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 84bdedd41c..5a9a9c447a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-05 13:41 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/doc/en/class_qmimedata.txt + * contrib/hbqt/qtcore/QMimeData.cpp + * contrib/hbqt/qtcore/TQMimeData.prg + * contrib/hbqt/qth/QMimeData.qth + + Added method QStrinList * hbUrlList() which returns list + of Urls as strings. It is a workarount until proper + QList implementation is not in place. + 2010-07-05 22:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/makefile.hbs * utils/hbmk2/hbmk2.prg diff --git a/harbour/contrib/hbqt/doc/en/class_qmimedata.txt b/harbour/contrib/hbqt/doc/en/class_qmimedata.txt index 64266334dc..66d0c625bf 100644 --- a/harbour/contrib/hbqt/doc/en/class_qmimedata.txt +++ b/harbour/contrib/hbqt/doc/en/class_qmimedata.txt @@ -48,6 +48,7 @@ :setText( cText ) -> NIL :text() -> cQString :urls() -> pQList + :hbUrlList() -> pQStringList $DESCRIPTION$ diff --git a/harbour/contrib/hbqt/qtcore/QMimeData.cpp b/harbour/contrib/hbqt/qtcore/QMimeData.cpp index fdee873dc9..ac6736bb53 100644 --- a/harbour/contrib/hbqt/qtcore/QMimeData.cpp +++ b/harbour/contrib/hbqt/qtcore/QMimeData.cpp @@ -66,12 +66,13 @@ /*----------------------------------------------------------------------*/ /* - * Constructed[ 20/21 [ 95.24% ] ] + * Constructed[ 21/23 [ 91.30% ] ] * * *** Unconvered Prototypes *** * ----------------------------- * * void setUrls ( const QList & urls ) + * } */ #include @@ -436,6 +437,23 @@ HB_FUNC( QT_QMIMEDATA_URLS ) } } +/* + * QStringList * hbUrlList() const + */ +HB_FUNC( QT_QMIMEDATA_HBURLLIST ) +{ + QMimeData * p = hbqt_par_QMimeData( 1 ); + if( p ) + { + QStringList strList; + foreach ( QUrl url, ( p )->urls() ) + { + strList << ( QString ) url.toString().toAscii().data(); + } + hb_retptrGC( hbqt_gcAllocate_QStringList( new QStringList( strList ), true ) ); + } +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtcore/TQMimeData.prg b/harbour/contrib/hbqt/qtcore/TQMimeData.prg index 95d2d874ed..644c5b711c 100644 --- a/harbour/contrib/hbqt/qtcore/TQMimeData.prg +++ b/harbour/contrib/hbqt/qtcore/TQMimeData.prg @@ -87,6 +87,7 @@ CREATE CLASS QMimeData INHERIT HbQtObjectHandler, QObject METHOD setText( cText ) METHOD text() METHOD urls() + METHOD hbUrlList() ENDCLASS @@ -179,3 +180,7 @@ METHOD QMimeData:text() METHOD QMimeData:urls() RETURN Qt_QMimeData_urls( ::pPtr ) + +METHOD QMimeData:hbUrlList() + RETURN Qt_QMimeData_hbUrlList( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qth/QMimeData.qth b/harbour/contrib/hbqt/qth/QMimeData.qth index 9fab97a69b..c9d1e8056e 100644 --- a/harbour/contrib/hbqt/qth/QMimeData.qth +++ b/harbour/contrib/hbqt/qth/QMimeData.qth @@ -101,6 +101,21 @@ void setText ( const QString & text ) void setUrls ( const QList & urls ) QString text () const QList urls () const + +# Harbour Callable Function Till QList is not resolved +# +QStringList * hbUrlList() const{ + QMimeData * p = hbqt_par_QMimeData( 1 ); + if( p ) + { + QStringList strList; + foreach ( QUrl url, ( p )->urls() ) + { + strList << ( QString ) url.toString().toAscii().data(); + } + hb_retptrGC( hbqt_gcAllocate_QStringList( new QStringList( strList ), true ) ); + } +}