summaryrefslogtreecommitdiff
path: root/noncore/net
authorzecke <zecke>2002-07-13 12:54:47 (UTC)
committer zecke <zecke>2002-07-13 12:54:47 (UTC)
commitd7f3722f9b7913731978437085b14cc2cccbfa24 (patch) (side-by-side diff)
tree1b190105693609cc01d1ad9730e8925e957209c9 /noncore/net
parent8be0a8e108eaf8ff99301aa175298ddeb48eae67 (diff)
downloadopie-d7f3722f9b7913731978437085b14cc2cccbfa24.zip
opie-d7f3722f9b7913731978437085b14cc2cccbfa24.tar.gz
opie-d7f3722f9b7913731978437085b14cc2cccbfa24.tar.bz2
LIB updates
Class IdList per Service can have more than one line
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/parser.cc8
-rw-r--r--noncore/net/opietooth/lib/services.cc26
-rw-r--r--noncore/net/opietooth/lib/services.h13
3 files changed, 22 insertions, 25 deletions
diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc
index 00ec84a..0699309 100644
--- a/noncore/net/opietooth/lib/parser.cc
+++ b/noncore/net/opietooth/lib/parser.cc
@@ -120,9 +120,8 @@ bool Parser::parseClassId( const QString& str) {
if (str.startsWith("Service Class ID List:") ) {
m_classOver = true;
return true;
- }else if ( m_classOver ) { // ok now are the informations in place
+ }else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place
- m_classOver = false;
// "Obex Object Push" (0x1105)
// find backwards the " and the from 0 to pos and the mid pos+1
@@ -132,12 +131,11 @@ bool Parser::parseClassId( const QString& str) {
int ids;
ids = convert( str, classes );
qWarning("ids %d", ids );
- m_item.setClassIdList( classes );
- m_item.setClassIdList( ids );
+ m_item.insertClassId( ids, classes );
return true;
}else
- m_classOver = true;
+ m_classOver = false;
return false;
}
bool Parser::parseProtocol( const QString& str) {
diff --git a/noncore/net/opietooth/lib/services.cc b/noncore/net/opietooth/lib/services.cc
index 93ee70a..23b760b 100644
--- a/noncore/net/opietooth/lib/services.cc
+++ b/noncore/net/opietooth/lib/services.cc
@@ -113,8 +113,7 @@ Services::~Services(){
Services &Services::operator=( const Services& ser){
m_name = ser.m_name;
m_recHandle = ser.m_recHandle;
- m_classList = ser.m_classList;
- m_classId = ser.m_classId;
+ m_classIds = ser.m_classIds;
m_protocols = ser.m_protocols;
m_profiles = ser.m_profiles;
return *this;
@@ -122,11 +121,10 @@ Services &Services::operator=( const Services& ser){
bool operator==( const Services& one,
const Services& two){
if ( ( one.recHandle() == two.recHandle() ) &&
- ( one.classIdListInt() == two.classIdListInt() ) &&
( one.serviceName() == two.serviceName() ) &&
- ( one.classIdList() == two.classIdList() ) &&
( one.protocolDescriptorList() == two.protocolDescriptorList() ) &&
- ( one.profileDescriptor() == two.profileDescriptor() ) )
+ ( one.profileDescriptor() == two.profileDescriptor() )
+ /* ( one.classIdList() == two.classIdList() ) */ )
return true;
return false;
}
@@ -142,17 +140,17 @@ int Services::recHandle() const{
void Services::setRecHandle( int handle){
m_recHandle = handle;
}
-QString Services::classIdList() const{
- return m_classList;
+QMap<int, QString> Services::classIdList()const {
+ return m_classIds;
+};
+void Services::insertClassId( int id, const QString& str ) {
+ m_classIds.insert( id, str );
}
-void Services::setClassIdList( const QString& str){
- m_classList = str;
+void Services::removeClassId(int id) {
+ m_classIds.remove( id );
}
-int Services::classIdListInt() const{
- return m_classId;
-}
-void Services::setClassIdList(int id){
- m_classId = id;
+void Services::clearClassId() {
+ m_classIds.clear();
}
void Services::insertProtocolDescriptor( const ProtocolDescriptor& prot){
m_protocols.append( prot );
diff --git a/noncore/net/opietooth/lib/services.h b/noncore/net/opietooth/lib/services.h
index 881d383..7cce5e1 100644
--- a/noncore/net/opietooth/lib/services.h
+++ b/noncore/net/opietooth/lib/services.h
@@ -2,6 +2,7 @@
#ifndef OpieToothServices_H
#define OpieToothServices_H
+#include <qmap.h>
#include <qvaluelist.h>
namespace OpieTooth {
@@ -116,10 +117,11 @@ namespace OpieTooth {
int recHandle()const;
void setRecHandle( int );
- QString classIdList()const;
- void setClassIdList( const QString& );
- int classIdListInt()const;
- void setClassIdList(int );
+
+ QMap<int, QString> classIdList()const;
+ void insertClassId( int id, const QString& className );
+ void removeClassId( int id );
+ void clearClassId();
void insertProtocolDescriptor(const ProtocolDescriptor& );
void clearProtocolDescriptorList();
@@ -132,10 +134,9 @@ namespace OpieTooth {
ProfileDescriptor::ValueList profileDescriptor()const;
private:
+ QMap<int, QString> m_classIds;
QString m_name;
int m_recHandle;
- QString m_classList;
- int m_classId;
QValueList<ProfileDescriptor> m_profiles;
QValueList<ProtocolDescriptor> m_protocols;
};