From kde-commits Sun Feb 22 22:25:53 2004 From: =?utf-8?q?Mathias=20Fr=C3=B6hlich?= Date: Sun, 22 Feb 2004 22:25:53 +0000 To: kde-commits Subject: kdeextragear-3/kdebluetooth/libqobex/qobex Message-Id: <20040222222553.5AC709672 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=107748876916586 CVS commit by froehlich: Add an additional, more general put client request call. M +16 -6 qobexclient.cpp 1.15 M +6 -1 qobexclient.h 1.9 --- kdeextragear-3/kdebluetooth/libqobex/qobex/qobexclient.cpp #1.14:1.15 @@ -2,5 +2,5 @@ This file is part of libqobex. - Copyright (c) 2003 Mathias Froehlich + Copyright (c) 2003-2004 Mathias Froehlich This library is free software; you can redistribute it and/or @@ -33,5 +33,5 @@ #undef DEBUG -// #define DEBUG +#define DEBUG #ifdef DEBUG #define myDebug(a) qDebug a @@ -176,4 +176,17 @@ bool QObexClient::put( const QString& pa myDebug(( "QObexClient::put( ... )" )); + QValueList headers; + if ( 0 < size ) + headers.append( QObexHeader( QObexHeader::Length, size ) ); + if ( !mimetype.isNull() ) + headers.append( QObexHeader( QObexHeader::Type, mimetype ) ); + + return put( path, headers ); +} + +bool QObexClient::put( const QString& path, + const QValueList& headers ) { + myDebug(( "QObexClient::put( ... )" )); + // Check if there is a request running. if ( mCurrentRequest ) { @@ -185,8 +198,5 @@ bool QObexClient::put( const QString& pa if ( !path.isNull() ) req->addHeader( QObexHeader( QObexHeader::Name, path ) ); - if ( 0 < size ) - req->addHeader( QObexHeader( QObexHeader::Length, size ) ); - if ( !mimetype.isNull() ) - req->addHeader( QObexHeader( QObexHeader::Type, mimetype ) ); + req->appendHeaders( headers ); #ifdef STREAMING_PUT --- kdeextragear-3/kdebluetooth/libqobex/qobex/qobexclient.h #1.8:1.9 @@ -2,5 +2,5 @@ This file is part of libqobex. - Copyright (c) 2003 Mathias Froehlich + Copyright (c) 2003-2004 Mathias Froehlich This library is free software; you can redistribute it and/or @@ -93,4 +93,9 @@ public: /** + Start a put request for name. + */ + bool put( const QString&, const QValueList& ); + + /** Start a set path request. */