summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp26
-rw-r--r--noncore/net/opietooth/manager/hciconfwrapper.cpp18
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp12
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp17
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp9
5 files changed, 41 insertions, 41 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index b15e692..449fdf1 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,63 +1,67 @@
1#include <qt.h>
2 1
2#include "composemail.h"
3
4#include <libmailwrapper/smtpwrapper.h>
5#include <libmailwrapper/storemail.h>
6#include <libmailwrapper/abstractmail.h>
7#include <libmailwrapper/mailtypes.h>
8
9/* OPIE */
3#include <opie2/ofiledialog.h> 10#include <opie2/ofiledialog.h>
4#include <opie2/odebug.h> 11#include <opie2/odebug.h>
5#include <qpe/resource.h> 12#include <qpe/resource.h>
6#include <qpe/config.h> 13#include <qpe/config.h>
7#include <qpe/global.h> 14#include <qpe/global.h>
8#include <qpe/contact.h> 15#include <qpe/contact.h>
9 16
10#include "composemail.h" 17/* QT */
18#include <qt.h>
11 19
12#include <libmailwrapper/smtpwrapper.h>
13#include <libmailwrapper/storemail.h>
14#include <libmailwrapper/abstractmail.h>
15#include <libmailwrapper/mailtypes.h>
16 20
17using namespace Opie::Core; 21using namespace Opie::Core;
18using namespace Opie::Ui; 22using namespace Opie::Ui;
19ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 23ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
20 : ComposeMailUI( parent, name, modal, flags ) 24 : ComposeMailUI( parent, name, modal, flags )
21{ 25{
22 settings = s; 26 settings = s;
23 m_replyid = ""; 27 m_replyid = "";
24 28
25 QString vfilename = Global::applicationFileName("addressbook", 29 QString vfilename = Global::applicationFileName("addressbook",
26 "businesscard.vcf"); 30 "businesscard.vcf");
27 Contact c; 31 Contact c;
28 if (QFile::exists(vfilename)) { 32 if (QFile::exists(vfilename)) {
29 c = Contact::readVCard( vfilename )[0]; 33 c = Contact::readVCard( vfilename )[0];
30 } 34 }
31 35
32 QStringList mails = c.emailList(); 36 QStringList mails = c.emailList();
33 QString defmail = c.defaultEmail(); 37 QString defmail = c.defaultEmail();
34 38
35 if (defmail.length()!=0) { 39 if (defmail.length()!=0) {
36 fromBox->insertItem(defmail); 40 fromBox->insertItem(defmail);
37 } 41 }
38 QStringList::ConstIterator sit = mails.begin(); 42 QStringList::ConstIterator sit = mails.begin();
39 for (;sit!=mails.end();++sit) { 43 for (;sit!=mails.end();++sit) {
40 if ( (*sit)==defmail) 44 if ( (*sit)==defmail)
41 continue; 45 continue;
42 fromBox->insertItem((*sit)); 46 fromBox->insertItem((*sit));
43 } 47 }
44 senderNameEdit->setText(c.firstName()+" "+c.lastName()); 48 senderNameEdit->setText(c.firstName()+" "+c.lastName());
45 Config cfg( "mail" ); 49 Config cfg( "mail" );
46 cfg.setGroup( "Compose" ); 50 cfg.setGroup( "Compose" );
47 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 51 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
48 52
49 attList->addColumn( tr( "Name" ) ); 53 attList->addColumn( tr( "Name" ) );
50 attList->addColumn( tr( "Size" ) ); 54 attList->addColumn( tr( "Size" ) );
51 55
52 QList<Account> accounts = settings->getAccounts(); 56 QList<Account> accounts = settings->getAccounts();
53 57
54 Account *it; 58 Account *it;
55 for ( it = accounts.first(); it; it = accounts.next() ) { 59 for ( it = accounts.first(); it; it = accounts.next() ) {
56 if ( it->getType()==MAILLIB::A_SMTP ) { 60 if ( it->getType()==MAILLIB::A_SMTP ) {
57 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 61 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
58 smtpAccountBox->insertItem( smtp->getAccountName() ); 62 smtpAccountBox->insertItem( smtp->getAccountName() );
59 smtpAccounts.append( smtp ); 63 smtpAccounts.append( smtp );
60 } 64 }
61 } 65 }
62 66
63 if ( smtpAccounts.count() > 0 ) { 67 if ( smtpAccounts.count() > 0 ) {
@@ -139,165 +143,165 @@ void ComposeMail::fillValues( int )
139 ccLine->setText( smtp->getCC() ); 143 ccLine->setText( smtp->getCC() );
140 } 144 }
141 bccLine->clear(); 145 bccLine->clear();
142 if ( smtp->getUseBCC() ) { 146 if ( smtp->getUseBCC() ) {
143 bccLine->setText( smtp->getBCC() ); 147 bccLine->setText( smtp->getBCC() );
144 } 148 }
145 replyLine->clear(); 149 replyLine->clear();
146 if ( smtp->getUseReply() ) { 150 if ( smtp->getUseReply() ) {
147 replyLine->setText( smtp->getReply() ); 151 replyLine->setText( smtp->getReply() );
148 } 152 }
149 sigMultiLine->setText( smtp->getSignature() ); 153 sigMultiLine->setText( smtp->getSignature() );
150#endif 154#endif
151} 155}
152 156
153void ComposeMail::slotAdjustColumns() 157void ComposeMail::slotAdjustColumns()
154{ 158{
155 int currPage = tabWidget->currentPageIndex(); 159 int currPage = tabWidget->currentPageIndex();
156 160
157 tabWidget->showPage( attachTab ); 161 tabWidget->showPage( attachTab );
158 attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); 162 attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
159 attList->setColumnWidth( 1, 80 ); 163 attList->setColumnWidth( 1, 80 );
160 164
161 tabWidget->setCurrentPage( currPage ); 165 tabWidget->setCurrentPage( currPage );
162} 166}
163 167
164void ComposeMail::addAttachment() 168void ComposeMail::addAttachment()
165{ 169{
166 DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" ); 170 DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" );
167 if ( !lnk.name().isEmpty() ) { 171 if ( !lnk.name().isEmpty() ) {
168 Attachment *att = new Attachment( lnk ); 172 Attachment *att = new Attachment( lnk );
169 (void) new AttachViewItem( attList, att ); 173 (void) new AttachViewItem( attList, att );
170 } 174 }
171} 175}
172 176
173void ComposeMail::removeAttachment() 177void ComposeMail::removeAttachment()
174{ 178{
175 if ( !attList->currentItem() ) { 179 if ( !attList->currentItem() ) {
176 QMessageBox::information( this, tr( "Error" ), 180 QMessageBox::information( this, tr( "Error" ),
177 tr( "<p>Please select a File.</p>" ), 181 tr( "<p>Please select a File.</p>" ),
178 tr( "Ok" ) ); 182 tr( "Ok" ) );
179 } else { 183 } else {
180 attList->takeItem( attList->currentItem() ); 184 attList->takeItem( attList->currentItem() );
181 } 185 }
182} 186}
183 187
184void ComposeMail::accept() 188void ComposeMail::accept()
185{ 189{
186 if ( checkBoxLater->isChecked() ) { 190 if ( checkBoxLater->isChecked() ) {
187 odebug << "Send later" << oendl; 191 odebug << "Send later" << oendl;
188 } 192 }
189 193
190#if 0 194#if 0
191 qDebug( "Sending Mail with " + 195 odebug << "Sending Mail with "
192 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 196 << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl;
193#endif 197#endif
194 Opie::Core::OSmartPointer<Mail> mail=new Mail; 198 Opie::Core::OSmartPointer<Mail> mail=new Mail;
195 199
196 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 200 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
197 mail->setMail(fromBox->currentText()); 201 mail->setMail(fromBox->currentText());
198 202
199 if ( !toLine->text().isEmpty() ) { 203 if ( !toLine->text().isEmpty() ) {
200 mail->setTo( toLine->text() ); 204 mail->setTo( toLine->text() );
201 } else { 205 } else {
202 QMessageBox::warning(0,tr("Sending mail"), 206 QMessageBox::warning(0,tr("Sending mail"),
203 tr("No Receiver spezified" ) ); 207 tr("No Receiver spezified" ) );
204 return; 208 return;
205 } 209 }
206 mail->setName(senderNameEdit->text()); 210 mail->setName(senderNameEdit->text());
207 mail->setCC( ccLine->text() ); 211 mail->setCC( ccLine->text() );
208 mail->setBCC( bccLine->text() ); 212 mail->setBCC( bccLine->text() );
209 mail->setReply( replyLine->text() ); 213 mail->setReply( replyLine->text() );
210 mail->setSubject( subjectLine->text() ); 214 mail->setSubject( subjectLine->text() );
211 if (!m_replyid.isEmpty()) { 215 if (!m_replyid.isEmpty()) {
212 QStringList ids; 216 QStringList ids;
213 ids.append(m_replyid); 217 ids.append(m_replyid);
214 mail->setInreply(ids); 218 mail->setInreply(ids);
215 } 219 }
216 QString txt = message->text(); 220 QString txt = message->text();
217 if ( !sigMultiLine->text().isEmpty() ) { 221 if ( !sigMultiLine->text().isEmpty() ) {
218 txt.append( "\n--\n" ); 222 txt.append( "\n--\n" );
219 txt.append( sigMultiLine->text() ); 223 txt.append( sigMultiLine->text() );
220 } 224 }
221 mail->setMessage( txt ); 225 mail->setMessage( txt );
222 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 226 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
223 while ( it != NULL ) { 227 while ( it != NULL ) {
224 mail->addAttachment( it->getAttachment() ); 228 mail->addAttachment( it->getAttachment() );
225 it = (AttachViewItem *) it->nextSibling(); 229 it = (AttachViewItem *) it->nextSibling();
226 } 230 }
227 231
228 SMTPwrapper wrapper( smtp ); 232 SMTPwrapper wrapper( smtp );
229 wrapper.sendMail( mail,checkBoxLater->isChecked() ); 233 wrapper.sendMail( mail,checkBoxLater->isChecked() );
230 234
231 QDialog::accept(); 235 QDialog::accept();
232} 236}
233 237
234void ComposeMail::reject() 238void ComposeMail::reject()
235{ 239{
236 int yesno = QMessageBox::warning(0,tr("Store message"), 240 int yesno = QMessageBox::warning(0,tr("Store message"),
237 tr("Store message into drafts?"), 241 tr("Store message into drafts?"),
238 tr("Yes"), 242 tr("Yes"),
239 tr("No"),QString::null,0,1); 243 tr("No"),QString::null,0,1);
240 244
241 if (yesno == 0) { 245 if (yesno == 0) {
242 Opie::Core::OSmartPointer<Mail> mail=new Mail(); 246 Opie::Core::OSmartPointer<Mail> mail=new Mail();
243 mail->setMail(fromBox->currentText()); 247 mail->setMail(fromBox->currentText());
244 mail->setTo( toLine->text() ); 248 mail->setTo( toLine->text() );
245 mail->setName(senderNameEdit->text()); 249 mail->setName(senderNameEdit->text());
246 mail->setCC( ccLine->text() ); 250 mail->setCC( ccLine->text() );
247 mail->setBCC( bccLine->text() ); 251 mail->setBCC( bccLine->text() );
248 mail->setReply( replyLine->text() ); 252 mail->setReply( replyLine->text() );
249 mail->setSubject( subjectLine->text() ); 253 mail->setSubject( subjectLine->text() );
250 if (!m_replyid.isEmpty()) { 254 if (!m_replyid.isEmpty()) {
251 QStringList ids; 255 QStringList ids;
252 ids.append(m_replyid); 256 ids.append(m_replyid);
253 mail->setInreply(ids); 257 mail->setInreply(ids);
254 } 258 }
255 QString txt = message->text(); 259 QString txt = message->text();
256 if ( !sigMultiLine->text().isEmpty() ) { 260 if ( !sigMultiLine->text().isEmpty() ) {
257 txt.append( "\n--\n" ); 261 txt.append( "\n--\n" );
258 txt.append( sigMultiLine->text() ); 262 txt.append( sigMultiLine->text() );
259 } 263 }
260 odebug << txt << oendl; 264 odebug << txt << oendl;
261 mail->setMessage( txt ); 265 mail->setMessage( txt );
262 266
263 /* only use the default drafts folder name! */ 267 /* only use the default drafts folder name! */
264 Storemail wrapper(AbstractMail::draftFolder()); 268 Storemail wrapper(AbstractMail::draftFolder());
265 wrapper.storeMail(mail); 269 wrapper.storeMail(mail);
266 270
267 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 271 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
268 /* attachments we will ignore! */ 272 /* attachments we will ignore! */
269 if ( it != NULL ) { 273 if ( it != NULL ) {
270 QMessageBox::warning(0,tr("Store message"), 274 QMessageBox::warning(0,tr("Store message"),
271 tr("<center>Attachments will not be stored in \"Draft\" folder</center>")); 275 tr("<center>Attachments will not be stored in \"Draft\" folder</center>"));
272 } 276 }
273 } 277 }
274 QDialog::reject(); 278 QDialog::reject();
275} 279}
276 280
277ComposeMail::~ComposeMail() 281ComposeMail::~ComposeMail()
278{ 282{
279} 283}
280 284
281void ComposeMail::reEditMail(const RecMailP&current) 285void ComposeMail::reEditMail(const RecMailP&current)
282{ 286{
283 RecMailP data = current; 287 RecMailP data = current;
284 message->setText(data->Wrapper()->fetchBody(current)->Bodytext()); 288 message->setText(data->Wrapper()->fetchBody(current)->Bodytext());
285 subjectLine->setText( data->getSubject()); 289 subjectLine->setText( data->getSubject());
286 toLine->setText(data->To().join(",")); 290 toLine->setText(data->To().join(","));
287 ccLine->setText(data->CC().join(",")); 291 ccLine->setText(data->CC().join(","));
288 bccLine->setText(data->Bcc().join(",")); 292 bccLine->setText(data->Bcc().join(","));
289 replyLine->setText(data->Replyto()); 293 replyLine->setText(data->Replyto());
290} 294}
291 295
292AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 296AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
293 : QListViewItem( parent ) 297 : QListViewItem( parent )
294{ 298{
295 attachment = att; 299 attachment = att;
296 odebug << att->getMimeType() << oendl; 300 odebug << att->getMimeType() << oendl;
297 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? 301 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
298 Resource::loadPixmap( "UnknownDocument-14" ) : 302 Resource::loadPixmap( "UnknownDocument-14" ) :
299 attachment->getDocLnk().pixmap() ); 303 attachment->getDocLnk().pixmap() );
300 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); 304 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
301 setText( 1, QString::number( att->getSize() ) ); 305 setText( 1, QString::number( att->getSize() ) );
302} 306}
303 307
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp
index ca2e7bd..47e170e 100644
--- a/noncore/net/opietooth/manager/hciconfwrapper.cpp
+++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp
@@ -1,142 +1,142 @@
1#include "hciconfwrapper.h" 1#include "hciconfwrapper.h"
2 2
3#include <qfile.h> 3#include <qfile.h>
4#include <qtextstream.h> 4#include <qtextstream.h>
5#include <qregexp.h> 5#include <qregexp.h>
6 6
7#include <opie2/odebug.h> 7#include <opie2/odebug.h>
8using namespace Opie::Core; 8using namespace Opie::Core;
9 9
10namespace OpieTooth { 10namespace OpieTooth {
11 11
12 12
13 HciConfWrapper::HciConfWrapper( const QString &fileName) { 13 HciConfWrapper::HciConfWrapper( const QString &fileName) {
14 m_fileName = fileName; 14 m_fileName = fileName;
15 } 15 }
16 16
17 HciConfWrapper::~HciConfWrapper() { 17 HciConfWrapper::~HciConfWrapper() {
18 } 18 }
19 19
20 20
21 void HciConfWrapper::setPinHelper( const QString& app ) { 21 void HciConfWrapper::setPinHelper( const QString& app ) {
22 setValue( "pin_helper" , app ); 22 setValue( "pin_helper" , app );
23 } 23 }
24 24
25 void HciConfWrapper::setName( const QString &name ) { 25 void HciConfWrapper::setName( const QString &name ) {
26 qDebug ("NAME : " + name); 26 odebug << "NAME : " << name << oendl;
27 setValue( "name" , "\"" + name + "\"" ); 27 setValue( "name" , "\"" + name + "\"" );
28 } 28 }
29 29
30 void HciConfWrapper::setIscan( bool enable) { 30 void HciConfWrapper::setIscan( bool enable) {
31 31
32 if ( enable ) { 32 if ( enable ) {
33 setValue( "iscan" , "enable" ); 33 setValue( "iscan" , "enable" );
34 } else { 34 } else {
35 setValue( "iscan" , "disable" ); 35 setValue( "iscan" , "disable" );
36 } 36 }
37 } 37 }
38 38
39 void HciConfWrapper::setPscan( bool enable) { 39 void HciConfWrapper::setPscan( bool enable) {
40 40
41 if ( enable ) { 41 if ( enable ) {
42 setValue( "pscan" , "enable" ); 42 setValue( "pscan" , "enable" );
43 } else { 43 } else {
44 setValue( "pscan" , "disable" ); 44 setValue( "pscan" , "disable" );
45 } 45 }
46 } 46 }
47 47
48 48
49 void HciConfWrapper::setAuth( bool enable) { 49 void HciConfWrapper::setAuth( bool enable) {
50 50
51 if ( enable ) { 51 if ( enable ) {
52 setValue( "auth" , "enable" ); 52 setValue( "auth" , "enable" );
53 } else { 53 } else {
54 setValue( "auth" , "disable" ); 54 setValue( "auth" , "disable" );
55 } 55 }
56 } 56 }
57 57
58 58
59 void HciConfWrapper::setEncrypt( bool enable) { 59 void HciConfWrapper::setEncrypt( bool enable) {
60 60
61 if ( enable ) { 61 if ( enable ) {
62 setValue( "encrypt" , "enable" ); 62 setValue( "encrypt" , "enable" );
63 } else { 63 } else {
64 setValue( "encrypt" , "disable" ); 64 setValue( "encrypt" , "disable" );
65 } 65 }
66 } 66 }
67 67
68 68
69 void HciConfWrapper::setValue(const QString &key, const QString &value ) { 69 void HciConfWrapper::setValue(const QString &key, const QString &value ) {
70 70
71 if (m_file.isEmpty() ) // load first 71 if (m_file.isEmpty() ) // load first
72 return; 72 return;
73 73
74 QStringList::Iterator it; 74 QStringList::Iterator it;
75 75
76 QString str; 76 QString str;
77 for (it = m_file.begin(); it != m_file.end(); ++it ) { 77 for (it = m_file.begin(); it != m_file.end(); ++it ) {
78 str = (*it); 78 str = (*it);
79 if( (str.contains(key)) > 0 ) { 79 if( (str.contains(key)) > 0 ) {
80 odebug << "Found" << oendl; 80 odebug << "Found" << oendl;
81 // still need to look if its commented out!!! 81 // still need to look if its commented out!!!
82 str.simplifyWhiteSpace(); 82 str.simplifyWhiteSpace();
83 odebug << key << oendl; 83 odebug << key << oendl;
84 if (str.startsWith("#")) { 84 if (str.startsWith("#")) {
85 str = (key + " " + value + ";"); 85 str = (key + " " + value + ";");
86 } else { 86 } else {
87 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";"); 87 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";");
88 } 88 }
89 odebug << str << oendl; 89 odebug << str << oendl;
90 it = m_file.remove( it ); 90 it = m_file.remove( it );
91 it = m_file.insert( it, str ); 91 it = m_file.insert( it, str );
92 //return; the regexp is too wide -zecke // all set 92 //return; the regexp is too wide -zecke // all set
93 } 93 }
94 } 94 }
95 95
96 96
97 } 97 }
98 98
99 /** 99 /**
100 * This loads the config file and stores it inside 100 * This loads the config file and stores it inside
101 * the m_file 101 * the m_file
102 */ 102 */
103 void HciConfWrapper::load() { 103 void HciConfWrapper::load() {
104 owarn << "loaded" << oendl; 104 owarn << "loaded" << oendl;
105 m_file.clear(); 105 m_file.clear();
106 QFile file( m_fileName ); 106 QFile file( m_fileName );
107 if (!file.open( IO_ReadOnly ) ) { 107 if (!file.open( IO_ReadOnly ) ) {
108 odebug << "Could not open" << oendl; 108 odebug << "Could not open" << oendl;
109 return; 109 return;
110 } 110 }
111 111
112 /** 112 /**
113 * readAll() into a QByteArray 113 * readAll() into a QByteArray
114 * QStringList::split('\n', array ) 114 * QStringList::split('\n', array )
115 * would this be faster? -zecke 115 * would this be faster? -zecke
116 */ 116 */
117 QTextStream stream(&file ); 117 QTextStream stream(&file );
118 QString tmp; 118 QString tmp;
119 while ( !stream.atEnd() ) { 119 while ( !stream.atEnd() ) {
120 tmp = stream.readLine(); 120 tmp = stream.readLine();
121 m_file.append( tmp ); 121 m_file.append( tmp );
122 } 122 }
123 } 123 }
124 void HciConfWrapper::save() { 124 void HciConfWrapper::save() {
125 owarn << "save" << oendl; 125 owarn << "save" << oendl;
126 if (m_file.isEmpty() ) // load first 126 if (m_file.isEmpty() ) // load first
127 return; 127 return;
128 128
129 QFile file( m_fileName ); 129 QFile file( m_fileName );
130 if ( !file.open(IO_WriteOnly ) ) { 130 if ( !file.open(IO_WriteOnly ) ) {
131 owarn << "could not open " << m_fileName.latin1() << "" << oendl; 131 owarn << "could not open " << m_fileName.latin1() << "" << oendl;
132 return; 132 return;
133 } 133 }
134 134
135 QTextStream stream(&file ); 135 QTextStream stream(&file );
136 QStringList::Iterator it; 136 QStringList::Iterator it;
137 for ( it = m_file.begin(); it != m_file.end(); ++it ) { 137 for ( it = m_file.begin(); it != m_file.end(); ++it ) {
138 stream << (*it) << endl; 138 stream << (*it) << endl;
139 } 139 }
140 owarn << "saved" << oendl; 140 owarn << "saved" << oendl;
141 }; 141 };
142} 142}
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index 1f7ba65..f82d2c8 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -49,68 +49,68 @@ RfCommConfHandler::RfCommConfHandler( const QString & filename ) {
49RfCommConfHandler::~RfCommConfHandler() { 49RfCommConfHandler::~RfCommConfHandler() {
50 50
51} 51}
52 52
53void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) { 53void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) {
54 54
55 QFile rfCommConf( "/tmp/test" ); 55 QFile rfCommConf( "/tmp/test" );
56 QTextStream outStream( &rfCommConf ); 56 QTextStream outStream( &rfCommConf );
57 if ( rfCommConf.open( IO_WriteOnly ) ) { 57 if ( rfCommConf.open( IO_WriteOnly ) ) {
58 58
59 QMap<QString, RfCommConfObject*>::Iterator it; 59 QMap<QString, RfCommConfObject*>::Iterator it;
60 for( it = devices.begin(); it != devices.end(); ++it ) { 60 for( it = devices.begin(); it != devices.end(); ++it ) {
61 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n"; 61 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n";
62 outStream << " device " + it.data()->mac() + ";\n"; 62 outStream << " device " + it.data()->mac() + ";\n";
63 outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n"; 63 outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
64 outStream << " comment \"" + it.data()->comment() + "\";\n"; 64 outStream << " comment \"" + it.data()->comment() + "\";\n";
65 outStream << "}\n\n"; 65 outStream << "}\n\n";
66 } 66 }
67 67
68 rfCommConf.close(); 68 rfCommConf.close();
69 } 69 }
70} 70}
71 71
72 72
73QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() { 73QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() {
74 return m_foundEntries; 74 return m_foundEntries;
75} 75}
76 76
77void RfCommConfHandler::load() { 77void RfCommConfHandler::load() {
78 78
79 QFile rfCommConf( m_filename ); 79 QFile rfCommConf( m_filename );
80 if ( rfCommConf.open( IO_ReadOnly ) ) { 80 if ( rfCommConf.open( IO_ReadOnly ) ) {
81 81
82 QStringList list; 82 QStringList list;
83 QTextStream inStream( &rfCommConf ); 83 QTextStream inStream( &rfCommConf );
84 list = QStringList::split( "\n", inStream.read() ); 84 list = QStringList::split( "\n", inStream.read() );
85 85
86 QString number; 86 QString number;
87 QString mac; 87 QString mac;
88 QString channel; 88 QString channel;
89 QString comment; 89 QString comment;
90 90
91 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) { 91 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
92 92
93 QString tmpLine = ( *line ).stripWhiteSpace(); 93 QString tmpLine = ( *line ).stripWhiteSpace();
94 94
95 if ( tmpLine.startsWith("rfcomm") ) { 95 if ( tmpLine.startsWith("rfcomm") ) {
96 QString number = tmpLine.mid( 6,1 ); 96 QString number = tmpLine.mid( 6,1 );
97 odebug << tmpLine << oendl; 97 odebug << tmpLine << oendl;
98 odebug << "TEST " + number << oendl; 98 odebug << "TEST " + number << oendl;
99 } else if ( tmpLine.startsWith( "}" ) ) { 99 } else if ( tmpLine.startsWith( "}" ) ) {
100 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) ); 100 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
101 } else if ( tmpLine.startsWith( "device" ) ) { 101 } else if ( tmpLine.startsWith( "device" ) ) {
102 mac = tmpLine.mid( 7, 17 ); 102 mac = tmpLine.mid( 7, 17 );
103 odebug << "mac" + mac << oendl; 103 odebug << "mac" + mac << oendl;
104 } else if ( tmpLine.startsWith( "channel" ) ) { 104 } else if ( tmpLine.startsWith( "channel" ) ) {
105 channel = tmpLine.mid( 8, 1 ); 105 channel = tmpLine.mid( 8, 1 );
106 qDebug ( "Channel :" + channel ); 106 odebug << "Channel :" << channel << oendl;
107 } else if ( tmpLine.startsWith( "comment" ) ) { 107 } else if ( tmpLine.startsWith( "comment" ) ) {
108 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 ); 108 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
109 odebug << "Comment: " + comment << oendl; 109 odebug << "Comment: " + comment << oendl;
110 } 110 }
111 } 111 }
112 rfCommConf.close(); 112 rfCommConf.close();
113 } 113 }
114 save( m_foundEntries ); 114 save( m_foundEntries );
115 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl; 115 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
116} 116}
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index c605111..9e8aa72 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -84,98 +84,99 @@ MScanListView::MScanListView( QWidget* parent, const char* name )
84 84
85 connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), 85 connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
86 this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); 86 this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) );
87 87
88 #ifdef QWS 88 #ifdef QWS
89 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 89 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
90 #endif 90 #endif
91 91
92}; 92};
93 93
94 94
95MScanListView::~MScanListView() 95MScanListView::~MScanListView()
96{ 96{
97}; 97};
98 98
99 99
100OListViewItem* MScanListView::childFactory() 100OListViewItem* MScanListView::childFactory()
101{ 101{
102 return new MScanListItem( this ); 102 return new MScanListItem( this );
103} 103}
104 104
105 105
106void MScanListView::serializeTo( QDataStream& s) const 106void MScanListView::serializeTo( QDataStream& s) const
107{ 107{
108 odebug << "serializing MScanListView" << oendl; 108 odebug << "serializing MScanListView" << oendl;
109 OListView::serializeTo( s ); 109 OListView::serializeTo( s );
110} 110}
111 111
112 112
113void MScanListView::serializeFrom( QDataStream& s) 113void MScanListView::serializeFrom( QDataStream& s)
114{ 114{
115 odebug << "serializing MScanListView" << oendl; 115 odebug << "serializing MScanListView" << oendl;
116 OListView::serializeFrom( s ); 116 OListView::serializeFrom( s );
117} 117}
118 118
119 119
120void MScanListView::addNewItem( const QString& type, 120void MScanListView::addNewItem( const QString& type,
121 const QString& essid, 121 const QString& essid,
122 const OMacAddress& mac, 122 const OMacAddress& mac,
123 bool wep, 123 bool wep,
124 int channel, 124 int channel,
125 int signal, 125 int signal,
126 const GpsLocation& loc, 126 const GpsLocation& loc,
127 bool probe ) 127 bool probe )
128{ 128{
129 QString macaddr = mac.toString(true); 129 QString macaddr = mac.toString(true);
130 130
131 #ifdef DEBUG 131 #ifdef DEBUG
132 qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, 132 odebug << "MScanList::addNewItem( " << (const char*) type << " / "
133 (const char*) essid, (const char*) macaddr, channel ); 133 << (const char*) essid << " / " << (const char*) macaddr
134 << " [" << channel << "]" << oendl;
134 #endif 135 #endif
135 136
136 // search, if we already have seen this net 137 // search, if we already have seen this net
137 138
138 QString s; 139 QString s;
139 MScanListItem* network; 140 MScanListItem* network;
140 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); 141 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() );
141 142
142 while ( item && ( item->text( col_essid ) != essid ) ) 143 while ( item && ( item->text( col_essid ) != essid ) )
143 { 144 {
144 #ifdef DEBUG 145 #ifdef DEBUG
145 odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; 146 odebug << "itemtext: " << item->text( col_essid ) << "" << oendl;
146 #endif 147 #endif
147 item = static_cast<MScanListItem*> ( item->nextSibling() ); 148 item = static_cast<MScanListItem*> ( item->nextSibling() );
148 } 149 }
149 if ( item ) 150 if ( item )
150 { 151 {
151 // we have already seen this net, check all childs if MAC exists 152 // we have already seen this net, check all childs if MAC exists
152 153
153 network = item; 154 network = item;
154 155
155 item = static_cast<MScanListItem*> ( item->firstChild() ); 156 item = static_cast<MScanListItem*> ( item->firstChild() );
156 assert( item ); // this shouldn't fail 157 assert( item ); // this shouldn't fail
157 158
158 while ( item && ( item->text( col_ap ) != macaddr ) ) 159 while ( item && ( item->text( col_ap ) != macaddr ) )
159 { 160 {
160 #ifdef DEBUG 161 #ifdef DEBUG
161 odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl; 162 odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl;
162 #endif 163 #endif
163 item = static_cast<MScanListItem*> ( item->nextSibling() ); 164 item = static_cast<MScanListItem*> ( item->nextSibling() );
164 } 165 }
165 166
166 if ( item ) 167 if ( item )
167 { 168 {
168 // we have already seen this item, it's a dupe 169 // we have already seen this item, it's a dupe
169 #ifdef DEBUG 170 #ifdef DEBUG
170 odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; 171 odebug << "" << macaddr << " is a dupe - ignoring..." << oendl;
171 #endif 172 #endif
172 item->receivedBeacon(); 173 item->receivedBeacon();
173 return; 174 return;
174 } 175 }
175 } 176 }
176 else 177 else
177 { 178 {
178 s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); 179 s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid );
179 MLogWindow::logwindow()->log( s ); 180 MLogWindow::logwindow()->log( s );
180 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); 181 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe );
181 } 182 }
@@ -349,196 +350,194 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
349 // (Hmm, didn't I already start something in this direction?) 350 // (Hmm, didn't I already start something in this direction?)
350 351
351 QListViewItemIterator it( this ); 352 QListViewItemIterator it( this );
352 for ( ; it.current(); ++it ) 353 for ( ; it.current(); ++it )
353 { 354 {
354 if ( it.current()->text( col_ap ) == macaddr.toString(true) ) 355 if ( it.current()->text( col_ap ) == macaddr.toString(true) )
355 { 356 {
356 357
357 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); 358 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() );
358 359
359 while ( subitem && ( subitem->text( col_essid ) != name ) ) 360 while ( subitem && ( subitem->text( col_essid ) != name ) )
360 { 361 {
361 #ifdef DEBUG 362 #ifdef DEBUG
362 odebug << "subitemtext: " << subitem->text( col_essid ) << "" << oendl; 363 odebug << "subitemtext: " << subitem->text( col_essid ) << "" << oendl;
363 #endif 364 #endif
364 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 365 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
365 } 366 }
366 367
367 if ( subitem ) 368 if ( subitem )
368 { 369 {
369 // we have already seen this item, it's a dupe 370 // we have already seen this item, it's a dupe
370 #ifdef DEBUG 371 #ifdef DEBUG
371 odebug << "" << name << " is a dupe - ignoring..." << oendl; 372 odebug << "" << name << " is a dupe - ignoring..." << oendl;
372 #endif 373 #endif
373 subitem->receivedBeacon(); //FIXME: sent data bit 374 subitem->receivedBeacon(); //FIXME: sent data bit
374 return; 375 return;
375 } 376 }
376 377
377 // never seen that - add new item 378 // never seen that - add new item
378 379
379 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); 380 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 );
380 item->setText( col_essid, name ); 381 item->setText( col_essid, name );
381 382
382 return; 383 return;
383 } 384 }
384 } 385 }
385 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; 386 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
386 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", 387 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!",
387 (const char*) macaddr.toString(), (const char*) ip ) ); 388 (const char*) macaddr.toString(), (const char*) ip ) );
388} 389}
389 390
390 391
391void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) 392void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col )
392{ 393{
393 if ( !item ) return; 394 if ( !item ) return;
394 395
395 MScanListItem* itm = static_cast<MScanListItem*>( item ); 396 MScanListItem* itm = static_cast<MScanListItem*>( item );
396 397
397 qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'", 398 odebug << "contextMenuRequested on item '" << (const char*) itm->text(0) << "' ("
398 (const char*) itm->text(0), (const char*) itm->type, col ); 399 << (const char*) itm->type << ") in column: '" << col << "'" << oendl;
399 400
400 if ( itm->type == "adhoc" || itm->type == "managed" ) 401 if ( itm->type == "adhoc" || itm->type == "managed" )
401 { 402 {
402 QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); 403 QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() );
403 404
404 QPopupMenu m( this ); 405 QPopupMenu m( this );
405 m.insertItem( entry, 37773, 0 ); 406 m.insertItem( entry, 37773, 0 );
406 int result = m.exec( QCursor::pos() ); 407 int result = m.exec( QCursor::pos() );
407 if ( result == 37773 ) 408 if ( result == 37773 )
408 emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); 409 emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() );
409 } 410 }
410} 411}
411 412
412//============================================================ 413//============================================================
413// MScanListItem 414// MScanListItem
414//============================================================ 415//============================================================
415 416
416MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, 417MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
417 bool wep, int channel, int signal, bool probed ) 418 bool wep, int channel, int signal, bool probed )
418 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), 419 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
419 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), 420 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
420 _channel( channel ), _signal( signal ), _beacons( 1 ) 421 _channel( channel ), _signal( signal ), _beacons( 1 )
421{ 422{
422 #ifdef DEBUG 423 #ifdef DEBUG
423 odebug << "creating scanlist item" << oendl; 424 odebug << "creating scanlist item" << oendl;
424 #endif 425 #endif
425 426
426 if ( WellenreiterConfigWindow::instance() ) 427 if ( WellenreiterConfigWindow::instance() )
427 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 428 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
428 429
429 decorateItem( type, essid, macaddr, wep, channel, signal, probed ); 430 decorateItem( type, essid, macaddr, wep, channel, signal, probed );
430} 431}
431 432
432MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, 433MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
433 bool wep, int channel, int signal ) 434 bool wep, int channel, int signal )
434 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 435 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
435{ 436{
436 #ifdef DEBUG 437 #ifdef DEBUG
437 odebug << "creating scanlist item" << oendl; 438 odebug << "creating scanlist item" << oendl;
438 #endif 439 #endif
439 if ( WellenreiterConfigWindow::instance() ) 440 if ( WellenreiterConfigWindow::instance() )
440 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 441 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
441 442
442 decorateItem( type, essid, macaddr, wep, channel, signal, false ); 443 decorateItem( type, essid, macaddr, wep, channel, signal, false );
443} 444}
444 445
445const QString& MScanListItem::essid() const 446const QString& MScanListItem::essid() const
446{ 447{
447 if ( type == "network" ) 448 if ( type == "network" )
448 return _essid; 449 return _essid;
449 else 450 else
450 return ( (MScanListItem*) parent() )->essid(); 451 return ( (MScanListItem*) parent() )->essid();
451} 452}
452 453
453OListViewItem* MScanListItem::childFactory() 454OListViewItem* MScanListItem::childFactory()
454{ 455{
455 return new MScanListItem( this ); 456 return new MScanListItem( this );
456} 457}
457 458
458void MScanListItem::serializeTo( QDataStream& s ) const 459void MScanListItem::serializeTo( QDataStream& s ) const
459{ 460{
460 #ifdef DEBUG 461 #ifdef DEBUG
461 odebug << "serializing MScanListItem" << oendl; 462 odebug << "serializing MScanListItem" << oendl;
462 #endif 463 #endif
463 OListViewItem::serializeTo( s ); 464 OListViewItem::serializeTo( s );
464 465
465 s << _type; 466 s << _type;
466 s << (Q_UINT8) ( _wep ? 'y' : 'n' ); 467 s << (Q_UINT8) ( _wep ? 'y' : 'n' );
467} 468}
468 469
469void MScanListItem::serializeFrom( QDataStream& s ) 470void MScanListItem::serializeFrom( QDataStream& s )
470{ 471{
471 #ifdef DEBUG 472 #ifdef DEBUG
472 odebug << "serializing MScanListItem" << oendl; 473 odebug << "serializing MScanListItem" << oendl;
473 #endif 474 #endif
474 OListViewItem::serializeFrom( s ); 475 OListViewItem::serializeFrom( s );
475 476
476 Q_UINT8 wep; 477 Q_UINT8 wep;
477 s >> _type; 478 s >> _type;
478 s >> wep; 479 s >> wep;
479 _wep = (wep == 'y'); 480 _wep = (wep == 'y');
480 481
481 QString name; 482 QString name;
482 name.sprintf( "wellenreiter/%s", (const char*) _type ); 483 name.sprintf( "wellenreiter/%s", (const char*) _type );
483 setPixmap( col_type, Resource::loadPixmap( name ) ); 484 setPixmap( col_type, Resource::loadPixmap( name ) );
484 if ( _wep ) 485 if ( _wep )
485 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 486 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
486 listView()->triggerUpdate(); 487 listView()->triggerUpdate();
487} 488}
488 489
489void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) 490void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed )
490{ 491{
491 #ifdef DEBUG 492 #ifdef DEBUG
492 qDebug( "decorating scanlist item %s / %s / %s [%d]", 493 odebug << "decorating scanlist item " << (const char*) type << " / "
493 (const char*) type, 494 << (const char*) essid << " / " << (const char*) macaddr
494 (const char*) essid, 495 << "[" << channel << "]" << oendl;
495 (const char*) macaddr,
496 channel );
497 #endif 496 #endif
498 497
499 // set icon for managed or adhoc mode 498 // set icon for managed or adhoc mode
500 QString name; 499 QString name;
501 name.sprintf( "wellenreiter/%s", (const char*) type ); 500 name.sprintf( "wellenreiter/%s", (const char*) type );
502 setPixmap( col_type, Resource::loadPixmap( name ) ); 501 setPixmap( col_type, Resource::loadPixmap( name ) );
503 502
504 // special case for probed networks FIXME: This is ugly at present 503 // special case for probed networks FIXME: This is ugly at present
505 if ( type == "network" && probed ) 504 if ( type == "network" && probed )
506 { 505 {
507 setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); 506 setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) );
508 } 507 }
509 508
510 // set icon for wep (wireless encryption protocol) 509 // set icon for wep (wireless encryption protocol)
511 if ( wep ) 510 if ( wep )
512 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 511 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
513 512
514 // set channel and signal text 513 // set channel and signal text
515 514
516 if ( signal != -1 ) 515 if ( signal != -1 )
517 setText( col_sig, QString::number( signal ) ); 516 setText( col_sig, QString::number( signal ) );
518 if ( channel != -1 ) 517 if ( channel != -1 )
519 setText( col_channel, QString::number( channel ) ); 518 setText( col_channel, QString::number( channel ) );
520 519
521 setText( col_firstseen, QTime::currentTime().toString() ); 520 setText( col_firstseen, QTime::currentTime().toString() );
522 //setText( col_lastseen, QTime::currentTime().toString() ); 521 //setText( col_lastseen, QTime::currentTime().toString() );
523 522
524 listView()->triggerUpdate(); 523 listView()->triggerUpdate();
525 524
526 this->type = type; 525 this->type = type;
527 _type = type; 526 _type = type;
528 _essid = essid; 527 _essid = essid;
529 _macaddr = macaddr; 528 _macaddr = macaddr;
530 _channel = channel; 529 _channel = channel;
531 _beacons = 1; 530 _beacons = 1;
532 _signal = 0; 531 _signal = 0;
533 532
534 if ( WellenreiterConfigWindow::instance()->openTree->isChecked() ) 533 if ( WellenreiterConfigWindow::instance()->openTree->isChecked() )
535 { 534 {
536 listView()->ensureItemVisible( this ); 535 listView()->ensureItemVisible( this );
537 } 536 }
538 537
539} 538}
540 539
541 540
542void MScanListItem::setManufacturer( const QString& manufacturer ) 541void MScanListItem::setManufacturer( const QString& manufacturer )
543{ 542{
544 setText( col_manuf, manufacturer ); 543 setText( col_manuf, manufacturer );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 2f85790..e801ce7 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -697,73 +697,70 @@ void Wellenreiter::timerEvent( QTimerEvent* )
697 else 697 else
698 { 698 {
699 receivePacket( p ); 699 receivePacket( p );
700 // We no longer delete packets here. Ownership of the packets is 700 // We no longer delete packets here. Ownership of the packets is
701 // transferred to the PacketView. 701 // transferred to the PacketView.
702 //delete p; 702 //delete p;
703 } 703 }
704} 704}
705 705
706 706
707void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) 707void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
708{ 708{
709 #ifdef QWS 709 #ifdef QWS
710 if ( action == "TouchSound" ) 710 if ( action == "TouchSound" )
711 ODevice::inst()->playTouchSound(); 711 ODevice::inst()->playTouchSound();
712 else if ( action == "AlarmSound" ) 712 else if ( action == "AlarmSound" )
713 ODevice::inst()->playAlarmSound(); 713 ODevice::inst()->playAlarmSound();
714 else if ( action == "KeySound" ) 714 else if ( action == "KeySound" )
715 ODevice::inst()->playKeySound(); 715 ODevice::inst()->playKeySound();
716 else if ( action == "LedOn" ) 716 else if ( action == "LedOn" )
717 ODevice::inst()->setLedState( Led_Mail, Led_On ); 717 ODevice::inst()->setLedState( Led_Mail, Led_On );
718 else if ( action == "LedOff" ) 718 else if ( action == "LedOff" )
719 ODevice::inst()->setLedState( Led_Mail, Led_Off ); 719 ODevice::inst()->setLedState( Led_Mail, Led_Off );
720 else if ( action == "LogMessage" ) 720 else if ( action == "LogMessage" )
721 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 721 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
722 else if ( action == "MessageBox" ) 722 else if ( action == "MessageBox" )
723 QMessageBox::information( this, "Notification!", 723 QMessageBox::information( this, "Notification!",
724 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 724 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
725 #else 725 #else
726 #warning Actions do not work with Qt/X11 yet 726 #warning Actions do not work with Qt/X11 yet
727 #endif 727 #endif
728} 728}
729 729
730void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) 730void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr)
731{ 731{
732 #ifdef QWS 732 #ifdef QWS
733 if ( !iface ) 733 if ( !iface )
734 { 734 {
735 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); 735 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) );
736 return; 736 return;
737 } 737 }
738 738
739 if ( sniffing ) 739 if ( sniffing )
740 { 740 {
741 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); 741 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) );
742 return; 742 return;
743 } 743 }
744 744
745 qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", 745 odebug << "joinNetwork() with Interface " << (const char*) iface->name()
746 (const char*) iface->name(), 746 << ": " << (const char*) type << ", " << (const char*) essid
747 (const char*) type, 747 << ", " << channel << ", " << (const char*) macaddr << oendl;
748 (const char*) essid,
749 channel,
750 (const char*) macaddr );
751 748
752 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); 749 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
753 int count = 3; 750 int count = 3;
754 odebug << "sending " << count << " messages" << oendl; 751 odebug << "sending " << count << " messages" << oendl;
755 msg << QString("count") << QString::number(count); 752 msg << QString("count") << QString::number(count);
756 odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; 753 odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl;
757 msg << QString(iface->name()) << QString("Mode") << type; 754 msg << QString(iface->name()) << QString("Mode") << type;
758 odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; 755 odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl;
759 msg << QString(iface->name()) << QString("ESSID") << essid; 756 msg << QString(iface->name()) << QString("ESSID") << essid;
760 odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl; 757 odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl;
761 msg << QString(iface->name()) << QString("Channel") << channel; 758 msg << QString(iface->name()) << QString("Channel") << channel;
762// odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; 759// odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl;
763// msg << QString(iface->name()) << QString("MacAddr") << macaddr; 760// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
764 #else 761 #else
765 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); 762 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) );
766 #endif 763 #endif
767 764
768} 765}
769 766