author | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
commit | d3f15e100af8a91504ac9e5fb95dce0cadfe4837 (patch) (side-by-side diff) | |
tree | 04ddeda0f690aa1d51ba486b114251250eef2ef9 /core/obex/obexsend.h | |
parent | 9f5098a6da637e81f6525482456394a68524dc61 (diff) | |
download | opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.zip opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.tar.gz opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.tar.bz2 |
Convert the way of storing the devices in the QTextBrowser
we assign ids by now
it looks soo nice... but it counts up tries and then say there was a failure
but it is working though
-rw-r--r-- | core/obex/obexsend.h | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/core/obex/obexsend.h b/core/obex/obexsend.h index fd819bc..02100f7 100644 --- a/core/obex/obexsend.h +++ b/core/obex/obexsend.h @@ -21,2 +21,14 @@ namespace OpieObex { class Obex; + + struct Pair { + Pair(const QString& first = QString::null, + const QString& second = QString::null) + : m_first(first), m_second(second ) { + } + QString first()const{ return m_first; } + QString second()const { return m_second; } + private: + QString m_first; + QString m_second; + }; class SendWidget : public QWidget{ @@ -40,3 +52,3 @@ namespace OpieObex { void slotBTDevices( const QMap<QString, QString>& ); - void slotSelectedDevice( const QString& name, int dev ); + void slotSelectedDevice( int id, int dev ); void dispatchIrda( const QCString& str, const QByteArray& ar ); @@ -55,6 +67,9 @@ namespace OpieObex { int m_start; - QStringList m_irDa; - QMap<QString, QString> m_bt; + QMap<int, QString> m_irDa; + QMap<int, QString>::Iterator m_irDaIt; + QMap<int, Pair > m_bt; QString m_file; Obex* m_obex; + int m_irDeSearch; // search of irda and bt devices + int m_btDeSearch; }; @@ -63,3 +78,3 @@ namespace OpieObex { DeviceItem( const QString& name = QString::null, - const QString& status = QString::null, int dev = 3); + const QString& status = QString::null, int dev = 3, int id = -1); ~DeviceItem(); @@ -71,2 +86,3 @@ namespace OpieObex { int device()const; + int id()const; QString toString()const; @@ -76,3 +92,9 @@ namespace OpieObex { int m_dev; + int m_id; }; + + /* + * The text field which contains the information about sending... + * + */ class DeviceBox : public QTextBrowser { @@ -85,12 +107,13 @@ namespace OpieObex { void setSource( const QString& str ); - void addDevice( const QString& name, int dev, + int addDevice( const QString& name, int dev, const QString& status = QString::null ); - void removeDevice( const QString& name ); - void setStatus( const QString& name, const QString& ); + void removeDevice( int ); + void setStatus( int, const QString& ); signals: - void selectedDevice( const QString& name, int dev ); + void selectedDevice( int id, int dev ); private: - QMap<QString, DeviceItem> m_dev; - QStringList m_devices; - + /* returns a id for a device from a device range */ + int idFor (int deviceType ); + QString allText(); + QMap<int, DeviceItem> m_dev; }; |