summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (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
@@ -122,5 +122,4 @@ bool Parser::parseClassId( const QString& str) {
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;
@@ -134,4 +133,3 @@ bool Parser::parseClassId( const QString& str) {
qWarning("ids %d", ids );
- m_item.setClassIdList( classes );
- m_item.setClassIdList( ids );
+ m_item.insertClassId( ids, classes );
@@ -139,3 +137,3 @@ bool Parser::parseClassId( const QString& str) {
}else
- m_classOver = true;
+ m_classOver = false;
return false;
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
@@ -115,4 +115,3 @@ Services &Services::operator=( const Services& ser){
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;
@@ -124,7 +123,6 @@ bool operator==( const Services& one,
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;
@@ -144,13 +142,13 @@ void Services::setRecHandle( int 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();
}
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
@@ -4,2 +4,3 @@
+#include <qmap.h>
#include <qvaluelist.h>
@@ -118,6 +119,7 @@ namespace OpieTooth {
- 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();
@@ -134,6 +136,5 @@ namespace OpieTooth {
private:
+ QMap<int, QString> m_classIds;
QString m_name;
int m_recHandle;
- QString m_classList;
- int m_classId;
QValueList<ProfileDescriptor> m_profiles;