[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeextragear-3/kdebluetooth/libqobex/qobex
From: Mathias Fröhlich <Mathias.Froehlich () web ! de>
Date: 2004-02-22 22:25:53
Message-ID: 20040222222553.5AC709672 () office ! kde ! org
[Download RAW message or body]
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 <Mathias.Froehlich@web.de>
+ Copyright (c) 2003-2004 Mathias Froehlich <Mathias.Froehlich@web.de>
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<QObexHeader> 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<QObexHeader>& 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 <Mathias.Froehlich@web.de>
+ Copyright (c) 2003-2004 Mathias Froehlich <Mathias.Froehlich@web.de>
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<QObexHeader>& );
+
+ /**
Start a set path request.
*/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic