-rw-r--r-- | core/obex/obexsend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index 1b19c6b..2931cf7 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp @@ -184,112 +184,112 @@ DeviceBox::DeviceBox( QWidget* parent ) } DeviceBox::~DeviceBox() { } int DeviceBox::addDevice( const QString& name, int dev, const QString& status ) { /* return a id for a range of devices */ int id = idFor ( dev ); DeviceItem item( name, status, dev,id ); m_dev.insert( id, item ); setText( allText() ); return id; } void DeviceBox::removeDevice( int id ) { if (!m_dev.contains(id) ) return; m_dev.remove( id ); setText( allText() ); } void DeviceBox::setStatus( int id, const QString& status ) { if ( !m_dev.contains(id) ) return; m_dev[id].setStatus(status ); setText( allText() ); } void DeviceBox::setSource( const QString& str ) { qWarning("SetSource:%d", str.toInt() ); int id = str.toInt(); emit selectedDevice( id, m_dev[id].device() ); } int DeviceBox::idFor ( int id ) { static int irId = 1501; static int irBT = 1001; static int irSr = 501; static int irEr = 0; int ret = -1; switch(id ) { case IrDa: ret = irId; irId++; break; case BT: ret = irBT; irBT++; break; case Search: ret = irSr; irSr++; break; case Error: ret = irEr; irEr++; break; } return ret; } QString DeviceBox::allText() { QString str; typedef QMap<int, DeviceItem> DeviceMap; for (QMap<int, DeviceItem>::Iterator it = m_dev.begin(); it != m_dev.end(); ++it ) { str += it.data().toString() + "<br>"; } return str; } DeviceItem::DeviceItem( const QString& name, const QString& status, int dev, int id) { m_name = name; m_status = status; m_dev = dev; m_id = id; } int DeviceItem::id()const { return m_id; } QString DeviceItem::name()const { return m_name; } QString DeviceItem::status()const { return m_status; } int DeviceItem::device()const { return m_dev; } QString DeviceItem::pixmap()const{ QString str; switch(m_dev) { case DeviceBox::IrDa: str ="obex/irda"; break; case DeviceBox::BT: str ="obex/bt"; break; case DeviceBox::Search: - str = "obex/search"; + str = "mag"; break; case DeviceBox::Error: str = "editdelete"; break; }; return str; } DeviceItem::~DeviceItem() { } void DeviceItem::setStatus(const QString& status ) { m_status = status; } QString DeviceItem::toString()const { return "<p><a href=\""+QString::number(m_id) +"\" ><img src=\""+pixmap()+"\" >"+m_name+" "+m_status+" </a></p>" ; } |