summaryrefslogtreecommitdiff
path: root/noncore/net
Side-by-side diff
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountitem.cpp18
-rw-r--r--noncore/net/mail/accountview.cpp12
-rw-r--r--noncore/net/mail/composemail.cpp6
-rw-r--r--noncore/net/mail/editaccounts.cpp22
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp8
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.cpp30
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp14
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp66
-rw-r--r--noncore/net/mail/libmailwrapper/logindialog.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.cpp22
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp60
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp8
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp18
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp30
-rw-r--r--noncore/net/mail/libmailwrapper/statusmail.cpp6
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.cpp4
-rw-r--r--noncore/net/mail/mainwindow.cpp14
-rw-r--r--noncore/net/mail/nntpgroups.cpp2
-rw-r--r--noncore/net/mail/opiemail.cpp16
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.cpp2
-rw-r--r--noncore/net/mail/viewmail.cpp2
-rw-r--r--noncore/net/opieftp/config.in2
-rw-r--r--noncore/net/opieftp/filePermissions.cpp2
-rw-r--r--noncore/net/opieftp/opieftp.cpp77
-rw-r--r--noncore/net/opieftp/opieftp.pro11
-rw-r--r--noncore/net/opieirc/config.in2
-rw-r--r--noncore/net/opieirc/ircmisc.cpp9
-rw-r--r--noncore/net/opieirc/opieirc.pro13
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp2
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp2
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp8
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp16
-rw-r--r--noncore/net/opietooth/manager/devicehandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/hciconfwrapper.cpp16
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/obexpopup.cpp4
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/popuphelper.cpp4
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp4
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp8
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp30
-rw-r--r--noncore/net/wellenreiter/gui/gps.cpp12
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp15
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp57
-rw-r--r--noncore/net/wellenreiter/gui/packetview.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/resource.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp77
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp74
56 files changed, 439 insertions, 434 deletions
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp
index 54d2da2..ae28313 100644
--- a/noncore/net/mail/accountitem.cpp
+++ b/noncore/net/mail/accountitem.cpp
@@ -69,25 +69,25 @@ void POP3viewItem::refresh()
QValueList<FolderP>::ConstIterator it;
QListViewItem*item = 0;
for ( it = folders->begin(); it!=folders->end(); ++it)
{
item = new POP3folderItem( (*it), this , item );
item->setSelectable( (*it)->may_select());
}
delete folders;
}
RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
{
- qDebug( "POP3 fetchBody" );
+ odebug << "POP3 fetchBody" << oendl;
return wrapper->fetchBody( mail );
}
QPopupMenu * POP3viewItem::getContextMenu()
{
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
if (!account->getOffline())
{
m->insertItem(QObject::tr("Disconnect",contextName),0);
m->insertItem(QObject::tr("Set offline",contextName),1);
@@ -260,25 +260,25 @@ void NNTPviewItem::refresh()
QValueList<FolderP>::ConstIterator it;
QListViewItem*item = 0;
for ( it = folders->begin(); it!=folders->end(); ++it)
{
item = new NNTPfolderItem( (*it), this , item );
item->setSelectable( (*it)->may_select());
}
delete folders;
}
RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail )
{
- qDebug( "NNTP fetchBody" );
+ odebug << "NNTP fetchBody" << oendl;
return wrapper->fetchBody( mail );
}
QPopupMenu * NNTPviewItem::getContextMenu()
{
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
if (!account->getOffline())
{
m->insertItem(QObject::tr("Disconnect",contextName),0);
m->insertItem(QObject::tr("Set offline",contextName),1);
@@ -451,25 +451,25 @@ void IMAPviewItem::refreshFolders(bool force)
QValueList<FolderP>::Iterator it;
QListViewItem*item = 0;
QListViewItem*titem = 0;
QString fname,del,search;
int pos;
for ( it = folders->begin(); it!=folders->end(); ++it)
{
if ((*it)->getDisplayName().lower()=="inbox")
{
item = new IMAPfolderItem( (*it), this , item );
folders->remove(it);
- qDebug("inbox found");
+ odebug << "inbox found" << oendl;
break;
}
}
for ( it = folders->begin(); it!=folders->end(); ++it)
{
fname = (*it)->getDisplayName();
currentFolders.append((*it)->getName());
pos = fname.findRev((*it)->Separator());
if (pos != -1)
{
fname = fname.left(pos);
}
@@ -524,25 +524,25 @@ void IMAPviewItem::createNewFolder()
{
delemiter = item->Delemiter();
}
if (wrapper->createMbox(ndir,0,delemiter,makesubs))
{
refreshFolders(true);
}
}
}
void IMAPviewItem::contextMenuSelected(int id)
{
- qDebug("Id selected: %i",id);
+ odebug << "Id selected: " << id << "" << oendl;
switch (id)
{
case 0:
refreshFolders(true);
break;
case 1:
createNewFolder();
break;
case 2:
removeChilds();
wrapper->logout();
break;
@@ -662,25 +662,25 @@ void IMAPfolderItem::createNewFolder()
{
imap->refreshFolders(true);
}
}
}
void IMAPfolderItem::deleteFolder()
{
int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
QObject::tr("Yes",contextName),
QObject::tr("No",contextName),QString::null,1,1);
- qDebug("Auswahl: %i",yesno);
+ odebug << "Auswahl: " << yesno << "" << oendl;
if (yesno == 0)
{
if (imap->getWrapper()->deleteMbox(folder))
{
QListView*v=listView();
IMAPviewItem * box = imap;
/* be carefull - after that this object is destroyd so don't use
* any member of it after that call!!*/
imap->refreshFolders(true);
if (v)
{
v->setSelected(box,true);
@@ -689,25 +689,25 @@ void IMAPfolderItem::deleteFolder()
}
}
void IMAPfolderItem::downloadMails()
{
AccountView*bl = imap->accountView();
if (!bl) return;
bl->downloadMails(folder,imap->getWrapper());
}
void IMAPfolderItem::contextMenuSelected(int id)
{
- qDebug("Selected id: %i",id);
+ odebug << "Selected id: " << id << "" << oendl;
AccountView * view = (AccountView*)listView();
switch(id)
{
case 0:
view->refreshCurrent();
break;
case 1:
deleteAllMail(imap->getWrapper(),folder);
break;
case 2:
createNewFolder();
break;
@@ -793,25 +793,25 @@ void MHviewItem::refresh(bool force)
}
else
{
item = new MHfolderItem( (*it), this , item );
}
item->setSelectable((*it)->may_select());
}
delete folders;
}
RECBODYP MHviewItem::fetchBody( const RecMailP &mail )
{
- qDebug( "MH fetchBody" );
+ odebug << "MH fetchBody" << oendl;
return wrapper->fetchBody( mail );
}
QPopupMenu * MHviewItem::getContextMenu()
{
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
m->insertItem(QObject::tr("Refresh folder list",contextName),0);
m->insertItem(QObject::tr("Create new folder",contextName),1);
m->insertItem(QObject::tr("Delete all mails",contextName),2);
m->insertItem(QObject::tr("Move/Copie all mails",contextName),3);
@@ -923,25 +923,25 @@ void MHfolderItem::refresh(QValueList<RecMailP>&target)
RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail)
{
return mbox->getWrapper()->fetchBody(aMail);
}
void MHfolderItem::deleteFolder()
{
int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
QObject::tr("Yes",contextName),
QObject::tr("No",contextName),QString::null,1,1);
- qDebug("Auswahl: %i",yesno);
+ odebug << "Auswahl: " << yesno << "" << oendl;
if (yesno == 0)
{
if (mbox->getWrapper()->deleteMbox(folder))
{
QListView*v=listView();
MHviewItem * box = mbox;
/* be carefull - after that this object is destroyd so don't use
* any member of it after that call!!*/
mbox->refresh(true);
if (v)
{
v->setSelected(box,true);
@@ -1065,25 +1065,25 @@ AccountView*AccountViewItem::accountView()
}
void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder)
{
if (!wrapper) return;
QString fname="";
if (folder) fname = folder->getDisplayName();
int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName),
QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName).
arg(fname),
QObject::tr("Yes",contextName),
QObject::tr("No",contextName),QString::null,1,1);
- qDebug("Auswahl: %i",yesno);
+ odebug << "Auswahl: " << yesno << "" << oendl;
if (yesno == 0)
{
if (wrapper->deleteAllMail(folder))
{
AccountView * view = (AccountView*)listView();
if (view) view->refreshCurrent();
}
}
}
void AccountViewItem::removeChilds()
{
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index f0a163e..0052061 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -57,48 +57,48 @@ void AccountView::populate( QList<Account> list )
imapAccounts.clear();
mhAccounts.clear();
mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this));
Account *it;
for ( it = list.first(); it; it = list.next() )
{
if ( it->getType() == MAILLIB::A_IMAP )
{
IMAPaccount *imap = static_cast<IMAPaccount *>(it);
- qDebug( "added IMAP " + imap->getAccountName() );
+ odebug << "added IMAP " + imap->getAccountName() << oendl;
imapAccounts.append(new IMAPviewItem( imap, this ));
}
else if ( it->getType() == MAILLIB::A_POP3 )
{
POP3account *pop3 = static_cast<POP3account *>(it);
- qDebug( "added POP3 " + pop3->getAccountName() );
+ odebug << "added POP3 " + pop3->getAccountName() << oendl;
/* must not be hold 'cause it isn't required */
(void) new POP3viewItem( pop3, this );
}
else if ( it->getType() == MAILLIB::A_NNTP )
{
NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
- qDebug( "added NNTP " + nntp->getAccountName() );
+ odebug << "added NNTP " + nntp->getAccountName() << oendl;
/* must not be hold 'cause it isn't required */
(void) new NNTPviewItem( nntp, this );
}
}
}
void AccountView::refresh(QListViewItem *item)
{
- qDebug("AccountView refresh...");
+ odebug << "AccountView refresh..." << oendl;
if ( item )
{
m_currentItem = item;
QValueList<RecMailP> headerlist;
AccountViewItem *view = static_cast<AccountViewItem *>(item);
view->refresh(headerlist);
emit refreshMailview(headerlist);
}
}
void AccountView::refreshCurrent()
{
@@ -153,24 +153,24 @@ void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrappe
targetFolder = sels.currentFolder();
if ( (fromWrapper==targetMail && fromFolder->getName()==targetFolder) ||
targetFolder.isEmpty())
{
return;
}
if (sels.newFolder() && !targetMail->createMbox(targetFolder))
{
QMessageBox::critical(0,tr("Error creating new Folder"),
tr("<center>Error while creating<br>new folder - breaking.</center>"));
return;
}
- qDebug("Targetfolder: %s",targetFolder.latin1());
- qDebug("Fromfolder: %s",fromFolder->getName().latin1());
+ odebug << "Targetfolder: " << targetFolder.latin1() << "" << oendl;
+ odebug << "Fromfolder: " << fromFolder->getName().latin1() << "" << oendl;
fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails());
refreshCurrent();
}
bool AccountView::currentisDraft()
{
AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
if (!view) return false;
return view->isDraftfolder();
}
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 988a1d9..fa703c4 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -174,25 +174,25 @@ void ComposeMail::removeAttachment()
if ( !attList->currentItem() ) {
QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select a File.</p>" ),
tr( "Ok" ) );
} else {
attList->takeItem( attList->currentItem() );
}
}
void ComposeMail::accept()
{
if ( checkBoxLater->isChecked() ) {
- qDebug( "Send later" );
+ odebug << "Send later" << oendl;
}
#if 0
qDebug( "Sending Mail with " +
smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
#endif
Opie::Core::OSmartPointer<Mail> mail=new Mail;
SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
mail->setMail(fromBox->currentText());
if ( !toLine->text().isEmpty() ) {
@@ -247,25 +247,25 @@ void ComposeMail::reject()
mail->setReply( replyLine->text() );
mail->setSubject( subjectLine->text() );
if (!m_replyid.isEmpty()) {
QStringList ids;
ids.append(m_replyid);
mail->setInreply(ids);
}
QString txt = message->text();
if ( !sigMultiLine->text().isEmpty() ) {
txt.append( "\n--\n" );
txt.append( sigMultiLine->text() );
}
- qDebug(txt);
+ odebug << txt << oendl;
mail->setMessage( txt );
/* only use the default drafts folder name! */
Storemail wrapper(AbstractMail::draftFolder());
wrapper.storeMail(mail);
AttachViewItem *it = (AttachViewItem *) attList->firstChild();
/* attachments we will ignore! */
if ( it != NULL ) {
QMessageBox::warning(0,tr("Store message"),
tr("<center>Attachments will not be stored in \"Draft\" folder</center>"));
}
@@ -283,20 +283,20 @@ void ComposeMail::reEditMail(const RecMailP&current)
message->setText(data->Wrapper()->fetchBody(current)->Bodytext());
subjectLine->setText( data->getSubject());
toLine->setText(data->To().join(","));
ccLine->setText(data->CC().join(","));
bccLine->setText(data->Bcc().join(","));
replyLine->setText(data->Replyto());
}
AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
: QListViewItem( parent )
{
attachment = att;
- qDebug( att->getMimeType() );
+ odebug << att->getMimeType() << oendl;
setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
Resource::loadPixmap( "UnknownDocument-14" ) :
attachment->getDocLnk().pixmap() );
setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
setText( 1, QString::number( att->getSize() ) );
}
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 5c4bdf7..de064ca 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -31,25 +31,25 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
ttext = "SMTP";
break;
default:
ttext = "UNKNOWN";
break;
}
setText( 1, ttext);
}
EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
: EditAccountsUI( parent, name, modal, flags )
{
- qDebug( "New Account Configuration Widget" );
+ odebug << "New Account Configuration Widget" << oendl;
settings = s;
mailList->addColumn( tr( "Account" ) );
mailList->addColumn( tr( "Type" ) );
newsList->addColumn( tr( "Account" ) );
connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
@@ -71,88 +71,88 @@ void EditAccounts::slotFillLists()
{
(void) new AccountListItem( newsList, it );
}
else
{
(void) new AccountListItem( mailList, it );
}
}
}
void EditAccounts::slotNewMail()
{
- qDebug( "New Mail Account" );
+ odebug << "New Mail Account" << oendl;
QString *selection = new QString();
SelectMailType selType( selection, this, 0, true );
selType.show();
if ( QDialog::Accepted == selType.exec() )
{
slotNewAccount( *selection );
}
}
void EditAccounts::slotNewAccount( const QString &type )
{
if ( type.compare( "IMAP" ) == 0 )
{
- qDebug( "-> config IMAP" );
+ odebug << "-> config IMAP" << oendl;
IMAPaccount *account = new IMAPaccount();
IMAPconfig imap( account, this, 0, true );
if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
{
settings->addAccount( account );
account->save();
slotFillLists();
}
else
{
account->remove();
}
}
else if ( type.compare( "POP3" ) == 0 )
{
- qDebug( "-> config POP3" );
+ odebug << "-> config POP3" << oendl;
POP3account *account = new POP3account();
POP3config pop3( account, this, 0, true, WStyle_ContextHelp );
if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
{
settings->addAccount( account );
account->save();
slotFillLists();
}
else
{
account->remove();
}
}
else if ( type.compare( "SMTP" ) == 0 )
{
- qDebug( "-> config SMTP" );
+ odebug << "-> config SMTP" << oendl;
SMTPaccount *account = new SMTPaccount();
SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp );
if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
{
settings->addAccount( account );
account->save();
slotFillLists();
}
else
{
account->remove();
}
}
else if ( type.compare( "NNTP" ) == 0 )
{
- qDebug( "-> config NNTP" );
+ odebug << "-> config NNTP" << oendl;
NNTPaccount *account = new NNTPaccount();
NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp );
if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
{
settings->addAccount( account );
account->save();
slotFillLists();
}
else
{
account->remove();
}
@@ -203,25 +203,25 @@ void EditAccounts::slotDeleteAccount( Account *account )
{
if ( QMessageBox::information( this, tr( "Question" ),
tr( "<p>Do you really want to delete the selected Account?</p>" ),
tr( "Yes" ), tr( "No" ) ) == 0 )
{
settings->delAccount( account );
slotFillLists();
}
}
void EditAccounts::slotEditMail()
{
- qDebug( "Edit Mail Account" );
+ odebug << "Edit Mail Account" << oendl;
if ( !mailList->currentItem() )
{
QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
slotEditAccount( a );
}
@@ -232,46 +232,46 @@ void EditAccounts::slotDeleteMail()
QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
slotDeleteAccount( a );
}
void EditAccounts::slotNewNews()
{
- qDebug( "New News Account" );
+ odebug << "New News Account" << oendl;
slotNewAccount( "NNTP" );
}
void EditAccounts::slotEditNews()
{
- qDebug( "Edit News Account" );
+ odebug << "Edit News Account" << oendl;
if ( !newsList->currentItem() )
{
QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
slotEditAccount( a );
}
void EditAccounts::slotDeleteNews()
{
- qDebug( "Delete News Account" );
+ odebug << "Delete News Account" << oendl;
if ( !newsList->currentItem() )
{
QMessageBox::information( this, tr( "Error" ),
tr( "<p>Please select an account.</p>" ),
tr( "Ok" ) );
return;
}
Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
slotDeleteAccount( a );
}
@@ -569,25 +569,25 @@ void NNTPconfig::save()
data->setPort( portLine->text() );
data->setSSL( sslBox->isChecked() );
data->setLogin( loginBox->isChecked() );
data->setUser( userLine->text() );
data->setPassword( passLine->text() );
QListViewItemIterator list_it( ListViewGroups );
QStringList groupList;
for ( ; list_it.current(); ++list_it ) {
if ( ( (QCheckListItem*)list_it.current() )->isOn() ) {
- qDebug(list_it.current()->text(0) );
+ odebug << list_it.current()->text(0) << oendl;
groupList.append( list_it.current()->text(0) );
}
}
data->setGroups( groupList );
}
void NNTPconfig::accept()
{
save();
QDialog::accept();
}
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index 6bebb7b..1a26351 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -43,67 +43,67 @@ AbstractMail* AbstractMail::getWrapper(Account*a)
return new POP3wrapper((POP3account*)a);
break;
case MAILLIB::A_NNTP:
return new NNTPwrapper((NNTPaccount*)a);
break;
default:
return 0;
}
}
encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc)
{
- qDebug("Decode string start");
+ odebug << "Decode string start" << oendl;
char*result_text;
size_t index = 0;
/* reset for recursive use! */
size_t target_length = 0;
result_text = 0;
int mimetype = MAILMIME_MECHANISM_7BIT;
if (enc.lower()=="quoted-printable") {
mimetype = MAILMIME_MECHANISM_QUOTED_PRINTABLE;
} else if (enc.lower()=="base64") {
mimetype = MAILMIME_MECHANISM_BASE64;
} else if (enc.lower()=="8bit") {
mimetype = MAILMIME_MECHANISM_8BIT;
} else if (enc.lower()=="binary") {
mimetype = MAILMIME_MECHANISM_BINARY;
}
int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype,
&result_text,&target_length);
encodedString* result = new encodedString();
if (err == MAILIMF_NO_ERROR) {
result->setContent(result_text,target_length);
}
- qDebug("Decode string finished");
+ odebug << "Decode string finished" << oendl;
return result;
}
QString AbstractMail::convert_String(const char*text)
{
//size_t index = 0;
char*res = 0;
int err = MAILIMF_NO_ERROR;
QString result(text);
/* due a bug in libetpan it isn't usable this moment */
/* int err = mailmime_encoded_phrase_parse("iso-8859-1",
text, strlen(text),&index, "iso-8859-1",&res);*/
- //qDebug("Input: %s",text);
+ //odebug << "Input: " << text << "" << oendl;
if (err == MAILIMF_NO_ERROR && res && strlen(res)) {
// result = QString(res);
-// qDebug("Res: %s, length: %i",res,strlen(res));
+// odebug << "Res: " << res << ", length: " << strlen(res) << "" << oendl;
}
if (res) free(res);
return result;
}
/* cp & paste from launcher */
QString AbstractMail::gen_attachment_id()
{
QFile file( "/proc/sys/kernel/random/uuid" );
if (!file.open(IO_ReadOnly ) )
return QString::null;
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp
index cb58d82..36ec232 100644
--- a/noncore/net/mail/libmailwrapper/generatemail.cpp
+++ b/noncore/net/mail/libmailwrapper/generatemail.cpp
@@ -88,47 +88,47 @@ mailimf_address_list *Generatemail::parseAddresses(const QString&addr ) {
QString s;
unsigned int i = 0;
for (; i < addr.length();++i) {
switch (addr[i]) {
case '\"':
literal_open = !literal_open;
break;
case ',':
if (!literal_open) {
s = addr.mid(startpos,i-startpos);
if (!s.isEmpty()) {
list.append(s);
- qDebug("Appended %s",s.latin1());
+ odebug << "Appended " << s.latin1() << "" << oendl;
}
// !!!! this is a MUST BE!
startpos = ++i;
}
break;
default:
break;
}
}
s = addr.mid(startpos,i-startpos);
if (!s.isEmpty()) {
list.append(s);
- qDebug("Appended %s",s.latin1());
+ odebug << "Appended " << s.latin1() << "" << oendl;
}
QStringList::Iterator it;
for ( it = list.begin(); it != list.end(); it++ ) {
int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() );
if ( err != MAILIMF_NO_ERROR ) {
- qDebug( "Error parsing" );
- qDebug( *it );
+ odebug << "Error parsing" << oendl;
+ odebug << *it << oendl;
} else {
- qDebug( "Parse success! %s",(*it).latin1());
+ odebug << "Parse success! " << (*it).latin1() << "" << oendl;
}
}
return addresses;
}
mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimetype,const QString&TextContent ) {
mailmime * filePart = 0;
mailmime_fields * fields = 0;
mailmime_content * content = 0;
mailmime_parameter * param = 0;
char*name = 0;
char*file = 0;
@@ -166,25 +166,25 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
clist_append(content->ct_parameters,param);
param = 0;
}
filePart = mailmime_new_empty( content, fields );
}
if (filePart) {
if (filename.length()>0) {
err = mailmime_set_body_file( filePart, file );
} else {
err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length());
}
if (err != MAILIMF_NO_ERROR) {
- qDebug("Error setting body with file %s",file);
+ odebug << "Error setting body with file " << file << "" << oendl;
mailmime_free( filePart );
filePart = 0;
}
}
if (!filePart) {
if ( param != NULL ) {
mailmime_parameter_free( param );
}
if (content) {
mailmime_content_free( content );
}
@@ -197,41 +197,41 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
if (file) {
free( file );
}
}
}
return filePart; // Success :)
}
void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) {
const Attachment *it;
unsigned int count = files.count();
- qDebug("List contains %i values",count);
+ odebug << "List contains " << count << " values" << oendl;
for ( unsigned int i = 0; i < count; ++i ) {
- qDebug( "Adding file" );
+ odebug << "Adding file" << oendl;
mailmime *filePart;
int err;
it = ((QList<Attachment>)files).at(i);
filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" );
if ( filePart == NULL ) {
- qDebug( "addFileParts: error adding file:" );
- qDebug( it->getFileName() );
+ odebug << "addFileParts: error adding file:" << oendl;
+ odebug << it->getFileName() << oendl;
continue;
}
err = mailmime_smart_add_part( message, filePart );
if ( err != MAILIMF_NO_ERROR ) {
mailmime_free( filePart );
- qDebug("error smart add");
+ odebug << "error smart add" << oendl;
}
}
}
mailmime *Generatemail::buildTxtPart(const QString&str ) {
mailmime *txtPart;
mailmime_fields *fields;
mailmime_content *content;
mailmime_parameter *param;
int err;
param = mailmime_parameter_new( strdup( "charset" ),
@@ -261,25 +261,25 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) {
return txtPart; // Success :)
err_free_txtPart:
mailmime_free( txtPart );
err_free_fields:
mailmime_fields_free( fields );
err_free_content:
mailmime_content_free( content );
err_free_param:
mailmime_parameter_free( param );
err_free:
- qDebug( "buildTxtPart - error" );
+ odebug << "buildTxtPart - error" << oendl;
return NULL; // Error :(
}
mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) {
return mailimf_mailbox_new( strdup( name.latin1() ),
strdup( mail.latin1() ) );
}
mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Mail>&mail )
{
mailimf_fields *fields = NULL;
@@ -336,33 +336,33 @@ mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Ma
h.remove(0,1);
}
while (h.length()>0 && h[h.length()-1]=='>') {
h.remove(h.length()-1,1);
}
if (h.isEmpty()) continue;
nsize = strlen(h.latin1());
/* yes! must be malloc! */
c_reply = (char*)malloc( (nsize+1)*sizeof(char));
memset(c_reply,0,nsize+1);
memcpy(c_reply,h.latin1(),nsize);
clist_append(in_reply_to,c_reply);
- qDebug("In reply to: %s",c_reply);
+ odebug << "In reply to: " << c_reply << "" << oendl;
}
}
if (res) {
fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc,
in_reply_to, NULL, subject );
if ( fields == NULL ) {
- qDebug("Error creating mailimf fields");
+ odebug << "Error creating mailimf fields" << oendl;
res = 0;
}
}
if (res) xmailer = mailimf_field_new_custom( strdup( "User-Agent" ),
strdup( USER_AGENT ) );
if ( xmailer == NULL ) {
res = 0;
} else {
err = mailimf_fields_add( fields, xmailer );
if ( err != MAILIMF_NO_ERROR ) {
res = 0;
}
@@ -426,25 +426,25 @@ mailmime *Generatemail::createMimeMail(const Opie::Core::OSmartPointer<Mail> &ma
addFileParts( message, mail->getAttachments() );
return message; // Success :)
err_free_txtPart:
mailmime_free( txtPart );
err_free_message:
mailmime_free( message );
err_free_fields:
mailimf_fields_free( fields );
err_free:
- qDebug( "createMimeMail: error" );
+ odebug << "createMimeMail: error" << oendl;
return NULL; // Error :(
}
clist *Generatemail::createRcptList( mailimf_fields *fields ) {
clist *rcptList;
mailimf_field *field;
rcptList = esmtp_address_list_new();
field = getField( fields, MAILIMF_FIELD_TO );
if ( field && (field->fld_type == MAILIMF_FIELD_TO)
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 0c68280..fae4c99 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -126,25 +126,25 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc)
default:
if (aEnc->enc_token) {
enc = QString(aEnc->enc_token);
}
break;
}
return enc;
}
void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count)
{
if (current_rec >= 10) {
- qDebug("too deep recursion!");
+ odebug << "too deep recursion!" << oendl;
}
if (!message || !mime) {
return;
}
int r;
char*data = 0;
size_t len;
clistiter * cur = 0;
QString b;
RecPartP part = new RecPart();
switch (mime->mm_type) {
@@ -263,25 +263,25 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list )
} else {
first = false;
}
switch ( addr->ad_type ) {
case MAILIMF_ADDRESS_MAILBOX:
result.append( parseMailbox( addr->ad_data.ad_mailbox ) );
break;
case MAILIMF_ADDRESS_GROUP:
result.append( parseGroup( addr->ad_data.ad_group ) );
break;
default:
- qDebug( "Generic: unkown mailimf address type" );
+ odebug << "Generic: unkown mailimf address type" << oendl;
break;
}
}
return result;
}
QString Genericwrapper::parseGroup( mailimf_group *group )
{
QString result( "" );
result.append( group->grp_display_name );
@@ -356,25 +356,25 @@ QString Genericwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part)
return text;
}
void Genericwrapper::cleanMimeCache()
{
QMap<QString,encodedString*>::Iterator it = bodyCache.begin();
for (;it!=bodyCache.end();++it) {
encodedString*t = it.data();
//it.setValue(0);
if (t) delete t;
}
bodyCache.clear();
- qDebug("Genericwrapper: cache cleaned");
+ odebug << "Genericwrapper: cache cleaned" << oendl;
}
QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
{
QStringList res;
if (!in_replies || !in_replies->mid_list) return res;
clistiter * current = 0;
for ( current = clist_begin( in_replies->mid_list ); current != NULL; current = current->next ) {
QString h((char*)current->data);
while (h.length()>0 && h[0]=='<') {
h.remove(0,1);
}
@@ -385,44 +385,44 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
res.append(h);
}
}
return res;
}
void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
{
int r;
mailmessage_list * env_list = 0;
r = mailsession_get_messages_list(session,&env_list);
if (r != MAIL_NO_ERROR) {
- qDebug("Error message list");
+ odebug << "Error message list" << oendl;
return;
}
r = mailsession_get_envelopes_list(session, env_list);
if (r != MAIL_NO_ERROR) {
- qDebug("Error filling message list");
+ odebug << "Error filling message list" << oendl;
if (env_list) {
mailmessage_list_free(env_list);
}
return;
}
mailimf_references * refs = 0;
mailimf_in_reply_to * in_replies = 0;
uint32_t i = 0;
for(; i < carray_count(env_list->msg_tab) ; ++i) {
mailmessage * msg;
QBitArray mFlags(7);
msg = (mailmessage*)carray_get(env_list->msg_tab, i);
if (msg->msg_fields == NULL) {
- //qDebug("could not fetch envelope of message %i", i);
+ //odebug << "could not fetch envelope of message " << i << "" << oendl;
continue;
}
RecMailP mail = new RecMail();
mail->setWrapper(this);
mail_flags * flag_result = 0;
r = mailmessage_get_flags(msg,&flag_result);
if (r == MAIL_ERROR_NOT_IMPLEMENTED) {
mFlags.setBit(FLAG_SEEN);
}
mailimf_single_fields single_fields;
mailimf_single_fields_init(&single_fields, msg->msg_fields);
mail->setMsgsize(msg->msg_size);
@@ -439,25 +439,25 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
} else {
mail->setTo(mailbox);
}
if (single_fields.fld_cc)
mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) );
if (single_fields.fld_bcc)
mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) );
if (single_fields.fld_orig_date)
mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) );
// crashes when accessing pop3 account?
if (single_fields.fld_message_id->mid_value) {
mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
- qDebug("Msgid == %s",mail->Msgid().latin1());
+ odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl;
}
if (single_fields.fld_reply_to) {
QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list);
if (t.count()>0) {
mail->setReplyto(t[0]);
}
}
#if 0
refs = single_fields.fld_references;
if (refs && refs->mid_list && clist_count(refs->mid_list)) {
char * text = (char*)refs->mid_list->first->data;
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 657c2ba..35468fe 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -21,69 +21,69 @@ IMAPwrapper::~IMAPwrapper()
logout();
}
/* to avoid to often select statements in loops etc.
we trust that we are logged in and connection is established!*/
int IMAPwrapper::selectMbox(const QString&mbox)
{
if (mbox == m_Lastmbox) {
return MAILIMAP_NO_ERROR;
}
int err = mailimap_select( m_imap, (char*)mbox.latin1());
if ( err != MAILIMAP_NO_ERROR ) {
- qDebug("error selecting mailbox: %s",m_imap->imap_response);
+ odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl;
m_Lastmbox = "";
return err;
}
m_Lastmbox = mbox;
return err;
}
void IMAPwrapper::imap_progress( size_t current, size_t maximum )
{
qApp->processEvents();
- qDebug( "IMAP: %i of %i", current, maximum );
+ odebug << "IMAP: " << current << " of " << maximum << "" << oendl;
}
bool IMAPwrapper::start_tls(bool force_tls)
{
int err;
bool try_tls;
mailimap_capability_data * cap_data = 0;
err = mailimap_capability(m_imap,&cap_data);
if (err != MAILIMAP_NO_ERROR) {
Global::statusMessage("error getting capabilities!");
- qDebug("error getting capabilities!");
+ odebug << "error getting capabilities!" << oendl;
return false;
}
clistiter * cur;
for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) {
struct mailimap_capability * cap;
cap = (struct mailimap_capability *)clist_content(cur);
if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) {
if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) {
try_tls = true;
break;
}
}
}
if (cap_data) {
mailimap_capability_data_free(cap_data);
}
if (try_tls) {
err = mailimap_starttls(m_imap);
if (err != MAILIMAP_NO_ERROR && force_tls) {
Global::statusMessage(tr("Server has no TLS support!"));
- qDebug("Server has no TLS support!");
+ odebug << "Server has no TLS support!" << oendl;
try_tls = false;
} else {
mailstream_low * low;
mailstream_low * new_low;
low = mailstream_get_low(m_imap->imap_stream);
if (!low) {
try_tls = false;
} else {
int fd = mailstream_low_get_fd(low);
if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) {
mailstream_low_free(low);
mailstream_set_low(m_imap->imap_stream, new_low);
@@ -116,48 +116,48 @@ void IMAPwrapper::login()
}
server = account->getServer().latin1();
port = account->getPort().toUInt();
if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
user = login.getUser().latin1();
pass = login.getPassword().latin1();
} else {
// cancel
- qDebug( "IMAP: Login canceled" );
+ odebug << "IMAP: Login canceled" << oendl;
return;
}
} else {
user = account->getUser().latin1();
pass = account->getPassword().latin1();
}
m_imap = mailimap_new( 20, &imap_progress );
/* connect */
bool ssl = false;
bool try_tls = false;
bool force_tls = false;
if ( account->ConnectionType() == 2 ) {
ssl = true;
}
if (account->ConnectionType()==1) {
force_tls = true;
}
if ( ssl ) {
- qDebug( "using ssl" );
+ odebug << "using ssl" << oendl;
err = mailimap_ssl_connect( m_imap, (char*)server, port );
} else {
err = mailimap_socket_connect( m_imap, (char*)server, port );
}
if ( err != MAILIMAP_NO_ERROR &&
err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) {
QString failure = "";
if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) {
failure="Connection refused";
} else {
@@ -167,25 +167,25 @@ void IMAPwrapper::login()
mailimap_free( m_imap );
m_imap = 0;
return;
}
if (!ssl) {
try_tls = start_tls(force_tls);
}
bool ok = true;
if (force_tls && !try_tls) {
Global::statusMessage(tr("Server has no TLS support!"));
- qDebug("Server has no TLS support!");
+ odebug << "Server has no TLS support!" << oendl;
ok = false;
}
/* login */
if (ok) {
err = mailimap_login_simple( m_imap, (char*)user, (char*)pass );
if ( err != MAILIMAP_NO_ERROR ) {
Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response));
ok = false;
}
@@ -308,35 +308,35 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
if ( (bflags = list->mb_flag) ) {
selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) {
if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) {
no_inferiors = true;
}
}
}
folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
}
} else {
- qDebug("error fetching folders: %s",m_imap->imap_response);
+ odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl;
}
mailimap_list_result_free( result );
/*
* second stage - get the other then inbox folders
*/
mask = "*" ;
path = account->getPrefix().latin1();
if (!path) path = "";
- qDebug(path);
+ odebug << path << oendl;
err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
if ( err == MAILIMAP_NO_ERROR ) {
current = result->first;
for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
no_inferiors = false;
list = (mailimap_mailbox_list *) current->data;
// it is better use the deep copy mechanism of qt itself
// instead of using strdup!
temp = list->mb_name;
if (temp.lower()=="inbox")
continue;
if (temp.lower()==account->getPrefix().lower())
@@ -345,25 +345,25 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) {
if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) {
no_inferiors = true;
}
}
}
del = list->mb_delimiter;
folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
}
} else {
- qDebug("error fetching folders %s",m_imap->imap_response);
+ odebug << "error fetching folders " << m_imap->imap_response << "" << oendl;
}
if (result) mailimap_list_result_free( result );
return folders;
}
RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
{
RecMail * m = 0;
mailimap_msg_att_item *item=0;
clistcell *current,*c,*cf;
mailimap_msg_att_dynamic*flist;
mailimap_flag_fetch*cflag;
@@ -457,26 +457,26 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
}
if (h.length()>0) {
m->setInreply(QStringList(h));
}
}
if (head->env_message_id) {
m->setMsgid(QString(head->env_message_id));
}
} else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) {
#if 0
mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date;
QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec));
- qDebug("%i %i %i - %i %i %i",d->dt_year,d->dt_month,d->dt_day,d->dt_hour,d->dt_min,d->dt_sec);
- qDebug(da.toString());
+ odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl;
+ odebug << da.toString() << oendl;
#endif
} else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) {
size = item->att_data.att_static->att_data.att_rfc822_size;
}
}
/* msg is already deleted */
if (mFlags.testBit(FLAG_DELETED) && m) {
delete m;
m = 0;
}
if (m) {
m->setFlags(mFlags);
@@ -515,25 +515,25 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
err = mailimap_fetch( m_imap, set, fetchType, &result );
mailimap_set_free( set );
mailimap_fetch_type_free( fetchType );
if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) {
mailimap_msg_att * msg_att;
msg_att = (mailimap_msg_att*)current->data;
mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data;
QValueList<int> path;
body_desc = item->att_data.att_static->att_data.att_body;
traverseBody(mail,body_desc,body,0,path);
} else {
- qDebug("error fetching body: %s",m_imap->imap_response);
+ odebug << "error fetching body: " << m_imap->imap_response << "" << oendl;
}
if (result) mailimap_fetch_list_free(result);
return body;
}
QStringList IMAPwrapper::address_list_to_stringlist(clist*list)
{
QStringList l;
QString from;
bool named_from;
clistcell *current = NULL;
mailimap_address * current_address=NULL;
@@ -627,25 +627,25 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int
for(cur = clist_begin(msg_att->att_list) ; cur != NULL ; cur = clist_next(cur)) {
msg_att_item = (mailimap_msg_att_item*)clist_content(cur);
if (msg_att_item->att_type == MAILIMAP_MSG_ATT_ITEM_STATIC) {
if (msg_att_item->att_data.att_static->att_type == MAILIMAP_MSG_ATT_BODY_SECTION) {
char*text = msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part;
/* detach - we take over the content */
msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L;
res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length);
}
}
}
} else {
- qDebug("error fetching text: %s",m_imap->imap_response);
+ odebug << "error fetching text: " << m_imap->imap_response << "" << oendl;
}
if (result) mailimap_fetch_list_free(result);
return res;
}
/* current_recursion is for recursive calls.
current_count means the position inside the internal loop! */
void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,
int current_recursion,QValueList<int>recList,int current_count)
{
if (!body || current_recursion>=10) {
return;
@@ -654,25 +654,25 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
case MAILIMAP_BODY_1PART:
{
QValueList<int>countlist = recList;
countlist.append(current_count);
RecPartP currentPart = new RecPart();
mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part;
QString id("");
currentPart->setPositionlist(countlist);
for (unsigned int j = 0; j < countlist.count();++j) {
id+=(j>0?" ":"");
id+=QString("%1").arg(countlist[j]);
}
- qDebug("ID = %s",id.latin1());
+ odebug << "ID = " << id.latin1() << "" << oendl;
currentPart->setIdentifier(id);
fillSinglePart(currentPart,part1);
/* important: Check for is NULL 'cause a body can be empty!
And we put it only into the mail if it is the FIRST part */
if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) {
QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding());
target_body->setDescription(currentPart);
target_body->setBodytext(body_text);
if (countlist.count()>1) {
target_body->addPart(currentPart);
}
} else {
@@ -695,25 +695,25 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
if (current_body->bd_type==MAILIMAP_BODY_MPART) {
RecPartP targetPart = new RecPart();
targetPart->setType("multipart");
fillMultiPart(targetPart,mailDescription);
countlist.append(current_count);
targetPart->setPositionlist(countlist);
target_body->addPart(targetPart);
QString id("");
for (unsigned int j = 0; j < countlist.count();++j) {
id+=(j>0?" ":"");
id+=QString("%1").arg(countlist[j]);
}
- qDebug("ID(mpart) = %s",id.latin1());
+ odebug << "ID(mpart) = " << id.latin1() << "" << oendl;
}
traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount);
if (current_body->bd_type==MAILIMAP_BODY_MPART) {
countlist = recList;
}
++ccount;
}
}
break;
default:
break;
}
@@ -739,37 +739,37 @@ void IMAPwrapper::fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*D
default:
break;
}
}
void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which)
{
if (!which) {
return;
}
QString sub;
sub = which->bd_media_text;
- qDebug("Type= text/%s",which->bd_media_text);
+ odebug << "Type= text/" << which->bd_media_text << "" << oendl;
target_part->setSubtype(sub.lower());
target_part->setLines(which->bd_lines);
fillBodyFields(target_part,which->bd_fields);
}
void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which)
{
if (!which) {
return;
}
target_part->setSubtype("rfc822");
- qDebug("Message part");
+ odebug << "Message part" << oendl;
/* we set this type to text/plain */
target_part->setLines(which->bd_lines);
fillBodyFields(target_part,which->bd_fields);
}
void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which)
{
if (!which) return;
QString sub = which->bd_media_subtype;
target_part->setSubtype(sub.lower());
if (which->bd_ext_mpart && which->bd_ext_mpart->bd_parameter && which->bd_ext_mpart->bd_parameter->pa_list) {
clistcell*cur = 0;
@@ -810,25 +810,25 @@ void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_ba
if (which->bd_media_basic->med_basic_type) {
type = which->bd_media_basic->med_basic_type;
} else {
type = "";
}
break;
}
if (which->bd_media_basic->med_subtype) {
sub = which->bd_media_basic->med_subtype;
} else {
sub = "";
}
- qDebug("Type = %s/%s",type.latin1(),sub.latin1());
+ odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl;
target_part->setType(type.lower());
target_part->setSubtype(sub.lower());
fillBodyFields(target_part,which->bd_fields);
}
void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which)
{
if (!which) return;
if (which->bd_parameter && which->bd_parameter->pa_list && which->bd_parameter->pa_list->count>0) {
clistcell*cur;
mailimap_single_body_fld_param*param=0;
for (cur = clist_begin(which->bd_parameter->pa_list);cur!=NULL;cur=clist_next(cur)) {
@@ -886,34 +886,34 @@ void IMAPwrapper::deleteMail(const RecMailP&mail)
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
flist = mailimap_flag_list_new_empty();
mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
store_flags = mailimap_store_att_flags_new_set_flags(flist);
set = mailimap_set_new_single(mail->getNumber());
err = mailimap_store(m_imap,set,store_flags);
mailimap_set_free( set );
mailimap_store_att_flags_free(store_flags);
if (err != MAILIMAP_NO_ERROR) {
- qDebug("error deleting mail: %s",m_imap->imap_response);
+ odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
return;
}
- qDebug("deleting mail: %s",m_imap->imap_response);
+ odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
/* should we realy do that at this moment? */
err = mailimap_expunge(m_imap);
if (err != MAILIMAP_NO_ERROR) {
- qDebug("error deleting mail: %s",m_imap->imap_response);
+ odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
}
- qDebug("Delete successfull %s",m_imap->imap_response);
+ odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
}
void IMAPwrapper::answeredMail(const RecMailP&mail)
{
mailimap_flag_list*flist;
mailimap_set *set;
mailimap_store_att_flags * store_flags;
int err;
login();
if (!m_imap) {
return;
}
@@ -921,25 +921,25 @@ void IMAPwrapper::answeredMail(const RecMailP&mail)
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
flist = mailimap_flag_list_new_empty();
mailimap_flag_list_add(flist,mailimap_flag_new_answered());
store_flags = mailimap_store_att_flags_new_add_flags(flist);
set = mailimap_set_new_single(mail->getNumber());
err = mailimap_store(m_imap,set,store_flags);
mailimap_set_free( set );
mailimap_store_att_flags_free(store_flags);
if (err != MAILIMAP_NO_ERROR) {
- qDebug("error marking mail: %s",m_imap->imap_response);
+ odebug << "error marking mail: " << m_imap->imap_response << "" << oendl;
return;
}
}
QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc)
{
QString body("");
encodedString*res = fetchRawPart(mail,path,internal_call);
encodedString*r = decode_String(res,enc);
delete res;
if (r) {
if (r->Length()>0) {
@@ -989,57 +989,57 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
}
flist = mailimap_flag_list_new_empty();
mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
store_flags = mailimap_store_att_flags_new_set_flags(flist);
set = mailimap_set_new_interval( 1, last );
err = mailimap_store(m_imap,set,store_flags);
mailimap_set_free( set );
mailimap_store_att_flags_free(store_flags);
if (err != MAILIMAP_NO_ERROR) {
Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
return 0;
}
- qDebug("deleting mail: %s",m_imap->imap_response);
+ odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
/* should we realy do that at this moment? */
err = mailimap_expunge(m_imap);
if (err != MAILIMAP_NO_ERROR) {
Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
return 0;
}
- qDebug("Delete successfull %s",m_imap->imap_response);
+ odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
return 1;
}
int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder)
{
if (folder.length()==0) return 0;
login();
if (!m_imap) {return 0;}
QString pre = account->getPrefix();
if (delemiter.length()>0 && pre.findRev(delemiter)!=pre.length()-1) {
pre+=delemiter;
}
if (parentfolder) {
pre += parentfolder->getDisplayName()+delemiter;
}
pre+=folder;
if (getsubfolder) {
if (delemiter.length()>0) {
pre+=delemiter;
} else {
Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre));
return 0;
}
}
- qDebug("Creating %s",pre.latin1());
+ odebug << "Creating " << pre.latin1() << "" << oendl;
int res = mailimap_create(m_imap,pre.latin1());
if (res != MAILIMAP_NO_ERROR) {
Global::statusMessage(tr("%1").arg(m_imap->imap_response));
return 0;
}
return 1;
}
int IMAPwrapper::deleteMbox(const FolderP&folder)
{
if (!folder) return 0;
login();
@@ -1080,108 +1080,108 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
case MAILIMAP_STATUS_ATT_MESSAGES:
target_stat.message_count = status_info->st_value;
break;
case MAILIMAP_STATUS_ATT_RECENT:
target_stat.message_recent = status_info->st_value;
break;
case MAILIMAP_STATUS_ATT_UNSEEN:
target_stat.message_unseen = status_info->st_value;
break;
}
}
} else {
- qDebug("Error retrieving status");
+ odebug << "Error retrieving status" << oendl;
}
if (status) mailimap_mailbox_data_status_free(status);
if (att_list) mailimap_status_att_list_free(att_list);
}
void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder)
{
login();
if (!m_imap) return;
if (!msg) return;
int r = mailimap_append(m_imap,(char*)folder.latin1(),0,0,msg,length);
if (r != MAILIMAP_NO_ERROR) {
Global::statusMessage("Error storing mail!");
}
}
MAILLIB::ATYPE IMAPwrapper::getType()const
{
return account->getType();
}
const QString&IMAPwrapper::getName()const
{
- qDebug("Get name: %s",account->getAccountName().latin1());
+ odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl;
return account->getAccountName();
}
encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
{
// dummy
QValueList<int> path;
return fetchRawPart(mail,path,false);
}
void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
if (targetWrapper != this) {
AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
- qDebug("Using generic");
+ odebug << "Using generic" << oendl;
return;
}
mailimap_set *set = 0;
login();
if (!m_imap) {
return;
}
int err = selectMbox(fromFolder->getName());
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
int last = m_imap->imap_selection_info->sel_exists;
set = mailimap_set_new_interval( 1, last );
err = mailimap_copy(m_imap,set,targetFolder.latin1());
mailimap_set_free( set );
if ( err != MAILIMAP_NO_ERROR ) {
QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response);
Global::statusMessage(error_msg);
- qDebug(error_msg);
+ odebug << error_msg << oendl;
return;
}
if (moveit) {
deleteAllMail(fromFolder);
}
}
void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
if (targetWrapper != this) {
- qDebug("Using generic");
+ odebug << "Using generic" << oendl;
AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit);
return;
}
mailimap_set *set = 0;
login();
if (!m_imap) {
return;
}
int err = selectMbox(mail->getMbox());
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
set = mailimap_set_new_single(mail->getNumber());
err = mailimap_copy(m_imap,set,targetFolder.latin1());
mailimap_set_free( set );
if ( err != MAILIMAP_NO_ERROR ) {
QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response);
Global::statusMessage(error_msg);
- qDebug(error_msg);
+ odebug << error_msg << oendl;
return;
}
if (moveit) {
deleteMail(mail);
}
}
diff --git a/noncore/net/mail/libmailwrapper/logindialog.cpp b/noncore/net/mail/libmailwrapper/logindialog.cpp
index 01d177e..c9ae190 100644
--- a/noncore/net/mail/libmailwrapper/logindialog.cpp
+++ b/noncore/net/mail/libmailwrapper/logindialog.cpp
@@ -15,15 +15,15 @@ LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent,
} else {
passLine->setFocus();
}
}
void LoginDialog::accept()
{
//_user.replace( 0, _user.length(), userLine->text() );
//_pass.replace( 0, _pass.length(), passLine->text() );
_user = userLine->text();
_pass = passLine->text();
- qDebug("User im accept: |%s|",_user.latin1());
+ odebug << "User im accept: |" << _user.latin1() << "|" << oendl;
QDialog::accept();
}
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp
index 90b8865..6d44db4 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.cpp
+++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp
@@ -4,25 +4,25 @@
using namespace Opie::Core;
RecMail::RecMail()
:Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7)
{
init();
}
RecMail::RecMail(const RecMail&old)
:Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
{
init();
copy_old(old);
- qDebug("Copy constructor RecMail");
+ odebug << "Copy constructor RecMail" << oendl;
}
RecMail::~RecMail()
{
wrapper = 0;
}
void RecMail::copy_old(const RecMail&old)
{
subject = old.subject;
date = old.date;
mbox = old.mbox;
@@ -122,25 +122,25 @@ RecPart::RecPart(const RecPart&old)
: Opie::Core::ORefCount(),
m_type(""),m_subtype(""),m_identifier(""),m_encoding(""),m_description(""),m_lines(0),m_size(0)
{
m_type = old.m_type;
m_subtype = old.m_subtype;
m_identifier = old.m_identifier;
m_encoding = old.m_encoding;
m_description = old.m_description;
m_lines = old.m_lines;
m_size = old.m_size;
m_Parameters = old.m_Parameters;
m_poslist = old.m_poslist;
- qDebug("RecPart copy constructor");
+ odebug << "RecPart copy constructor" << oendl;
}
RecPart::~RecPart()
{
}
void RecPart::setSize(unsigned int size)
{
m_size = size;
}
const unsigned int RecPart::Size()const
@@ -246,25 +246,25 @@ const QValueList<int>& RecPart::Positionlist()const
RecBody::RecBody()
: Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart())
{
m_PartsList.clear();
}
RecBody::RecBody(const RecBody&old)
:Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart())
{
m_BodyText = old.m_BodyText;
m_PartsList = old.m_PartsList;
m_description = old.m_description;
- qDebug("Recbody copy constructor");
+ odebug << "Recbody copy constructor" << oendl;
}
RecBody::~RecBody()
{
}
void RecBody::setBodytext(const QString&bodyText)
{
m_BodyText = bodyText;
}
const QString& RecBody::Bodytext()const
@@ -311,32 +311,32 @@ encodedString::encodedString(const char*nContent,unsigned int nSize)
}
encodedString::encodedString(char*nContent,unsigned int nSize)
{
init();
setContent(nContent,nSize);
}
encodedString::encodedString(const encodedString&old)
{
init();
copy_old(old);
- qDebug("encodedeString: copy constructor!");
+ odebug << "encodedeString: copy constructor!" << oendl;
}
encodedString& encodedString::operator=(const encodedString&old)
{
init();
copy_old(old);
- qDebug("encodedString: assign operator!");
+ odebug << "encodedString: assign operator!" << oendl;
return *this;
}
encodedString::~encodedString()
{
clean();
}
void encodedString::init()
{
content = 0;
size = 0;
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index eddc0b9..2b0d112 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -42,25 +42,25 @@ Folder::~Folder()
const QString& Folder::Separator()const
{
return separator;
}
IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&aprefix )
: Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf)
{
// Decode IMAP foldername
nameDisplay = IMAPFolder::decodeFolderName( name );
/*
- qDebug( "folder " + name + " - displayed as " + nameDisplay );
+ odebug << "folder " + name + " - displayed as " + nameDisplay << oendl;
*/
prefix = aprefix;
if (prefix.length()>0) {
if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) {
nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length());
}
}
}
IMAPFolder::~IMAPFolder()
{
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
index e3c75f3..df2112f 100644
--- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
@@ -22,25 +22,25 @@ MBOXwrapper::~MBOXwrapper()
void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target )
{
mailstorage*storage = mailstorage_new(NULL);
QString p = MBOXPath+"/";
p+=mailbox;
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
mailfolder*folder;
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
- qDebug("Error initializing mbox");
+ odebug << "Error initializing mbox" << oendl;
mailfolder_free(folder);
mailstorage_free(storage);
return;
}
parseList(target,folder->fld_session,mailbox);
mailfolder_disconnect(folder);
mailfolder_free(folder);
mailstorage_free(storage);
Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
}
@@ -61,87 +61,87 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders()
}
void MBOXwrapper::deleteMail(const RecMailP & mail)
{
mailstorage*storage = mailstorage_new(NULL);
QString p = MBOXPath+"/";
p+=mail->getMbox();
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
mailfolder*folder;
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
- qDebug("Error initializing mbox");
+ odebug << "Error initializing mbox" << oendl;
mailfolder_free(folder);
mailstorage_free(storage);
return;
}
r = mailsession_remove_message(folder->fld_session,mail->getNumber());
if (r != MAIL_NO_ERROR) {
- qDebug("error deleting mail");
+ odebug << "error deleting mail" << oendl;
}
mailfolder_free(folder);
mailstorage_free(storage);
}
void MBOXwrapper::answeredMail(const RecMailP&)
{
}
RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail )
{
RecBodyP body = new RecBody();
mailstorage*storage = mailstorage_new(NULL);
QString p = MBOXPath+"/";
p+=mail->getMbox();
mailmessage * msg;
char*data=0;
size_t size;
int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
mailfolder*folder;
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
- qDebug("Error initializing mbox");
+ odebug << "Error initializing mbox" << oendl;
mailfolder_free(folder);
mailstorage_free(storage);
return body;
}
r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg);
if (r != MAIL_NO_ERROR) {
- qDebug("Error fetching mail %i",mail->getNumber());
+ odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
mailfolder_free(folder);
mailstorage_free(storage);
return body;
}
r = mailmessage_fetch(msg,&data,&size);
if (r != MAIL_NO_ERROR) {
- qDebug("Error fetching mail %i",mail->getNumber());
+ odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
mailfolder_free(folder);
mailstorage_free(storage);
mailmessage_free(msg);
return body;
}
body = parseMail(msg);
mailmessage_fetch_result_free(msg,data);
mailfolder_free(folder);
mailstorage_free(storage);
return body;
}
void MBOXwrapper::mbox_progress( size_t current, size_t maximum )
{
- qDebug("MBOX %i von %i",current,maximum);
+ odebug << "MBOX " << current << " von " << maximum << "" << oendl;
}
int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool )
{
QString p = MBOXPath+"/";
p+=folder;
QFileInfo fi(p);
if (fi.exists()) {
Global::statusMessage(tr("Mailbox exists."));
return 0;
}
mailmbox_folder*f = 0;
@@ -211,45 +211,45 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail)
mailstorage_free(storage);
mailmessage_free(msg);
return result;
}
void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
{
QString p = MBOXPath+"/";
p+=mailbox;
mailmbox_folder*f = 0;
int r = mailmbox_init(p.latin1(),0,1,0,&f);
if (r != MAIL_NO_ERROR) {
- qDebug("Error init folder");
+ odebug << "Error init folder" << oendl;
return;
}
deleteMails(f,target);
mailmbox_done(f);
}
void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target)
{
if (!f) return;
int r;
QValueList<RecMailP>::ConstIterator it;
for (it=target.begin(); it != target.end();++it) {
r = mailmbox_delete_msg(f,(*it)->getNumber());
if (r!=MAILMBOX_NO_ERROR) {
- qDebug("error delete mail");
+ odebug << "error delete mail" << oendl;
}
}
r = mailmbox_expunge(f);
if (r != MAILMBOX_NO_ERROR) {
- qDebug("error expunge mailbox");
+ odebug << "error expunge mailbox" << oendl;
}
}
int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
{
if (!tfolder) return 0;
QString p = MBOXPath+"/"+tfolder->getDisplayName();
int res = 1;
mailfolder*folder = 0;
mailmessage_list*l=0;
mailstorage*storage = mailstorage_new(NULL);
@@ -260,25 +260,25 @@ int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
}
if (res) {
folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
r = mailfolder_connect(folder);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error initializing mbox"));
res = 0;
}
}
if (res) {
r = mailsession_get_messages_list(folder->fld_session,&l);
if (r != MAIL_NO_ERROR) {
- qDebug("Error message list");
+ odebug << "Error message list" << oendl;
res=0;
}
}
for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
r = mailsession_remove_message(folder->fld_session,i+1);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
res = 0;
break;
}
}
if (l) mailmessage_list_free(l);
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 12472e9..cd7cecb 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -7,50 +7,50 @@
#include <stdlib.h>
#include <qpe/global.h>
#include <opie2/oprocess.h>
using namespace Opie::Core;
MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
: Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
{
if (MHPath.length()>0) {
if (MHPath[MHPath.length()-1]=='/') {
MHPath=MHPath.left(MHPath.length()-1);
}
- qDebug(MHPath);
+ odebug << MHPath << oendl;
QDir dir(MHPath);
if (!dir.exists()) {
dir.mkdir(MHPath);
}
init_storage();
}
}
void MHwrapper::init_storage()
{
int r;
QString pre = MHPath;
if (!m_storage) {
m_storage = mailstorage_new(NULL);
r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0);
if (r != MAIL_NO_ERROR) {
- qDebug("error initializing storage");
+ odebug << "error initializing storage" << oendl;
mailstorage_free(m_storage);
m_storage = 0;
return;
}
}
r = mailstorage_connect(m_storage);
if (r!=MAIL_NO_ERROR) {
- qDebug("error connecting storage");
+ odebug << "error connecting storage" << oendl;
mailstorage_free(m_storage);
m_storage = 0;
}
}
void MHwrapper::clean_storage()
{
if (m_storage) {
mailstorage_disconnect(m_storage);
mailstorage_free(m_storage);
m_storage = 0;
}
@@ -61,105 +61,105 @@ MHwrapper::~MHwrapper()
clean_storage();
}
void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
{
init_storage();
if (!m_storage) {
return;
}
QString f = buildPath(mailbox);
int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("listMessages: error selecting folder!");
+ odebug << "listMessages: error selecting folder!" << oendl;
return;
}
parseList(target,m_storage->sto_session,f);
Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
}
QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
{
QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
/* this is needed! */
if (m_storage) mailstorage_disconnect(m_storage);
init_storage();
if (!m_storage) {
return folders;
}
mail_list*flist = 0;
clistcell*current=0;
int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
if (r != MAIL_NO_ERROR || !flist) {
- qDebug("error getting folder list");
+ odebug << "error getting folder list" << oendl;
return folders;
}
for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
QString t = (char*)current->data;
t.replace(0,MHPath.length(),"");
folders->append(new MHFolder(t,MHPath));
}
mail_list_free(flist);
return folders;
}
void MHwrapper::deleteMail(const RecMailP&mail)
{
init_storage();
if (!m_storage) {
return;
}
int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting folder!");
+ odebug << "error selecting folder!" << oendl;
return;
}
r = mailsession_remove_message(m_storage->sto_session,mail->getNumber());
if (r != MAIL_NO_ERROR) {
- qDebug("error deleting mail");
+ odebug << "error deleting mail" << oendl;
}
}
void MHwrapper::answeredMail(const RecMailP&)
{
}
RecBodyP MHwrapper::fetchBody( const RecMailP &mail )
{
RecBodyP body = new RecBody();
init_storage();
if (!m_storage) {
return body;
}
mailmessage * msg;
char*data=0;
/* mail should hold the complete path! */
int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
if (r != MAIL_NO_ERROR) {
return body;
}
r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
if (r != MAIL_NO_ERROR) {
- qDebug("Error fetching mail %i",mail->getNumber());
+ odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
return body;
}
body = parseMail(msg);
mailmessage_fetch_result_free(msg,data);
return body;
}
void MHwrapper::mbox_progress( size_t current, size_t maximum )
{
- qDebug("MH %i von %i",current,maximum);
+ odebug << "MH " << current << " von " << maximum << "" << oendl;
}
QString MHwrapper::buildPath(const QString&p)
{
QString f="";
if (p.length()==0||p=="/")
return MHPath;
if (!p.startsWith(MHPath)) {
f+=MHPath;
}
if (!p.startsWith("/")) {
f+="/";
@@ -174,119 +174,119 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
if (!m_storage) {
return 0;
}
QString f;
if (!pfolder) {
// toplevel folder
f = buildPath(folder);
} else {
f = pfolder->getName();
f+="/";
f+=folder;
}
- qDebug(f);
+ odebug << f << oendl;
int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1());
if (r != MAIL_NO_ERROR) {
- qDebug("error creating folder %i",r);
+ odebug << "error creating folder " << r << "" << oendl;
return 0;
}
- qDebug("Folder created");
+ odebug << "Folder created" << oendl;
return 1;
}
void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
{
init_storage();
if (!m_storage) {
return;
}
QString f = buildPath(Folder);
int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting folder!");
+ odebug << "error selecting folder!" << oendl;
return;
}
r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
if (r!=MAIL_NO_ERROR) {
- qDebug("error storing mail");
+ odebug << "error storing mail" << oendl;
}
return;
}
encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
{
encodedString*result = 0;
init_storage();
if (!m_storage) {
return result;
}
mailmessage * msg = 0;
char*data=0;
size_t size;
int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting folder!");
+ odebug << "error selecting folder!" << oendl;
return result;
}
r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
return 0;
}
r = mailmessage_fetch(msg,&data,&size);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
if (msg) mailmessage_free(msg);
return 0;
}
result = new encodedString(data,size);
if (msg) mailmessage_free(msg);
return result;
}
void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
{
QString f = buildPath(mailbox);
int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("deleteMails: error selecting folder!");
+ odebug << "deleteMails: error selecting folder!" << oendl;
return;
}
QValueList<RecMailP>::ConstIterator it;
for (it=target.begin(); it!=target.end();++it) {
r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
if (r != MAIL_NO_ERROR) {
- qDebug("error deleting mail");
+ odebug << "error deleting mail" << oendl;
break;
}
}
}
int MHwrapper::deleteAllMail(const FolderP&tfolder)
{
init_storage();
if (!m_storage) {
return 0;
}
int res = 1;
if (!tfolder) return 0;
int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting folder!");
+ odebug << "error selecting folder!" << oendl;
return 0;
}
mailmessage_list*l=0;
r = mailsession_get_messages_list(m_storage->sto_session,&l);
if (r != MAIL_NO_ERROR) {
- qDebug("Error message list");
+ odebug << "Error message list" << oendl;
res = 0;
}
unsigned j = 0;
for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
mailmessage * msg;
msg = (mailmessage*)carray_get(l->msg_tab, i);
j = msg->msg_index;
r = mailsession_remove_message(m_storage->sto_session,j);
if (r != MAIL_NO_ERROR) {
Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
res = 0;
break;
@@ -299,46 +299,46 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
int MHwrapper::deleteMbox(const FolderP&tfolder)
{
init_storage();
if (!m_storage) {
return 0;
}
if (!tfolder) return 0;
if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
if (r != MAIL_NO_ERROR) {
- qDebug("error deleting mail box");
+ odebug << "error deleting mail box" << oendl;
return 0;
}
QString cmd = "rm -rf "+tfolder->getName();
QStringList command;
command << "/bin/sh";
command << "-c";
command << cmd.latin1();
OProcess *process = new OProcess();
connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
this, SLOT( processEnded(Opie::Core::OProcess*)));
connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
*process << command;
removeMboxfailed = false;
if(!process->start(OProcess::Block, OProcess::All) ) {
- qDebug("could not start process");
+ odebug << "could not start process" << oendl;
return 0;
}
- qDebug("mail box deleted");
+ odebug << "mail box deleted" << oendl;
return 1;
}
void MHwrapper::processEnded(OProcess *p)
{
if (p) delete p;
}
void MHwrapper::oprocessStderr(OProcess*, char *buffer, int )
{
QString lineStr = buffer;
QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") );
@@ -369,74 +369,74 @@ MAILLIB::ATYPE MHwrapper::getType()const
const QString&MHwrapper::getName()const
{
return MHName;
}
void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
init_storage();
if (!m_storage) {
return;
}
if (targetWrapper != this) {
- qDebug("Using generic");
+ odebug << "Using generic" << oendl;
Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit);
return;
}
- qDebug("Using internal routines for move/copy");
+ odebug << "Using internal routines for move/copy" << oendl;
QString tf = buildPath(targetFolder);
int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
if (r != MAIL_NO_ERROR) {
- qDebug("Error selecting source mailbox");
+ odebug << "Error selecting source mailbox" << oendl;
return;
}
if (moveit) {
r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
} else {
r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
}
if (r != MAIL_NO_ERROR) {
- qDebug("Error copy/moving mail internal (%i)",r);
+ odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
}
}
void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
{
init_storage();
if (!m_storage) {
return;
}
if (targetWrapper != this) {
- qDebug("Using generic");
+ odebug << "Using generic" << oendl;
Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
return;
}
if (!fromFolder) return;
int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting source folder!");
+ odebug << "error selecting source folder!" << oendl;
return;
}
QString tf = buildPath(targetFolder);
mailmessage_list*l=0;
r = mailsession_get_messages_list(m_storage->sto_session,&l);
if (r != MAIL_NO_ERROR) {
- qDebug("Error message list");
+ odebug << "Error message list" << oendl;
}
unsigned j = 0;
for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) {
mailmessage * msg;
msg = (mailmessage*)carray_get(l->msg_tab, i);
j = msg->msg_index;
if (moveit) {
r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1());
} else {
r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1());
}
if (r != MAIL_NO_ERROR) {
- qDebug("Error copy/moving mail internal (%i)",r);
+ odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
break;
}
}
if (l) mailmessage_list_free(l);
}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index cfded43..5d5011a 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -20,42 +20,42 @@ NNTPwrapper::NNTPwrapper( NNTPaccount *a )
last_msg_id = 0;
}
NNTPwrapper::~NNTPwrapper() {
logout();
QFile msg_cache(msgTempName);
if (msg_cache.exists()) {
msg_cache.remove();
}
}
void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) {
- qDebug( "NNTP: %i of %i", current, maximum );
+ odebug << "NNTP: " << current << " of " << maximum << "" << oendl;
}
RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) {
int err = NEWSNNTP_NO_ERROR;
char *message = 0;
size_t length = 0;
RecBodyP body = new RecBody();
login();
if ( !m_nntp ) {
return body;
}
mailmessage * mailmsg;
if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) {
- qDebug("Message to large: %i",mail->Msgsize());
+ odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
return body;
}
QFile msg_cache(msgTempName);
cleanMimeCache();
if (mail->getNumber()!=last_msg_id) {
if (msg_cache.exists()) {
msg_cache.remove();
}
msg_cache.open(IO_ReadWrite|IO_Truncate);
@@ -125,25 +125,25 @@ void NNTPwrapper::login()
user = pass = 0;
if ( ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) && account->getLogin() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
User = login.getUser().latin1();
Pass = login.getPassword().latin1();
} else {
// cancel
- qDebug( "NNTP: Login canceled" );
+ odebug << "NNTP: Login canceled" << oendl;
return;
}
} else {
User = account->getUser().latin1();
Pass = account->getPassword().latin1();
}
if (User.isEmpty()) {
user=0;
pass = 0;
} else {
user=User.latin1();
@@ -162,25 +162,25 @@ void NNTPwrapper::login()
} else if ( conntypeset == 1 ) {
conntype = CONNECTION_TYPE_STARTTLS;
} else if ( conntypeset == 0 ) {
conntype = CONNECTION_TYPE_TRY_STARTTLS;
}
nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN,
(char*)user,(char*)pass,0,0,0);
err = mailstorage_connect( m_nntp );
if (err != NEWSNNTP_NO_ERROR) {
- qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
+ odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
// Global::statusMessage(tr("Error initializing folder"));
mailstorage_free(m_nntp);
m_nntp = 0;
} else {
mailsession * session = m_nntp->sto_session;
newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session;
news->nntp_progr_fun = &nntp_progress;
}
}
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 5467547..c586c29 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -19,42 +19,42 @@ POP3wrapper::POP3wrapper( POP3account *a )
last_msg_id = 0;
}
POP3wrapper::~POP3wrapper() {
logout();
QFile msg_cache(msgTempName);
if (msg_cache.exists()) {
msg_cache.remove();
}
}
void POP3wrapper::pop3_progress( size_t current, size_t maximum ) {
- qDebug( "POP3: %i of %i", current, maximum );
+ odebug << "POP3: " << current << " of " << maximum << "" << oendl;
}
RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
int err = MAILPOP3_NO_ERROR;
char *message = 0;
size_t length = 0;
RecBodyP body = new RecBody();
login();
if ( !m_pop3 ) {
return body;
}
mailmessage * mailmsg;
if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) {
- qDebug("Message to large: %i",mail->Msgsize());
+ odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
return body;
}
QFile msg_cache(msgTempName);
cleanMimeCache();
if (mail->getNumber()!=last_msg_id) {
if (msg_cache.exists()) {
msg_cache.remove();
}
msg_cache.open(IO_ReadWrite|IO_Truncate);
@@ -121,25 +121,25 @@ void POP3wrapper::login()
server = account->getServer().latin1();
port = account->getPort().toUInt();
if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
user = login.getUser().latin1();
pass = login.getPassword().latin1();
} else {
// cancel
- qDebug( "POP3: Login canceled" );
+ odebug << "POP3: Login canceled" << oendl;
return;
}
} else {
user = account->getUser().latin1();
pass = account->getPassword().latin1();
}
// bool ssl = account->getSSL();
m_pop3=mailstorage_new(NULL);
int conntypeset = account->ConnectionType();
@@ -153,25 +153,25 @@ void POP3wrapper::login()
} else if ( conntypeset == 0 ) {
conntype = CONNECTION_TYPE_TRY_STARTTLS;
}
//(ssl?CONNECTION_TYPE_TLS:CONNECTION_TYPE_PLAIN);
pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN,
(char*)user,(char*)pass,0,0,0);
err = mailstorage_connect(m_pop3);
if (err != MAIL_NO_ERROR) {
- qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
+ odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
Global::statusMessage(tr("Error initializing folder"));
mailstorage_free(m_pop3);
m_pop3 = 0;
} else {
mailsession * session = m_pop3->sto_session;
mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session;
if (mail) {
mail->pop3_progr_fun = &pop3_progress;
}
}
}
@@ -227,25 +227,25 @@ int POP3wrapper::deleteAllMail(const FolderP&) {
}
void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) {
login();
target_stat.message_count = 0;
target_stat.message_unseen = 0;
target_stat.message_recent = 0;
if (!m_pop3)
return;
int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count,
&target_stat.message_recent,&target_stat.message_unseen);
if (r != MAIL_NO_ERROR) {
- qDebug("error getting folter status.");
+ odebug << "error getting folter status." << oendl;
}
}
encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) {
char*target=0;
size_t length=0;
encodedString*res = 0;
mailmessage * mailmsg = 0;
int err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg);
err = mailmessage_fetch(mailmsg,&target,&length);
if (mailmsg)
mailmessage_free(mailmsg);
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 2c81963..de36eeb 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -17,25 +17,25 @@
Settings::Settings()
: QObject()
{
updateAccounts();
}
void Settings::checkDirectory()
{
if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
system( "mkdir -p $HOME/Applications/opiemail" );
- qDebug( "$HOME/Applications/opiemail created" );
+ odebug << "$HOME/Applications/opiemail created" << oendl;
}
}
QList<Account> Settings::getAccounts()
{
return accounts;
}
void Settings::addAccount( Account *account )
{
accounts.append( account );
}
@@ -45,46 +45,46 @@ void Settings::delAccount( Account *account )
accounts.remove( account );
account->remove();
}
void Settings::updateAccounts()
{
accounts.clear();
QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
QStringList::Iterator it;
QStringList imap = dir.entryList( "imap-*" );
for ( it = imap.begin(); it != imap.end(); it++ ) {
- qDebug( "Added IMAP account" );
+ odebug << "Added IMAP account" << oendl;
IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
accounts.append( account );
}
QStringList pop3 = dir.entryList( "pop3-*" );
for ( it = pop3.begin(); it != pop3.end(); it++ ) {
- qDebug( "Added POP account" );
+ odebug << "Added POP account" << oendl;
POP3account *account = new POP3account( (*it).replace(0, 5, "") );
accounts.append( account );
}
QStringList smtp = dir.entryList( "smtp-*" );
for ( it = smtp.begin(); it != smtp.end(); it++ ) {
- qDebug( "Added SMTP account" );
+ odebug << "Added SMTP account" << oendl;
SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
accounts.append( account );
}
QStringList nntp = dir.entryList( "nntp-*" );
for ( it = nntp.begin(); it != nntp.end(); it++ ) {
- qDebug( "Added NNTP account" );
+ odebug << "Added NNTP account" << oendl;
NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") );
accounts.append( account );
}
readAccounts();
}
void Settings::saveAccounts()
{
checkDirectory();
Account *it;
@@ -170,25 +170,25 @@ void IMAPaccount::read()
user = conf->readEntry( "User","" );
if (user.isNull()) user = "";
password = conf->readEntryCrypt( "Password","" );
if (password.isNull()) password = "";
prefix = conf->readEntry("MailPrefix","");
if (prefix.isNull()) prefix = "";
offline = conf->readBoolEntry("Offline",false);
delete conf;
}
void IMAPaccount::save()
{
- qDebug( "saving " + getFileName() );
+ odebug << "saving " + getFileName() << oendl;
Settings::checkDirectory();
Config *conf = new Config( getFileName(), Config::File );
conf->setGroup( "IMAP Account" );
conf->writeEntry( "Account", accountName );
conf->writeEntry( "Server", server );
conf->writeEntry( "Port", port );
conf->writeEntry( "SSL", ssl );
conf->writeEntry( "ConnectionType", connectionType );
conf->writeEntry( "User", user );
conf->writeEntryCrypt( "Password", password );
conf->writeEntry( "MailPrefix",prefix);
@@ -248,25 +248,25 @@ void POP3account::read()
server = conf->readEntry( "Server" );
port = conf->readEntry( "Port" );
ssl = conf->readBoolEntry( "SSL" );
connectionType = conf->readNumEntry( "ConnectionType" );
user = conf->readEntry( "User" );
password = conf->readEntryCrypt( "Password" );
offline = conf->readBoolEntry("Offline",false);
delete conf;
}
void POP3account::save()
{
- qDebug( "saving " + getFileName() );
+ odebug << "saving " + getFileName() << oendl;
Settings::checkDirectory();
Config *conf = new Config( getFileName(), Config::File );
conf->setGroup( "POP3 Account" );
conf->writeEntry( "Account", accountName );
conf->writeEntry( "Server", server );
conf->writeEntry( "Port", port );
conf->writeEntry( "SSL", ssl );
conf->writeEntry( "ConnectionType", connectionType );
conf->writeEntry( "User", user );
conf->writeEntryCrypt( "Password", password );
conf->writeEntry( "Offline",offline);
@@ -330,25 +330,25 @@ void SMTPaccount::read()
server = conf->readEntry( "Server" );
port = conf->readEntry( "Port" );
ssl = conf->readBoolEntry( "SSL" );
connectionType = conf->readNumEntry( "ConnectionType" );
login = conf->readBoolEntry( "Login" );
user = conf->readEntry( "User" );
password = conf->readEntryCrypt( "Password" );
delete conf;
}
void SMTPaccount::save()
{
- qDebug( "saving " + getFileName() );
+ odebug << "saving " + getFileName() << oendl;
Settings::checkDirectory();
Config *conf = new Config( getFileName(), Config::File );
conf->setGroup( "SMTP Account" );
conf->writeEntry( "Account", accountName );
conf->writeEntry( "Server", server );
conf->writeEntry( "Port", port );
conf->writeEntry( "SSL", ssl );
conf->writeEntry( "ConnectionType", connectionType );
conf->writeEntry( "Login", login );
conf->writeEntry( "User", user );
conf->writeEntryCrypt( "Password", password );
@@ -407,25 +407,25 @@ void NNTPaccount::read()
server = conf->readEntry( "Server" );
port = conf->readEntry( "Port" );
ssl = conf->readBoolEntry( "SSL" );
login = conf->readBoolEntry( "Login" );
user = conf->readEntry( "User" );
password = conf->readEntryCrypt( "Password" );
subscribedGroups = conf->readListEntry( "Subscribed", ',' );
delete conf;
}
void NNTPaccount::save()
{
- qDebug( "saving " + getFileName() );
+ odebug << "saving " + getFileName() << oendl;
Settings::checkDirectory();
Config *conf = new Config( getFileName(), Config::File );
conf->setGroup( "NNTP Account" );
conf->writeEntry( "Account", accountName );
conf->writeEntry( "Server", server );
conf->writeEntry( "Port", port );
conf->writeEntry( "SSL", ssl );
conf->writeEntry( "Login", login );
conf->writeEntry( "User", user );
conf->writeEntryCrypt( "Password", password );
conf->writeEntry( "Subscribed" , subscribedGroups, ',' );
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index e2cea7a..ba78c3b 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -106,25 +106,25 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
from = data = 0;
mailmessage * msg = 0;
msg = mime_message_init(mail);
mime_message_set_tmpdir(msg,getenv( "HOME" ));
int r = mailmessage_fetch(msg,&data,&size);
mime_message_detach_mime(msg);
mailmessage_free(msg);
if (r != MAIL_NO_ERROR || !data) {
if (data)
free(data);
- qDebug("Error fetching mime...");
+ odebug << "Error fetching mime..." << oendl;
return;
}
msg = 0;
if (later) {
storeMail(data,size,"Outgoing");
if (data)
free( data );
Config cfg( "mail" );
cfg.setGroup( "Status" );
cfg.writeEntry( "outgoing", ++m_queuedMail );
emit queuedMails( m_queuedMail );
return;
@@ -199,34 +199,34 @@ void SMTPwrapper::connect_server()
}
int result = 1;
port = m_SmtpAccount->getPort().toUInt();
m_smtp = mailsmtp_new( 20, &progress );
if ( m_smtp == NULL ) {
/* no failure message cause this happens when problems with memory - than we
we can not display any messagebox */
return;
}
int err = MAILSMTP_NO_ERROR;
- qDebug( "Servername %s at port %i", server, port );
+ odebug << "Servername " << server << " at port " << port << "" << oendl;
if ( ssl ) {
- qDebug( "SSL session" );
+ odebug << "SSL session" << oendl;
err = mailsmtp_ssl_connect( m_smtp, server, port );
} else {
- qDebug( "No SSL session" );
+ odebug << "No SSL session" << oendl;
err = mailsmtp_socket_connect( m_smtp, server, port );
}
if ( err != MAILSMTP_NO_ERROR ) {
- qDebug("Error init connection");
+ odebug << "Error init connection" << oendl;
failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
result = 0;
}
/* switch to tls after init 'cause there it will send the ehlo */
if (result) {
err = mailsmtp_init( m_smtp );
if (err != MAILSMTP_NO_ERROR) {
result = 0;
failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
}
}
@@ -237,47 +237,47 @@ void SMTPwrapper::connect_server()
try_tls = false;
} else {
err = mailesmtp_ehlo(m_smtp);
}
}
if (!try_tls && force_tls) {
result = 0;
failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err));
}
if (result==1 && m_SmtpAccount->getLogin() ) {
- qDebug("smtp with auth");
+ odebug << "smtp with auth" << oendl;
if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) {
// get'em
LoginDialog login( m_SmtpAccount->getUser(),
m_SmtpAccount->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
user = login.getUser().latin1();
pass = login.getPassword().latin1();
} else {
result = 0;
failuretext=tr("Login aborted - storing mail to localfolder");
}
} else {
user = m_SmtpAccount->getUser().latin1();
pass = m_SmtpAccount->getPassword().latin1();
}
- qDebug( "session->auth: %i", m_smtp->auth);
+ odebug << "session->auth: " << m_smtp->auth << "" << oendl;
if (result) {
err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass );
if ( err == MAILSMTP_NO_ERROR ) {
- qDebug("auth ok");
+ odebug << "auth ok" << oendl;
} else {
failuretext = tr("Authentification failed");
result = 0;
}
}
}
}
void SMTPwrapper::disc_server()
{
if (m_smtp) {
mailsmtp_quit( m_smtp );
@@ -298,43 +298,43 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
err = mailsmtp_send( m_smtp, from, rcpts, data, size );
if ( err != MAILSMTP_NO_ERROR ) {
failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err));
result = 0;
}
} else {
result = 0;
}
if (!result) {
storeFailedMail(data,size,failuretext);
} else {
- qDebug( "Mail sent." );
+ odebug << "Mail sent." << oendl;
storeMail(data,size,"Sent");
}
return result;
}
void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
{
mailmime * mimeMail;
mimeMail = createMimeMail(mail );
if ( mimeMail == NULL ) {
- qDebug( "sendMail: error creating mime mail" );
+ odebug << "sendMail: error creating mime mail" << oendl;
} else {
sendProgress = new progressMailSend();
sendProgress->show();
sendProgress->setMaxMails(1);
smtpSend( mimeMail,later);
- qDebug("Clean up done");
+ odebug << "Clean up done" << oendl;
sendProgress->hide();
delete sendProgress;
sendProgress = 0;
mailmime_free( mimeMail );
}
}
int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
size_t curTok = 0;
mailimf_fields *fields = 0;
mailimf_field*ffrom = 0;
clist *rcpts = 0;
@@ -369,45 +369,45 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
free(from);
}
if (rcpts) {
smtp_address_list_free( rcpts );
}
return res;
}
/* this is a special fun */
bool SMTPwrapper::flushOutbox() {
bool returnValue = true;
- qDebug("Sending the queue");
+ odebug << "Sending the queue" << oendl;
if (!m_SmtpAccount) {
- qDebug("No smtp account given");
+ odebug << "No smtp account given" << oendl;
return false;
}
bool reset_user_value = false;
QString localfolders = AbstractMail::defaultLocalfolder();
AbstractMail*wrap = AbstractMail::getWrapper(localfolders);
if (!wrap) {
- qDebug("memory error");
+ odebug << "memory error" << oendl;
return false;
}
QString oldPw, oldUser;
QValueList<RecMailP> mailsToSend;
QValueList<RecMailP> mailsToRemove;
QString mbox("Outgoing");
wrap->listMessages(mbox,mailsToSend);
if (mailsToSend.count()==0) {
delete wrap;
- qDebug("No mails to send");
+ odebug << "No mails to send" << oendl;
return false;
}
oldPw = m_SmtpAccount->getPassword();
oldUser = m_SmtpAccount->getUser();
if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) {
// get'em
QString user,pass;
LoginDialog login( m_SmtpAccount->getUser(), m_SmtpAccount->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp
index b78244d..51383f6 100644
--- a/noncore/net/mail/libmailwrapper/statusmail.cpp
+++ b/noncore/net/mail/libmailwrapper/statusmail.cpp
@@ -34,25 +34,25 @@ void StatusMail::initAccounts(QList<Account>&accounts)
currentImapStat.message_count+=currentStat.message_unseen;
currentImapStat.message_count+=currentStat.message_recent;
currentImapStat.message_count+=currentStat.message_count;
} else if ( it->getType() == MAILLIB::A_POP3 && !it->getOffline() ) {
POP3account *pop3 = static_cast<POP3account *>(it);
current = AbstractMail::getWrapper(pop3);
connectionList.append(current);
current->statusFolder(currentStat);
currentPop3Stat.message_count+=currentStat.message_count;
}
current->logout();
}
- qDebug("Pop3 init count: %i",currentPop3Stat.message_count);
+ odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl;
currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0;
lastPop3Stat.message_unseen = currentPop3Stat.message_unseen;
lastPop3Stat.message_recent = currentPop3Stat.message_recent;
lastPop3Stat.message_count = currentPop3Stat.message_count;
}
void StatusMail::reset_status()
{
lastPop3Stat = currentPop3Stat;
}
void StatusMail::check_current_stat(folderStat&targetStat)
@@ -63,28 +63,28 @@ void StatusMail::check_current_stat(folderStat&targetStat)
currentPop3Stat.message_count = 0;
currentPop3Stat.message_unseen = 0;
currentImapStat = currentPop3Stat;
for ( it = connectionList.first(); it; it = connectionList.next() ) {
it->statusFolder(currentStat);
it->logout();
if (it->getType() == MAILLIB::A_IMAP) {
currentImapStat.message_unseen+=currentStat.message_unseen;
currentImapStat.message_recent+=currentStat.message_recent;
currentImapStat.message_count+=currentStat.message_count;
} else if (it->getType() == MAILLIB::A_POP3) {
currentPop3Stat.message_count+=currentStat.message_count;
- qDebug("Pop3 count: %i",currentPop3Stat.message_count);
+ odebug << "Pop3 count: " << currentPop3Stat.message_count << "" << oendl;
}
}
- qDebug("Pop3 last: %i",lastPop3Stat.message_count);
+ odebug << "Pop3 last: " << lastPop3Stat.message_count << "" << oendl;
if (currentPop3Stat.message_count > lastPop3Stat.message_count) {
currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count;
currentPop3Stat.message_unseen = currentPop3Stat.message_recent;
} else {
lastPop3Stat.message_count = currentPop3Stat.message_count;
currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0;
}
targetStat = currentImapStat;
targetStat.message_unseen+=currentPop3Stat.message_unseen;
targetStat.message_recent+=currentPop3Stat.message_recent;
targetStat.message_count+=currentPop3Stat.message_count;
}
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp
index 914a11d..546d756 100644
--- a/noncore/net/mail/libmailwrapper/storemail.cpp
+++ b/noncore/net/mail/libmailwrapper/storemail.cpp
@@ -49,40 +49,40 @@ Storemail::Storemail(const QString&aFolder)
Storemail::~Storemail()
{
}
int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail)
{
if (!wrapper) return 0;
int ret = 1;
mailmime * mimeMail = 0;
mimeMail = createMimeMail(mail );
if ( mimeMail == NULL ) {
- qDebug( "storeMail: error creating mime mail" );
+ odebug << "storeMail: error creating mime mail" << oendl;
return 0;
}
char *data;
size_t size;
data = 0;
mailmessage * msg = 0;
msg = mime_message_init(mimeMail);
mime_message_set_tmpdir(msg,getenv( "HOME" ));
int r = mailmessage_fetch(msg,&data,&size);
mime_message_detach_mime(msg);
mailmessage_free(msg);
msg = 0;
if (r != MAIL_NO_ERROR || !data) {
- qDebug("Error fetching mime...");
+ odebug << "Error fetching mime..." << oendl;
ret = 0;
}
if (ret) {
wrapper->storeMessage(data,size,m_tfolder);
}
if (data) {
free(data);
}
if (mimeMail) {
mailmime_free( mimeMail );
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index c23ad3f..4c87d64 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -132,25 +132,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
#endif
QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
}
MainWindow::~MainWindow()
{
}
void MainWindow::appMessage(const QCString &, const QByteArray &)
{
- qDebug("appMessage not reached");
+ odebug << "appMessage not reached" << oendl;
}
void MainWindow::slotAdjustLayout() {
QWidget *d = QApplication::desktop();
if ( d->width() < d->height() ) {
layout->setDirection( QBoxLayout::TopToBottom );
} else {
layout->setDirection( QBoxLayout::LeftToRight );
}
}
@@ -166,50 +166,50 @@ void MainWindow::slotAdjustColumns()
mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 );
mailView->setColumnWidth( 2, 80 );
mailView->setColumnWidth( 3, 50 );
mailView->setColumnWidth( 4, 50 );
}
void MainWindow::slotEditSettings()
{
}
void MainWindow::slotShowFolders( bool )
{
- qDebug( "slotShowFolders not reached" );
+ odebug << "slotShowFolders not reached" << oendl;
}
void MainWindow::refreshMailView(const QValueList<RecMailP>&)
{
- qDebug( "refreshMailView not reached" );
+ odebug << "refreshMailView not reached" << oendl;
}
void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int )
{
- qDebug( "mailLeftClicked not reached" );
+ odebug << "mailLeftClicked not reached" << oendl;
}
void MainWindow::displayMail()
{
- qDebug("displayMail not reached");
+ odebug << "displayMail not reached" << oendl;
}
void MainWindow::slotDeleteMail()
{
- qDebug("deleteMail not reached");
+ odebug << "deleteMail not reached" << oendl;
}
void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
{
- qDebug("mailHold not reached");
+ odebug << "mailHold not reached" << oendl;
}
void MainWindow::slotSendQueued()
{
}
void MainWindow::slotEditAccounts()
{
}
void MainWindow::slotComposeMail()
{
diff --git a/noncore/net/mail/nntpgroups.cpp b/noncore/net/mail/nntpgroups.cpp
index 8741c4b..3243ee3 100644
--- a/noncore/net/mail/nntpgroups.cpp
+++ b/noncore/net/mail/nntpgroups.cpp
@@ -44,19 +44,19 @@ void NNTPGroups::fillGroups()
item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox );
item->setOn( true );
}
}
void NNTPGroups::storeValues()
{
if (!m_Account) return;
QListViewItemIterator list_it( GroupListView );
subscribedGroups.clear();
for ( ; list_it.current(); ++list_it ) {
if ( ( (QCheckListItem*)list_it.current() )->isOn() ) {
- qDebug(list_it.current()->text(0) );
+ odebug << list_it.current()->text(0) << oendl;
subscribedGroups.append( list_it.current()->text(0) );
}
}
subscribedGroups+=subscribedGroupsNotListed;
m_Account->setGroups( subscribedGroups );
}
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 5da2161..0669b5a 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -58,31 +58,31 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
}
else
{
compose.setTo(email);
}
}
compose.slotAdjustColumns();
QPEApplication::execDialog( &compose );
}
void OpieMail::slotComposeMail()
{
- qDebug( "Compose Mail" );
+ odebug << "Compose Mail" << oendl;
slotwriteMail(0l,0l);
}
void OpieMail::slotSendQueued()
{
- qDebug( "Send Queued" );
+ odebug << "Send Queued" << oendl;
SMTPaccount *smtp = 0;
QList<Account> list = settings->getAccounts();
QList<SMTPaccount> smtpList;
smtpList.setAutoDelete(false);
Account *it;
for ( it = list.first(); it; it = list.next() )
{
if ( it->getType() == MAILLIB::A_SMTP )
{
smtp = static_cast<SMTPaccount *>(it);
smtpList.append(smtp);
@@ -111,36 +111,36 @@ void OpieMail::slotSendQueued()
{
SMTPwrapper * wrap = new SMTPwrapper(smtp);
if ( wrap->flushOutbox() )
{
QMessageBox::information(0,tr("Info"),tr("Mail queue flushed"));
}
delete wrap;
}
}
void OpieMail::slotSearchMails()
{
- qDebug( "Search Mails" );
+ odebug << "Search Mails" << oendl;
}
void OpieMail::slotEditSettings()
{
SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp );
QPEApplication::execDialog( &settingsDialog );
}
void OpieMail::slotEditAccounts()
{
- qDebug( "Edit Accounts" );
+ odebug << "Edit Accounts" << oendl;
EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp );
eaDialog.slotAdjustColumns();
QPEApplication::execDialog( &eaDialog );
if ( settings ) delete settings;
settings = new Settings();
folderView->populate( settings->getAccounts() );
}
void OpieMail::displayMail()
{
QListViewItem*item = mailView->currentItem();
@@ -171,57 +171,57 @@ void OpieMail::slotDeleteMail()
{
mail->Wrapper()->deleteMail( mail );
folderView->refreshCurrent();
}
}
void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
{
if (!mailView->currentItem()) return;
MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
/* just the RIGHT button - or hold on pda */
if (button!=2) {return;}
- qDebug("Event right/hold");
+ odebug << "Event right/hold" << oendl;
if (!item) return;
QPopupMenu *m = new QPopupMenu(0);
if (m)
{
if (mailtype==MAILLIB::A_NNTP) {
m->insertItem(tr("Read this posting"),this,SLOT(displayMail()));
// m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail()));
} else {
if (folderView->currentisDraft()) {
m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail()));
}
m->insertItem(tr("Read this mail"),this,SLOT(displayMail()));
m->insertItem(tr("Delete this mail"),this,SLOT(slotDeleteMail()));
m->insertItem(tr("Copy/Move this mail"),this,SLOT(slotMoveCopyMail()));
}
m->setFocus();
m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
delete m;
}
}
void OpieMail::slotShowFolders( bool show )
{
- qDebug( "Show Folders" );
+ odebug << "Show Folders" << oendl;
if ( show && folderView->isHidden() )
{
- qDebug( "-> showing" );
+ odebug << "-> showing" << oendl;
folderView->show();
}
else if ( !show && !folderView->isHidden() )
{
- qDebug( "-> hiding" );
+ odebug << "-> hiding" << oendl;
folderView->hide();
}
}
void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
{
MailListViewItem*item = 0;
mailView->clear();
QValueList<RecMailP>::ConstIterator it;
for (it = list.begin(); it != list.end();++it)
{
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp
index f672a36..cac9048 100644
--- a/noncore/net/mail/taskbarapplet/mailapplet.cpp
+++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp
@@ -95,25 +95,25 @@ void MailApplet::slotCheck() {
m_intervalTimer->changeInterval( newIntervalMs );
m_intervalMs = newIntervalMs;
}
if (m_statusMail == 0) {
return;
}
folderStat stat;
m_statusMail->check_current_stat( stat );
int newMailsOld = m_newMails;
m_newMails = stat.message_unseen;
- qDebug( QString( "test %1" ).arg( m_newMails ) );
+ odebug << QString( "test %1" ).arg( m_newMails ) << oendl;
if ( m_newMails > 0 && newMailsOld != m_newMails ) {
ODevice *device = ODevice::inst();
if ( isHidden() )
show();
if ( m_config->readBoolEntry( "BlinkLed", true ) ) {
if ( !device->ledList().isEmpty() ) {
OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0];
device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On );
}
}
if ( m_config->readBoolEntry( "PlaySound", false ) )
device->playAlarmSound();
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 156e11d..a574ea1 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -130,25 +130,25 @@ void ViewMail::setBody(const RecBodyP&body )
}
curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist());
QString filename = "";
for (unsigned int i = 0; i < body->Parts().count();++i)
{
filename = "";
type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
for (;it!=body->Parts()[i]->Parameters().end();++it)
{
- qDebug(it.key());
+ odebug << it.key() << oendl;
if (it.key().lower()=="name")
{
filename=it.data();
}
}
s = body->Parts()[i]->Size();
w = 0;
while (s>1024)
{
s/=1024;
++w;
if (w>=2) break;
diff --git a/noncore/net/opieftp/config.in b/noncore/net/opieftp/config.in
index 96e8b27..95cf73c 100644
--- a/noncore/net/opieftp/config.in
+++ b/noncore/net/opieftp/config.in
@@ -1,4 +1,4 @@
config OPIEFTP
boolean "opie-ftp (ftp client for Opie)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && FTPLIB
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && FTPLIB
diff --git a/noncore/net/opieftp/filePermissions.cpp b/noncore/net/opieftp/filePermissions.cpp
index f545c1f..991fcd5 100644
--- a/noncore/net/opieftp/filePermissions.cpp
+++ b/noncore/net/opieftp/filePermissions.cpp
@@ -23,25 +23,25 @@
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName, bool useRemote )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( tr("filePermissions") );
-// qDebug("FilePermissions "+fileName);
+// odebug << "FilePermissions "+fileName << oendl;
resize( 236, 210 );
isRemote=useRemote;
setMaximumSize( QSize( 236, 210 ) );
setCaption( tr( "Set File Permissions" ) );
TextLabel1 = new QLabel( this, "TextLabel1" );
TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) );
TextLabel1->setText( tr( "Set file permissions for:" ) );
LineEdit1 = new QLineEdit( this, "LineEdit1" );
LineEdit1->setGeometry( QRect( 10, 25, 218, 22 ) );
LineEdit1->setReadOnly(true);
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 4c39569..fe96103 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -10,67 +10,70 @@
* (at your option) any later version. *
***************************************************************************/
//#define DEVELOPERS_VERSION
#include "opieftp.h"
extern "C" {
#include "../ftplib/ftplib.h"
}
#include "inputDialog.h"
-#include <qmenubar.h>
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
+using namespace Opie::Core;
#include <qtextstream.h>
#include <qpushbutton.h>
#include <qtoolbutton.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qlabel.h>
#include <qprogressbar.h>
#include <qspinbox.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qmessagebox.h>
+#include <qmenubar.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qvbox.h>
+/* STD */
#include <unistd.h>
#include <stdlib.h>
-
QProgressBar *ProgressBar;
static netbuf *conn=NULL;
static int log_progress(netbuf *, int xfered, void *)
{
// int fsz = *(int *)arg;
// int pct = (xfered * 100) / fsz;
// printf("%3d%%\r", pct);
// fflush(stdout);
ProgressBar->setProgress(xfered);
qApp->processEvents();
return 1;
}
OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
: QMainWindow( parent, name, fl )
{
- qDebug("OpieFtp constructor");
+ odebug << "OpieFtp constructor" << oendl;
setCaption( tr( "OpieFtp" ) );
fuckeduphack=FALSE;
QVBox* wrapperBox = new QVBox( this );
setCentralWidget( wrapperBox );
QWidget *view = new QWidget( wrapperBox );
QGridLayout *layout = new QGridLayout( view );
layout->setSpacing( 2);
layout->setMargin( 2);
connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
@@ -325,25 +328,25 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4);
ProgressBar->setMaximumHeight(10);
filterStr="*";
b=FALSE;
#if 0
populateLocalView();
#endif
readConfig();
// ServerComboBox->setCurrentItem(currentServerConfig);
TabWidget->setCurrentPage(2);
- qDebug("Constructor done");
+ odebug << "Constructor done" << oendl;
}
OpieFtp::~OpieFtp()
{
}
void OpieFtp::cleanUp()
{
if(conn)
FtpQuit(conn);
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
@@ -396,25 +399,25 @@ void OpieFtp::newConnection()
{
UsernameComboBox->lineEdit()->setText("");
PasswordEdit->setText( "" );
ServerComboBox->lineEdit()->setText( "");
remotePath->setText( currentRemoteDir = "/");
PortSpinBox->setValue( 21);
TabWidget->setCurrentPage(2);
}
void OpieFtp::serverComboEdited(const QString & )
{
// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) {
-// qDebug("ServerComboEdited");
+// odebug << "ServerComboEdited" << oendl;
// // currentServerConfig = -1;
// }
}
void OpieFtp::UsernameComboBoxEdited(const QString &) {
// currentServerConfig = -1;
}
void OpieFtp::PasswordEditEdited(const QString & ) {
// currentServerConfig = -1;
}
@@ -521,25 +524,25 @@ void OpieFtp::localUpload()
QString strItem = it.current()->text(0);
QString localFile = currentDir.canonicalPath()+"/"+strItem;
QString remoteFile= currentRemoteDir+strItem;
QFileInfo fi(localFile);
if( !fi.isDir()) {
fsz=fi.size();
ProgressBar->setTotalSteps(fsz);
FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
- qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1());
+ odebug << "Put: " << localFile.latin1() << ", " << remoteFile.latin1() << "" << oendl;
if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
QString msg;
msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
}
} else {
QMessageBox::message(tr("Note"),tr("Cannot upload directories"));
}
ProgressBar->reset();
nullifyCallBack();
@@ -582,25 +585,25 @@ void OpieFtp::remoteDownload()
// QString localFile = currentDir.canonicalPath()+"/"+strItem;
QString remoteFile= currentRemoteDir+strItem;
if (!FtpSize( remoteFile.latin1(), &fsz, FTPLIB_ASCII, conn))
fsz = 0;
QString temp;
temp.sprintf( remoteFile+" "+" %dkb", fsz);
ProgressBar->setTotalSteps(fsz);
FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
- qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1());
+ odebug << "Get: " << localFile.latin1() << ", " << remoteFile.latin1() << "" << oendl;
if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
QString msg;
msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
}
ProgressBar->reset();
nullifyCallBack();
it.current()->setSelected(FALSE);
}
}
@@ -611,82 +614,82 @@ void OpieFtp::remoteDownload()
TabWidget->setCurrentPage(0);
populateLocalView();
// QCopEnvelope ( "QPE/System", "notBusy()" );
}
bool OpieFtp::remoteDirList(const QString &dir)
{
QString tmp = QDir::homeDirPath();
if(tmp.right(1) != "/")
tmp+="/._temp";
else
tmp+="._temp";
-// qDebug("Listing remote dir "+tmp);
+// odebug << "Listing remote dir "+tmp << oendl;
// QCopEnvelope ( "QPE/System", "busy()" );
if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) {
QString msg;
msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) );
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
return false;
}
populateRemoteView() ;
// QCopEnvelope ( "QPE/System", "notBusy()" );
return true;
}
bool OpieFtp::remoteChDir(const QString &dir)
{
// QCopEnvelope ( "QPE/System", "busy()" );
if (!FtpChdir( dir.latin1(), conn )) {
QString msg;
msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
-// qDebug(msg);
+// odebug << msg << oendl;
// QCopEnvelope ( "QPE/System", "notBusy()" );
return FALSE;
}
// QCopEnvelope ( "QPE/System", "notBusy()" );
return TRUE;
}
void OpieFtp::populateLocalView()
{
Local_View->clear();
currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
currentDir.setMatchAllDirs(TRUE);
currentDir.setNameFilter(filterStr);
QString fileL, fileS, fileDate;
bool isDir=FALSE;
const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ){
QString symLink=fi->readLink();
- qDebug("Symlink detected "+symLink);
+ odebug << "Symlink detected "+symLink << oendl;
QFileInfo sym( symLink);
fileS.sprintf( "%10i", sym.size() );
fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
fileDate = sym.lastModified().toString();
} else {
- qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
+ odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl;
fileS.sprintf( "%10i", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
- qDebug( fileL);
+ odebug << fileL << oendl;
}
}
if(fileL !="./" && fi->exists()) {
item = new QListViewItem( Local_View,fileL, fileDate, fileS );
QPixmap pm;
if(isDir || fileL.find("/",0,TRUE) != -1) {
if( !QDir( fi->filePath() ).isReadable())
pm = Resource::loadPixmap( "lockedfolder" );
else
pm= Resource::loadPixmap( "folder" );
item->setPixmap( 0,pm );
@@ -711,25 +714,25 @@ void OpieFtp::populateLocalView()
item->setPixmap( 0,pm);
}
isDir=FALSE;
++it;
}
Local_View->setSorting( 3,FALSE);
currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
fillCombo( (const QString &)currentDir);
}
bool OpieFtp::populateRemoteView( )
{
-// qDebug("populate remoteview");
+// odebug << "populate remoteview" << oendl;
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
sfile+="/._temp";
else
sfile+="._temp";
QFile file( sfile);
Remote_View->clear();
QString s, File_Name;
QListViewItem *itemDir=NULL, *itemFile=NULL;
QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] ");
QString fileL, fileS, fileDate;
if ( file.open(IO_ReadOnly)) {
@@ -760,69 +763,69 @@ bool OpieFtp::populateRemoteView( )
// if(itemFile)
item->moveItem(itemDir);
item->moveItem(itemFile);
itemFile=item;
}
}
QListViewItem * item1 = new QListViewItem( Remote_View, "../");
item1->setPixmap( 0, Resource::loadPixmap( "folder" ));
file.close();
if( file.exists())
file. remove();
} else
- qDebug("temp file not opened successfully "+sfile);
+ odebug << "temp file not opened successfully "+sfile << oendl;
Remote_View->setSorting( 4,TRUE);
return true;
}
void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
{
if( selectedItem) {
// if(selectedItem!= NULL) {
// QCopEnvelope ( "QPE/System", "busy()" );
QString oldRemoteCurrentDir = currentRemoteDir;
QString strItem=selectedItem->text(0);
strItem=strItem.simplifyWhiteSpace();
if(strItem == "../") { // the user wants to go ^
if( FtpCDUp( conn) == 0) {
QString msg;
msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
-// qDebug(msg);
+// odebug << msg << oendl;
}
char path[256];
if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
QString msg;
msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
-// qDebug(msg);
+// odebug << msg << oendl;
}
currentRemoteDir=path;
} else {
if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers
strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 );
strItem = strItem.stripWhiteSpace();
currentRemoteDir = strItem;
if( !remoteChDir( (const QString &)strItem)) {
currentRemoteDir = oldRemoteCurrentDir;
strItem="";
-// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
+// odebug << "RemoteCurrentDir1 "+oldRemoteCurrentDir << oendl;
}
} else if(strItem.find("/",0,TRUE) != -1) { // this is a directory
if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) {
currentRemoteDir = oldRemoteCurrentDir;
strItem="";
-// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
+// odebug << "RemoteCurrentDir1 "+oldRemoteCurrentDir << oendl;
} else {
currentRemoteDir = currentRemoteDir+strItem;
}
} else {
// QCopEnvelope ( "QPE/System", "notBusy()" );
return;
}
}
remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
if(currentRemoteDir.right(1) !="/")
currentRemoteDir +="/";
@@ -857,25 +860,25 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem)
populateLocalView();
} else {
currentDir.cdUp();
populateLocalView();
}
if(QDir(strItem).exists()){
currentDir.cd(strItem, TRUE);
populateLocalView();
}
} else {
strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
if( QFile::exists(strItem ) ) {
- // qDebug("upload "+strItem);
+ // odebug << "upload "+strItem << oendl;
return;
}
} //end not symlink
chdir(strItem.latin1());
}
Local_View->ensureItemVisible(Local_View->firstChild());
}
}
void OpieFtp::doLocalCd()
{
localListClicked( Local_View->currentItem());
@@ -1161,25 +1164,25 @@ void OpieFtp::fillRemoteCombo(const QString &currentPath) {
currentPathCombo->lineEdit()->setText(currentPath);
if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
currentPathCombo->clear();
remoteDirPathStringList.prepend(currentPath );
currentPathCombo->insertStringList( remoteDirPathStringList,-1);
}
}
void OpieFtp::currentPathComboChanged()
{
QString oldRemoteCurrentDir = currentRemoteDir;
-// qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir);
+// odebug << "oldRemoteCurrentDir "+oldRemoteCurrentDir << oendl;
if (TabWidget->currentPageIndex() == 0) {
if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
currentDir.setPath( currentPathCombo->lineEdit()->text() );
populateLocalView();
} else {
QMessageBox::message(tr("Note"),tr("That directory does not exist"));
}
}
if (TabWidget->currentPageIndex() == 1) {
currentRemoteDir = currentPathCombo->lineEdit()->text();
if(currentRemoteDir.right(1) !="/") {
currentRemoteDir = currentRemoteDir +"/";
@@ -1207,32 +1210,32 @@ void OpieFtp::switchToRemoteTab()
void OpieFtp::switchToConfigTab()
{
TabWidget->setCurrentPage(2);
}
void OpieFtp::readConfig()
{
fillCombos();
Config cfg("opieftp");
cfg.setGroup("Server");
currentServerConfig = cfg.readNumEntry("currentServer", -1);
-// qDebug("Reading %d", currentServerConfig);
+// odebug << "Reading " << currentServerConfig << "" << oendl;
serverComboSelected( currentServerConfig-1);
}
void OpieFtp::writeConfig()
{
- qDebug("write config");
+ odebug << "write config" << oendl;
Config cfg("opieftp");
cfg.setGroup("Server");
QString username, remoteServerStr, remotePathStr, password, port, temp;
int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
if( currentServerConfig == -1) {
for (int i = 1; i <= numberOfEntries; i++) {
temp.setNum(i);
cfg.setGroup("Server");
@@ -1245,133 +1248,133 @@ void OpieFtp::writeConfig()
remoteServerStr = cfg.readEntry( temp,"");
int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider);
temp.setNum(numberOfEntries+1);
cfg.setGroup("Server");
cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() );
cfg.writeEntry("currentServer", numberOfEntries+1);
currentServerConfig = numberOfEntries+1;
- qDebug("setting currentserverconfig to %d", currentServerConfig);
+ odebug << "setting currentserverconfig to " << currentServerConfig << "" << oendl;
cfg.setGroup(temp);
if(!newServerName.isEmpty())
cfg.writeEntry("ServerName", newServerName);
cfg.writeEntry("RemotePath", remotePath->text());
cfg.writeEntry("Username", UsernameComboBox->currentText());
cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text());
cfg.setGroup("Server");
cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 ));
}
}
void OpieFtp::clearCombos() {
- qDebug("clearing");
+ odebug << "clearing" << oendl;
ServerComboBox->clear();
UsernameComboBox->clear();
PasswordEdit->clear();
serverListView->clear();
}
void OpieFtp::fillCombos()
{
clearCombos();
Config cfg("opieftp");
cfg.setGroup("Server");
QString username, remoteServerStr, remotePathStr, password, port, temp;
int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
for (int i = 1; i <= numberOfEntries; i++) {
temp.setNum(i);
- qDebug(temp);
+ odebug << temp << oendl;
cfg.setGroup("Server");
remoteServerStr = cfg.readEntry( temp,"");
- qDebug( remoteServerStr);
+ odebug << remoteServerStr << oendl;
int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
port = remoteServerStr.right( divider - 1);
bool ok;
PortSpinBox->setValue( port.toInt(&ok,10));
remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider);
- qDebug( "remote server string "+remoteServerStr);
+ odebug << "remote server string "+remoteServerStr << oendl;
ServerComboBox->insertItem( remoteServerStr );
cfg.setGroup(temp);
username = cfg.readEntry(temp);
UsernameComboBox->insertItem(username);
password = cfg.readEntryCrypt(username,"");
PasswordEdit->setText(password);
serverListView->insertItem( cfg.readEntry("ServerName"));
}
}
void OpieFtp::serverComboSelected(int index)
{
currentServerConfig = index+1;
- qDebug("server combo selected %d", index+1);
+ odebug << "server combo selected " << index+1 << "" << oendl;
QString username, remoteServerStr, remotePathStr, password, port, temp;
// remoteServerStr = ServerComboBox->text(index);
Config cfg("opieftp");
cfg.setGroup("Server");
// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
temp.setNum(index+1);
remoteServerStr = cfg.readEntry( temp,"");
- qDebug("Group" +temp);
+ odebug << "Group" +temp << oendl;
cfg.setGroup(temp);
-// qDebug(temp);
+// odebug << temp << oendl;
int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
port = remoteServerStr.right( divider - 1);
bool ok;
int portInt = port.toInt(&ok,10);
if( portInt == 0) portInt = 21;
ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE)));
PortSpinBox->setValue( portInt);
remotePath->setText(cfg.readEntry("RemotePath", "/"));
username = cfg.readEntry("Username", "anonymous");
UsernameComboBox->lineEdit()->setText(username);
- qDebug(username);
-// qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org"));
+ odebug << username << oendl;
+// odebug << "Password is "+cfg.readEntryCrypt(username << oendl;
PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org"));
// UsernameComboBox
// PasswordEdit
cfg.setGroup("Server");
temp.sprintf("%d",currentServerConfig);
cfg.writeEntry("currentServer", temp);
fuckeduphack = TRUE;
serverListView->setCurrentItem( index);
fuckeduphack=FALSE;
- qDebug("server list set selected %d",index);
+ odebug << "server list set selected " << index << "" << oendl;
update();
}
void OpieFtp::deleteServer()
{
QString username, remoteServerStr, remotePathStr, password, port, temp, servername;
remoteServerStr = ServerComboBox->currentText( );
username = UsernameComboBox->currentText();
servername=serverListView->currentText();
Config cfg("opieftp");
cfg.setGroup("Server");
@@ -1382,25 +1385,25 @@ void OpieFtp::deleteServer()
temp.setNum(i);
// cfg.setGroup("Server");
cfg.setGroup(QString::number(i));
tempname=cfg.readEntry( "ServerName","");
if( tempname.find( servername,0,TRUE) != -1 ) {
// servername.find( cfg.readEntry("ServerName")) != -1 &&
// remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 &&
// username.find( cfg.readEntry("Username")) != -1) {
serverListView->removeItem(i);
- qDebug("OK DELETE "+tempname);
+ odebug << "OK DELETE "+tempname << oendl;
cfg.removeEntry(QString::number(i));
for ( ; i <= numberOfEntries; i++) {
cfg.setGroup("Server");
cfg.writeEntry("Server", QString::number(numberOfEntries + 1 ));
cfg.setGroup(QString::number(i+1)); //get next server config
servername=cfg.readEntry("ServerName");
remoteServerStr=cfg.readEntry("RemotePath");
username=cfg.readEntry("Username");
password=cfg.readEntryCrypt( username);
cfg.setGroup(QString::number(i));
@@ -1437,33 +1440,33 @@ void OpieFtp::upDir()
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
currentDir.cd( current, TRUE);
populateLocalView();
update();
} else {
if( FtpCDUp( conn) == 0) {
QString msg;
msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
-// qDebug(msg);
+// odebug << msg << oendl;
}
char path[256];
if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
QString msg;
msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
-// qDebug(msg);
+// odebug << msg << oendl;
}
currentRemoteDir=path;
remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
if(currentRemoteDir.right(1) !="/")
currentRemoteDir +="/";
currentPathCombo->lineEdit()->setText( currentRemoteDir);
fillRemoteCombo( (const QString &)currentRemoteDir);
}
}
void OpieFtp::docButtonPushed() {
@@ -1506,24 +1509,24 @@ void OpieFtp::NewServer() {
}
}
currentServerConfig =-1;
writeConfig();
serverListView->insertItem( newServerName );
serverListView->setCurrentItem( serverListView->count());
}
}
void OpieFtp::serverListClicked( const QString &item) {
if(item.isEmpty()) return;
Config cfg("opieftp");
- qDebug("highltined "+item);
+ odebug << "highltined "+item << oendl;
int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
for (int i = 1; i <= numberOfEntries; i++) {
cfg.setGroup(QString::number(i));
if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack)
serverComboSelected(i-1);
}
}
void OpieFtp::timerOut() {
}
diff --git a/noncore/net/opieftp/opieftp.pro b/noncore/net/opieftp/opieftp.pro
index 2f97dc2..003b166 100644
--- a/noncore/net/opieftp/opieftp.pro
+++ b/noncore/net/opieftp/opieftp.pro
@@ -1,11 +1,10 @@
-#CONFIG += qt warn_on quick-app
-CONFIG += qt warn_on
-HEADERS = opieftp.h inputDialog.h
-SOURCES = opieftp.cpp inputDialog.cpp main.cpp
-TARGET = opieftp
+CONFIG += qt warn_on
+HEADERS = opieftp.h inputDialog.h
+SOURCES = opieftp.cpp inputDialog.cpp main.cpp
+TARGET = opieftp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lftplib
+LIBS += -lqpe -lopiecore2 -lftplib
DESTDIR = $(OPIEDIR)/bin
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/opieirc/config.in b/noncore/net/opieirc/config.in
index a61cf70..2c56523 100644
--- a/noncore/net/opieirc/config.in
+++ b/noncore/net/opieirc/config.in
@@ -1,4 +1,4 @@
config OPIEIRC
boolean "opie-irc (chat via your favorite IRC server)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBQTAUX
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBQTAUX
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index 22387b3..6d93a34 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -1,15 +1,18 @@
-#include <stdio.h>
#include "ircmisc.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) {
}
int IRCTabBar::insertTab(QTab *tab, int index) {
/* FIXME: find some nicer way to do this */
QExtTab *ext = new QExtTab();
ext->color = black;
ext->label = tab->text();
ext->r = tab->rect();
ext->enabled = tab->isEnabled();
ext->iconset = tab->iconSet();
delete tab;
@@ -55,29 +58,29 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
if (m_history.count() > 0 && m_index > 0) {
m_index--;
setText(m_history[m_index]);
}
if (m_index == 0) {
m_index = -1;
setText("");
}
} else if (key == Key_Return) {
m_history.prepend(text());
m_index = -1;
} else if (key == Key_Tab) {
- printf("got tab\n");
+ odebug << "got tab" << oendl;
return;
}
QLineEdit::keyPressEvent(event);
}
bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *k = (QKeyEvent *) event;
/* Catch tab characters */
if (k->key() == Key_Tab) {
- qDebug("tab!");
+ odebug << "tab!" << oendl;
return TRUE;
}
}
return QLineEdit::eventFilter(object, event);
}
diff --git a/noncore/net/opieirc/opieirc.pro b/noncore/net/opieirc/opieirc.pro
index 4f9092f..2455ec4 100644
--- a/noncore/net/opieirc/opieirc.pro
+++ b/noncore/net/opieirc/opieirc.pro
@@ -1,25 +1,24 @@
-CONFIG = qt warn_on quick-app
-HEADERS = ircchannel.h ircconnection.h \
+CONFIG = qt warn_on quick-app
+HEADERS = ircchannel.h ircconnection.h \
ircmessage.h \
ircmessageparser.h ircoutput.h \
ircperson.h ircserver.h ircsession.h \
mainwindow.h irctab.h ircservertab.h \
ircchanneltab.h ircchannellist.h \
ircserverlist.h ircservereditor.h \
ircquerytab.h ircsettings.h ircmisc.h
-SOURCES = ircchannel.cpp ircconnection.cpp \
+SOURCES = ircchannel.cpp ircconnection.cpp \
ircmessage.cpp \
ircmessageparser.cpp ircoutput.cpp \
ircperson.cpp ircserver.cpp \
ircsession.cpp main.cpp mainwindow.cpp \
irctab.cpp ircservertab.cpp \
ircchanneltab.cpp ircchannellist.cpp \
ircserverlist.cpp ircservereditor.cpp \
ircquerytab.cpp ircsettings.cpp ircmisc.cpp
INCLUDEPATH += $(OPIEDIR)/include
-DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopieui2 -lqtaux2
-
-TARGET = opieirc
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe -lopiecore2 -lopieui2 -lqtaux2
+TARGET = opieirc
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 8a7f0bc..1d93f5c 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -197,25 +197,25 @@ namespace OpieTooth {
if ((bluezactive != oldactive) || (bluezDiscoveryActive != olddiscovery)) {
update();
}
}
/**
* Implementation of the paint event
* @param the QPaintEvent
*/
void BluezApplet::paintEvent( QPaintEvent* ) {
QPainter p(this);
- qDebug("paint bluetooth pixmap");
+ odebug << "paint bluetooth pixmap" << oendl;
if (bluezactive > 0) {
p.drawPixmap( 0, 1, bluezOnPixmap );
} else {
p.drawPixmap( 0, 1, bluezOffPixmap );
}
if (bluezDiscoveryActive > 0) {
p.drawPixmap( 0, 1, bluezDiscoveryOnPixmap );
}
}
};
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index 09b19d2..37f2ae7 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -36,25 +36,25 @@ StartConnection::ConnectionType StartDunConnection::type() {
return m_connectionType;
}
void StartDunConnection::start() {
m_dunConnect = new OProcess();
*m_dunConnect << "dund" << "--listen" << "--connect" << m_mac;
connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
this, SLOT( slotExited(Opie::Core::OProcess*) ) );
connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
- qWarning( "could not start" );
+ owarn << "could not start" << oendl;
delete m_dunConnect;
}
}
void StartDunConnection::slotExited( OProcess* proc ) {
delete m_dunConnect;
}
void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len)
{}
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index 24ac530..50afc9f 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -30,55 +30,55 @@ QString StartPanConnection::name() {
}
void StartPanConnection::setConnectionType() {
m_connectionType = Pan;
}
StartConnection::ConnectionType StartPanConnection::type() {
return m_connectionType;
}
void StartPanConnection::start() {
m_panConnect = new OProcess();
- qDebug( "IM START " + m_mac );
+ odebug << "IM START " + m_mac << oendl;
*m_panConnect << "pand" << "--connect" << m_mac;
connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
this, SLOT( slotExited(Opie::Core::OProcess*) ) );
connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
- qWarning( "could not start" );
+ owarn << "could not start" << oendl;
delete m_panConnect;
}
}
void StartPanConnection::slotExited( OProcess* proc ) {
delete m_panConnect;
m_panConnect = 0l;
}
void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
{}
void StartPanConnection::stop() {
if ( m_panConnect ) {
delete m_panConnect;
m_panConnect = 0l;
}
m_panConnect = new OProcess();
- qDebug("IM STOP " + m_mac);
+ odebug << "IM STOP " + m_mac << oendl;
*m_panConnect << "pand" << "--kill" << m_mac;
connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
this, SLOT( slotExited(Opie::Core::OProcess*) ) );
connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
- qWarning( "could not stop" );
+ owarn << "could not stop" << oendl;
delete m_panConnect;
}
}
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 29030ab..b1cddd2 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -146,25 +146,25 @@ void BlueBase::writeConfig()
cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
cfg.writeEntry( "enablePagescan" , m_enablePagescan );
cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
writeToHciConfig();
}
/**
* Modify the hcid.conf file to our needs
*/
void BlueBase::writeToHciConfig()
{
- qWarning("writeToHciConfig");
+ owarn << "writeToHciConfig" << oendl;
HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
hciconf.load();
hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" );
hciconf.setName( m_deviceName );
hciconf.setEncrypt( m_useEncryption );
hciconf.setAuth( m_enableAuthentification );
hciconf.setPscan( m_enablePagescan );
hciconf.setIscan( m_enableInquiryscan );
hciconf.save();
}
@@ -358,81 +358,81 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
* delete the PopupMenu otherwise it's the responsibility of
* the PopupMenu to delete itself
*
*/
else if ( ((BTListItem*)item)->type() == "service")
{
BTServiceItem* service = (BTServiceItem*)item;
QMap<int, QString> list = service->services().classIdList();
QMap<int, QString>::Iterator it = list.begin();
QPopupMenu *popup =0l;
if ( it != list.end() )
{
- qWarning("Searching id %d %s", it.key(), it.data().latin1() );
+ owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl;
popup = m_popHelper.find( it.key(),
service->services(),
(BTDeviceItem*)service->parent() );
}
else
{
- qWarning("Empty");
+ owarn << "Empty" << oendl;
}
if ( popup == 0l )
{
- qWarning("factory returned 0l");
+ owarn << "factory returned 0l" << oendl;
popup = new QPopupMenu();
}
int test1 = popup->insertItem( tr("Test1:"), 2);
ret = popup->exec( point );
- qWarning("returned from exec() ");
+ owarn << "returned from exec() " << oendl;
if ( ret == -1 )
{
;
}
else if ( ret == test1 )
{
;
}
delete popup;
}
delete menu;
}
/**
* Search and display avail. services for a device (on expand from device listing)
* @param item the service item returned
*/
void BlueBase::addServicesToDevice( BTDeviceItem * item )
{
- qDebug("addServicesToDevice");
+ odebug << "addServicesToDevice" << oendl;
// row of mac adress text(3)
RemoteDevice device = item->remoteDevice();
m_deviceList.insert( item->mac() , item );
// and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
m_localDevice->searchServices( device );
}
/**
* Overloaded. This one it the one that is
ted to the foundServices signal
* @param device the mac address of the remote device
* @param servicesList the list with the service the device has.
*/
void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
{
- qDebug("fill services list");
+ odebug << "fill services list" << oendl;
QMap<QString,BTDeviceItem*>::Iterator it;
BTDeviceItem* deviceItem = 0;
// get the right devices which requested the search
it = m_deviceList.find( device );
if( it == m_deviceList.end() )
return;
deviceItem = it.data();
// remove previous entries
QList<QListViewItem> tempList;
@@ -598,25 +598,25 @@ void BlueBase::deviceActive( const RemoteDevice &device )
// We should have a BTDeviceItem there or where does it get added to the map -zecke
m_localDevice->isAvailable( device.mac() );
}
/**
* The signal catcher. Set the avail. status on device.
* @param device - the mac address
* @param connected - if it is avail. or not
*/
void BlueBase::deviceActive( const QString& device, bool connected )
{
- qDebug("deviceActive slot");
+ odebug << "deviceActive slot" << oendl;
QMap<QString,BTDeviceItem*>::Iterator it;
it = m_deviceList.find( device );
if( it == m_deviceList.end() )
return;
BTDeviceItem* deviceItem = it.data();
if ( connected )
{
diff --git a/noncore/net/opietooth/manager/devicehandler.cpp b/noncore/net/opietooth/manager/devicehandler.cpp
index 9c5b817..bd34351 100644
--- a/noncore/net/opietooth/manager/devicehandler.cpp
+++ b/noncore/net/opietooth/manager/devicehandler.cpp
@@ -24,31 +24,31 @@ QString path = QDir::homeDirPath() + "/Settings/bluetooth";
QStringList devicesFileList = deviceListSave.entryList();
// cut .conf of to get the mac and also read the name entry in it.
if (!devicesFileList.isEmpty() ) {
QString name;
QString mac;
QStringList::Iterator it;
for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) {
if ( (*it) == "." || (*it) == ".." )
continue;
- qDebug((*it).latin1() );
+ odebug << (*it).latin1() << oendl;
Config conf(path + "/"+(*it), Config::File);
conf.setGroup("Info");
name = conf.readEntry("name", "Error");
mac = conf.readEntry("mac", QString::null);
- qDebug("MAC: " + mac);
- qDebug("NAME: " + name);
+ odebug << "MAC: " + mac << oendl;
+ odebug << "NAME: " + name << oendl;
if (mac.isEmpty() )
continue;
RemoteDevice currentDevice( mac , name );
list.append( currentDevice );
}
}
return list;
};
/*
* This is some how rude but make sure all old devices
* are getting deleted
*/
@@ -57,31 +57,31 @@ void DeviceHandler::save( const RemoteDevice::ValueList& list) {
rm += "rm -rf ";
rm += QDir::homeDirPath() + "/Settings/bluetooth";
system ( rm.data() );
if (list.isEmpty() ) // no need to create the dir
return;
/**
* Create a new dir
*/
rm = "mkdir ";
rm += QDir::homeDirPath() + "/Settings/bluetooth";
- qWarning("out %s", rm.data() );
+ owarn << "out " << rm.data() << "" << oendl;
system( rm.data() );
RemoteDevice::ValueList::ConstIterator it;
// write the config
for ( it = list.begin(); it != list.end(); ++it ) {
- qDebug( "/Settings/bluetooth/" + (*it).mac() + ".conf");
+ odebug << "/Settings/bluetooth/" + (*it).mac() + ".conf" << oendl;
Config conf( QDir::homeDirPath() +
"/Settings/bluetooth/" +
(*it).mac() + ".conf", Config::File );
conf.setGroup( "Info" );
conf.writeEntry( "name", (*it).name() );
conf.writeEntry( "mac", (*it).mac() );
}
}
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp
index 3043f71..5b01d2f 100644
--- a/noncore/net/opietooth/manager/dunpopup.cpp
+++ b/noncore/net/opietooth/manager/dunpopup.cpp
@@ -2,25 +2,25 @@
#include <qtimer.h>
#include "dunpopup.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
- qWarning("DunPopup c'tor");
+ owarn << "DunPopup c'tor" << oendl;
m_item = item;
QAction *a, *b, *c;
m_dunconnection = 0l;
/* connect action */
a = new QAction(); // so it's get deleted
a->setText( tr("connect") );
a->addTo( this );
connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp
index 35e9cd9..71c935c 100644
--- a/noncore/net/opietooth/manager/hciconfwrapper.cpp
+++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp
@@ -65,75 +65,75 @@ namespace OpieTooth {
void HciConfWrapper::setValue(const QString &key, const QString &value ) {
if (m_file.isEmpty() ) // load first
return;
QStringList::Iterator it;
QString str;
for (it = m_file.begin(); it != m_file.end(); ++it ) {
str = (*it);
if( (str.contains(key)) > 0 ) {
- qDebug("Found");
+ odebug << "Found" << oendl;
// still need to look if its commented out!!!
str.simplifyWhiteSpace();
- qDebug( key );
+ odebug << key << oendl;
if (str.startsWith("#")) {
str = (key + " " + value + ";");
} else {
str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";");
}
- qDebug( str );
+ odebug << str << oendl;
it = m_file.remove( it );
it = m_file.insert( it, str );
//return; the regexp is too wide -zecke // all set
}
}
}
/**
* This loads the config file and stores it inside
* the m_file
*/
void HciConfWrapper::load() {
- qWarning("loaded");
+ owarn << "loaded" << oendl;
m_file.clear();
QFile file( m_fileName );
if (!file.open( IO_ReadOnly ) ) {
- qDebug("Could not open");
+ odebug << "Could not open" << oendl;
return;
}
/**
* readAll() into a QByteArray
* QStringList::split('\n', array )
* would this be faster? -zecke
*/
QTextStream stream(&file );
QString tmp;
while ( !stream.atEnd() ) {
tmp = stream.readLine();
m_file.append( tmp );
}
}
void HciConfWrapper::save() {
- qWarning("save");
+ owarn << "save" << oendl;
if (m_file.isEmpty() ) // load first
return;
QFile file( m_fileName );
if ( !file.open(IO_WriteOnly ) ) {
- qWarning("could not open %s", m_fileName.latin1() );
+ owarn << "could not open " << m_fileName.latin1() << "" << oendl;
return;
}
QTextStream stream(&file );
QStringList::Iterator it;
for ( it = m_file.begin(); it != m_file.end(); ++it ) {
stream << (*it) << endl;
}
- qWarning("saved");
+ owarn << "saved" << oendl;
};
}
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 1ef862a..3a3dbb0 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -71,19 +71,19 @@ void ObexDialog::sendData() {
QString fileURL = cmdLine->text();
QString file = QFileInfo( fileURL ).fileName();
QString modifiedName = chNameLine->text();
// vom popupmenu beziehen
OProcess* obexSend = new OProcess();
if ( !modifiedName.isEmpty() ) {
*obexSend << "ussp-push" << m_device << fileURL << modifiedName;
} else {
*obexSend << "ussp-push" << m_device << fileURL << file;
}
if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
- qWarning("could not start");
+ owarn << "could not start" << oendl;
delete obexSend;
}
}
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp
index d147d52..9a50199 100644
--- a/noncore/net/opietooth/manager/obexpopup.cpp
+++ b/noncore/net/opietooth/manager/obexpopup.cpp
@@ -7,39 +7,39 @@
/* QT */
#include <qtimer.h>
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
ObexPopup::ObexPopup()
: QPopupMenu()
{
- qWarning("RfcCommPopup c'tor");
+ owarn << "RfcCommPopup c'tor" << oendl;
QAction* a;
/* connect action */
a = new QAction( ); // so it's get deleted
a->setText("Push file");
a->addTo( this );
connect( a, SIGNAL( activated() ),
this, SLOT( slotPush() ) );
};
ObexPopup::~ObexPopup()
{}
void ObexPopup::slotPush()
{
- qWarning("push something");
+ owarn << "push something" << oendl;
ObexDialog obexDialog;
QPEApplication::execDialog( &obexDialog );
}
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index 8b05964..43c2777 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -2,25 +2,25 @@
#include <qtimer.h>
#include "panpopup.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
- qWarning("PanPopup c'tor");
+ owarn << "PanPopup c'tor" << oendl;
m_item = item;
QAction *a, *b, *c;
m_panconnection = 0l;
/* connect action */
a = new QAction(); // so it's get deleted
a->setText( tr("connect") );
a->addTo( this );
connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp
index ab22fea..19deb19 100644
--- a/noncore/net/opietooth/manager/popuphelper.cpp
+++ b/noncore/net/opietooth/manager/popuphelper.cpp
@@ -7,28 +7,28 @@ using namespace OpieTooth;
PopupHelper::PopupHelper() {
init();
}
PopupHelper::~PopupHelper() {
}
void PopupHelper::insert( int id, popupFactory fact ) {
m_map.insert(id, fact );
}
QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) {
- //qWarning("find");
+ //owarn << "find" << oendl;
FactoryMap::Iterator it = m_map.find(id );
if ( it != m_map.end() ) {
- //qWarning("found");
+ //owarn << "found" << oendl;
popupFactory fact = it.data();
return (*fact)(ser, item);
}
return 0l;
}
void PopupHelper::init() {
insert( 4355, newRfcComPopup );
insert( 4354, newDunPopup );
insert( 4353, newRfcComPopup );
insert( 4357, newObexPushPopup );
insert( 4358, newObexPushPopup );
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 78c1501..989bf45 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -47,23 +47,23 @@ PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl,
PPPDialog::~PPPDialog() {
}
void PPPDialog::connectToDevice() {
outPut->clear();
// vom popupmenu beziehen
QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
OProcess* pppDial = new OProcess();
*pppDial << "pppd" << m_device << "call" << connectScript;
connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) );
if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
- qWarning("could not start");
+ owarn << "could not start" << oendl;
delete pppDial;
}
}
void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
QCString str(cha, len );
outPut->insertLine( str );
delete pppDial;
}
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index fc76301..4469129 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -62,46 +62,46 @@ void RfcommAssignDialog::newDevice( const QString & mac )
RfcommDialogItem *newDev = new RfcommDialogItem( &dialog );
newDev->setIdent( i );
newDev->setMac( mac );
if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted )
{
RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
m_itemList.insert( i , rfcomm );
rfcomm->setIdent( i );
rfcomm->setMac( mac );
rfcomm->setChannel( newDev->channel() );
rfcomm->setComment( newDev->comment() );
- qDebug( "New device set up" );
+ odebug << "New device set up" << oendl;
}
}
}
}
void RfcommAssignDialog::loadConfig()
{
//Config cfg( "bluetoothmanager-rfcommbind" );
for ( int i = 0 ; i < m_range; i++ )
{
// cfg.setGroup( QString("%1").arg( i ) );
RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
m_itemList.insert( i , rfcomm );
rfcomm->setIdent( i );
QMap<QString, RfCommConfObject*>::Iterator it;
it = confHandler->foundEntries().find( QString("%1").arg( i ) );
if ( it != confHandler->foundEntries().end() )
{
- qDebug( "Found key in foundEntries() " );
+ odebug << "Found key in foundEntries() " << oendl;
rfcomm->setMac( it.data()->mac() );
rfcomm->setChannel( it.data()->channel() );
rfcomm->setComment( it.data()->comment() );
}
/* Use rfcomm.conf directly for now
* rfcomm->setMac( cfg.readEntry( "mac", "" ) );
* rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
* rfcomm->setComment( cfg.readEntry( "comment", "" ) );
*/
}
}
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index 20453e8..2ef95ff 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -83,32 +83,32 @@ void RfCommConfHandler::load() {
QString number;
QString mac;
QString channel;
QString comment;
for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
QString tmpLine = ( *line ).stripWhiteSpace();
if ( tmpLine.startsWith("rfcomm") ) {
QString number = tmpLine.mid( 6,1 );
- qDebug( tmpLine );
- qDebug( "TEST " + number );
+ odebug << tmpLine << oendl;
+ odebug << "TEST " + number << oendl;
} else if ( tmpLine.startsWith( "}" ) ) {
m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
} else if ( tmpLine.startsWith( "device" ) ) {
mac = tmpLine.mid( 7, 17 );
- qDebug( "mac" + mac );
+ odebug << "mac" + mac << oendl;
} else if ( tmpLine.startsWith( "channel" ) ) {
channel = tmpLine.mid( 8, 1 );
qDebug ( "Channel :" + channel );
} else if ( tmpLine.startsWith( "comment" ) ) {
comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
- qDebug( "Comment: " + comment );
+ odebug << "Comment: " + comment << oendl;
}
}
rfCommConf.close();
}
save( m_foundEntries );
- qDebug( QString( "ENTries: %1").arg( m_foundEntries.count() ) );
+ odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
}
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 04bfe48..01ad616 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -8,25 +8,25 @@
/* QT */
#include <qtimer.h>
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
: QPopupMenu()
{
- qWarning("RfcCommPopup c'tor");
+ owarn << "RfcCommPopup c'tor" << oendl;
QAction* a;
m_item = item;
/* connect action */
a = new QAction( ); // so it's get deleted
a->setText("Connect");
a->addTo( this );
connect( a, SIGNAL( activated() ),
this, SLOT( slotConnect() ) );
@@ -61,43 +61,43 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
RfcCommPopup::~RfcCommPopup()
{
/* delete m_con;
delete m_dis;
delete m_foo;
delete m_bar; */
}
void RfcCommPopup::slotConnect()
{
- qWarning("connect");
+ owarn << "connect" << oendl;
PPPDialog pppDialog;
QPEApplication::execDialog( &pppDialog );
}
void RfcCommPopup::slotDisconnect()
{
- qWarning("slot disconnected");
+ owarn << "slot disconnected" << oendl;
}
void RfcCommPopup::slotBind()
{
RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
rfcommAssign.newDevice( m_item->mac() );
if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
{
rfcommAssign.saveConfig();
}
}
void RfcCommPopup::slotBar()
{
- qWarning("slotBar");
+ owarn << "slotBar" << oendl;
};
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index c8ea3e3..3b005c4 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -146,16 +146,16 @@ namespace OpieTooth {
if ( ( (QCheckListItem*)it.current() )->isOn() ) {
RemoteDevice device( it.current()->text(1), it.current()->text(0) );
deviceList.append( device );
}
}
emit selectedDevices( deviceList );
}
/**
* Cleanup
*/
ScanDialog::~ScanDialog() {
- qWarning("delete scan dialog");
+ owarn << "delete scan dialog" << oendl;
delete localDevice;
}
}
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index da39113..bfdb20a 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -14,50 +14,46 @@
**********************************************************************/
/* LOCAL */
#include "configwindow.h"
#include "mainwindow.h"
/* OPIE */
#include <opie2/onetwork.h>
#ifdef QWS
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
#include <opie2/odevice.h>
-using namespace Opie;
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+using namespace Opie::Net;
#endif
/* QT */
#include <qapplication.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qfile.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qmap.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qtoolbutton.h>
#include <qspinbox.h>
#include <qtextstream.h>
-/* POSIX */
+/* STD */
#include <assert.h>
-using namespace Opie::Core;
-using namespace Opie::Net;
-using namespace Opie::Core;
-using namespace Opie::Net;
-using namespace Opie::Core;
-using namespace Opie::Net;
WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
:WellenreiterConfigBase( parent, name, true, f )
{
_devicetype[ "cisco" ] = DEVTYPE_CISCO;
_devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG;
_devicetype[ "hostap" ] = DEVTYPE_HOSTAP;
_devicetype[ "orinoco" ] = DEVTYPE_ORINOCO;
_devicetype[ "<manual>" ] = DEVTYPE_MANUAL;
_devicetype[ "<file>" ] = DEVTYPE_FILE;
@@ -107,46 +103,46 @@ void WellenreiterConfigWindow::accept()
WellenreiterConfigWindow::~WellenreiterConfigWindow()
{
}
void WellenreiterConfigWindow::performAutodetection()
{
//TODO: insert modal splash screen here
// and sleep a second, so that it looks
// like we're actually doing something fancy... ;-)
- qDebug( "WellenreiterConfigWindow::performAutodetection()" );
+ odebug << "WellenreiterConfigWindow::performAutodetection()" << oendl;
// try to guess device type
QFile m( "/proc/modules" );
if ( m.open( IO_ReadOnly ) )
{
int devicetype(0);
QString line;
QTextStream modules( &m );
while( !modules.atEnd() && !devicetype )
{
modules >> line;
if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO;
else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP;
else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG;
else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
}
if ( devicetype )
{
deviceType->setCurrentItem( devicetype );
_guess = devicetype;
- qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
+ odebug << "Wellenreiter: guessed device type to be #" << devicetype << "" << oendl;
}
}
}
int WellenreiterConfigWindow::driverType() const
{
QString name = deviceType->currentText();
if ( _devicetype.contains( name ) )
{
return _devicetype[name];
}
@@ -232,25 +228,25 @@ void WellenreiterConfigWindow::changedClientAction(int t)
}
void WellenreiterConfigWindow::changedStationAction(int t)
{
synchronizeActionsAndScripts();
}
void WellenreiterConfigWindow::getCaptureFileNameClicked()
{
QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
- qDebug( "name = %s", (const char*) name );
+ odebug << "name = " << (const char*) name << "" << oendl;
if ( !name.isEmpty() )
{
captureFileName->setText( name );
}
}
void WellenreiterConfigWindow::channelAllClicked(int state)
{
bool b = state;
channel1->setChecked( b );
channel2->setChecked( b );
@@ -307,70 +303,70 @@ void WellenreiterConfigWindow::performAction( const QString& type,
else if ( type == "managed" || type == "adhoc" )
{
action = newClientAction->currentItem();
script = newClientScript->text();
}
else if ( type == "station" )
{
action = newStationAction->currentItem();
script = newStationScript->text();
}
else
{
- qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type );
+ owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << (const char*) type << "'" << oendl;
return;
}
- qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script );
+ odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << (const char*) script << "')" << oendl;
switch( action )
{
case 0: /* Ignore */ return;
case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return;
case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return;
case 3: /* Blink LED */ break; //FIXME: Implement this
case 4: /* Run Script */
{
/**
*
* Script Substitution Information:
*
* $SSID = SSID
* $MAC = MAC
* $WEP = Wep
* $CHAN = Channel
*
**/
script = script.replace( QRegExp( "$SSID" ), essid );
script = script.replace( QRegExp( "$MAC" ), mac );
script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) );
script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) );
- qDebug( "going to call script '%s'", (const char*) script );
+ odebug << "going to call script '" << (const char*) script << "'" << oendl;
::system( script );
- qDebug( "script returned." );
+ odebug << "script returned." << oendl;
return;
}
default: assert( false );
}
}
void WellenreiterConfigWindow::load()
{
#ifdef Q_WS_X11
#warning Persistent Configuration not yet implemented for standalone X11 build
performAutodetection();
#else
- qDebug( "loading configuration settings..." );
+ odebug << "loading configuration settings..." << oendl;
/* This is dumb monkey typing stuff... We _need_ to do this automatically! */
OConfig* c = oApp->config();
c->setGroup( "Interface" );
QString interface = c->readEntry( "name", "<none>" );
if ( interface != "<none>" )
{
#if QT_VERSION < 300
interfaceName->insertItem( interface, 0 );
@@ -430,25 +426,25 @@ void WellenreiterConfigWindow::load()
startGPS->setChecked( c->readBoolEntry( "start", false ) );
commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) );
#endif
}
void WellenreiterConfigWindow::save()
{
#ifdef Q_WS_X11
#warning Persistent Configuration not yet implemented for standalone X11 build
#else
- qDebug( "saving configuration settings..." );
+ odebug << "saving configuration settings..." << oendl;
/* This is dumb monkey typing stuff... We _need_ to do this automatically! */
OConfig* c = oApp->config();
c->setGroup( "Interface" );
c->writeEntry( "name", interfaceName->currentText() );
c->writeEntry( "type", deviceType->currentText() );
c->writeEntry( "prism", prismHeader->isChecked() );
c->writeEntry( "hop", hopChannels->isChecked() );
c->writeEntry( "interval", hopInterval->value() );
c->writeEntry( "adaptive", adaptiveHopping->isChecked() );
diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp
index a47b4ec..bd91e35 100644
--- a/noncore/net/wellenreiter/gui/gps.cpp
+++ b/noncore/net/wellenreiter/gui/gps.cpp
@@ -6,71 +6,75 @@
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "gps.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
/* QT */
#include <qtextstream.h>
/* STD */
#include <stdlib.h>
#include <unistd.h>
GPS::GPS( QObject* parent, const char * name )
:QObject( parent, name )
{
- qDebug( "GPS::GPS()" );
+ odebug << "GPS::GPS()" << oendl;
_socket = new QSocket( this, "gpsd commsock" );
}
GPS::~GPS()
{
- qDebug( "GPS::~GPS()" );
+ odebug << "GPS::~GPS()" << oendl;
}
bool GPS::open( const QString& host, int port )
{
_socket->connectToHost( host, port );
}
GpsLocation GPS::position() const
{
char buf[256];
double lat = -111.0;
double lon = -111.0;
int result = _socket->writeBlock( "p\r\n", 3 );
_socket->flush();
if ( result )
{
int numAvail = _socket->bytesAvailable();
- qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail );
+ odebug << "GPS write succeeded, " << numAvail << " bytes available for reading..." << oendl;
if ( numAvail )
{
int numRead = _socket->readBlock( &buf[0], sizeof buf );
int numScan = ::sscanf( &buf[0], "GPSD,P=%lg %lg", &lat, &lon);
if ( numRead < 7 || numScan != 2 )
{
- qDebug( "GPS read %d bytes succeeded, invalid response: '%s'", numRead, &buf[0] );
+ odebug << "GPS read " << numRead << " bytes succeeded, invalid response: '" << &buf[0] << "'" << oendl;
return GpsLocation( -111, -111 );
}
else
{
return GpsLocation( lat, lon );
}
}
}
return GpsLocation( -111, -111 );
}
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
index 1c72cf4..714a9a9 100644
--- a/noncore/net/wellenreiter/gui/logwindow.cpp
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -5,49 +5,55 @@
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "logwindow.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qmultilineedit.h>
#include <qdatetime.h>
MLogWindow* MLogWindow::_instance;
MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f )
:QVBox( parent, name, f )
{
ledit = new QMultiLineEdit( this );
ledit->setReadOnly( true );
MLogWindow::_instance = this;
}
void MLogWindow::log( QString text )
{
QTime time = QTime::currentTime();
QString line;
line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text );
int col;
int row;
ledit->getCursorPosition( &col, &row );
ledit->insertAt( line, col, row );
- qDebug( line );
+ odebug << line << oendl;
}
void MLogWindow::clear()
{
ledit->clear();
}
const QString MLogWindow::getLog() const
{
return ledit->text();
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 6bbc39b..62db967 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -5,97 +5,100 @@
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "mainwindow.h"
+
#ifdef QWS
+#include <opie2/odebug.h>
#include <opie2/oapplication.h>
#include <opie2/oprocess.h>
#else
#include <qapplication.h>
#endif
+/* QT */
#include <qmessagebox.h>
#include <qstringlist.h>
+/* STD */
#include <errno.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
using namespace Opie::Core;
-using namespace Opie::Core;
-using namespace Opie::Core;
+
int main( int argc, char **argv )
{
#ifdef QWS
OApplication a( argc, argv, "Wellenreiter II" );
#else
QApplication a( argc, argv );
#endif
WellenreiterMainWindow* w = new WellenreiterMainWindow();
#ifdef QWS
a.showMainWidget( w );
#else
a.setMainWidget( w );
w->setCaption( "Wellenreiter II" );
w->show();
#endif
a.processEvents(); // show the window before doing the safety checks
int result = -1;
static int killed = false;
bool check = true;
for ( int i = 1; i < argc; ++i )
{
- qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] );
+ odebug << "Wellenreiter::main() parsing argument " << i << " = '" << argv[i] << "'" << oendl;
if ( !strcmp( "-nocheck", argv[i] ) )
{
- qDebug( "-nocheck found" );
+ odebug << "-nocheck found" << oendl;
check = false;
break;
}
}
if ( check )
{
// root check
if ( getuid() )
{
- qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) );
+ owarn << QObject::tr( "Wellenreiter: trying to run as non-root!" ) << oendl;
result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
"as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
QMessageBox::Yes, QMessageBox::No );
if ( result == QMessageBox::No ) return -1;
}
int dhcpid = OProcess::processPID( "dhcpc" );
if ( dhcpid )
{
result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
"(PID = %1)\nThis can severly limit scanning!\nShould I kill it for you?" ).arg( dhcpid ),
QMessageBox::Yes, QMessageBox::No );
if ( result == QMessageBox::Yes )
{
if ( -1 == ::kill( dhcpid, SIGTERM ) )
- qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
+ owarn << "Wellenreiter: can't kill process #" << result << " (" << strerror( errno ) << ")" << oendl;
else
killed = true;
}
}
}
a.exec();
if ( check )
{
if ( killed )
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 7add6cd..a4b8839 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -12,59 +12,60 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "configwindow.h"
#include "gps.h"
#include "logwindow.h"
#include "packetview.h"
#include "mainwindow.h"
#include "wellenreiter.h"
#include "scanlist.h"
+/* OPIE */
+#ifdef QWS
+#include <qpe/resource.h>
+#include <opie2/odebug.h>
+#include <opie2/ofiledialog.h>
+#else
+#include "resource.h"
+#include <qapplication.h>
+#include <qfiledialog.h>
+#endif
+using namespace Opie::Core;
+using namespace Opie::Net;
+using namespace Opie::Ui;
+
+/* QT */
#include <qcombobox.h>
#include <qdatastream.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qiconset.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qstatusbar.h>
#include <qspinbox.h>
#include <qtextstream.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
-#ifdef QWS
-#include <qpe/resource.h>
-#include <opie2/ofiledialog.h>
-using namespace Opie;
-#else
-#include "resource.h"
-#include <qapplication.h>
-#include <qfiledialog.h>
-#endif
-
+/* STD */
#include <unistd.h>
-using namespace Opie::Ui;
-using namespace Opie::Net;
-using namespace Opie::Ui;
-using namespace Opie::Net;
-using namespace Opie::Net;
WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
:QMainWindow( parent, name, f )
{
cw = new WellenreiterConfigWindow( this );
mw = new Wellenreiter( this );
mw->setConfigWindow( cw );
setCentralWidget( mw );
// setup application icon
setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
#ifndef QWS
@@ -179,25 +180,25 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
#ifndef QWS
statusBar()->message( tr( "Ready." ) );
#endif
connect( mw, SIGNAL( startedSniffing() ), this, SLOT( changedSniffingState() ) );
connect( mw, SIGNAL( stoppedSniffing() ), this, SLOT( changedSniffingState() ) );
};
void WellenreiterMainWindow::showConfigure()
{
- qDebug( "show configure..." );
+ odebug << "show configure..." << oendl;
cw->setCaption( tr( "Configure" ) );
int result = QPEApplication::execDialog( cw );
if ( result ) updateToolButtonState();
}
void WellenreiterMainWindow::updateToolButtonState()
{
const QString& interface = cw->interfaceName->currentText();
const int cardtype = cw->driverType();
@@ -222,45 +223,45 @@ void WellenreiterMainWindow::changedSniffingState()
menuBar()->setItemEnabled( stopID, mw->sniffing );
if ( !mw->sniffing )
{
menuBar()->setItemEnabled( uploadID, true );
uploadButton->setEnabled( true );
}
}
WellenreiterMainWindow::~WellenreiterMainWindow()
{
- qDebug( "Wellenreiter: bye." );
+ odebug << "Wellenreiter: bye." << oendl;
};
void WellenreiterMainWindow::demoAddStations()
{
//mw = 0; // test SIGSEGV handling
mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) );
mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) );
}
void WellenreiterMainWindow::demoReadFromGps()
{
WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance();
GPS* gps = new GPS( this );
- qDebug( "Wellenreiter::demoReadFromGps(): url=gps://%s:%d/", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
+ odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl;
gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
GpsLocation loc = gps->position();
QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) );
delete gps;
}
QString WellenreiterMainWindow::getFileName( bool save )
{
QMap<QString, QStringList> map;
map.insert( tr("All"), QStringList() );
QStringList text;
@@ -296,93 +297,93 @@ QString WellenreiterMainWindow::getFileName( bool save )
void WellenreiterMainWindow::fileSaveLog()
{
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QTextStream t( &f );
t << mw->logWindow()->getLog();
f.close();
- qDebug( "Saved log to file '%s'", (const char*) fname );
+ odebug << "Saved log to file '" << (const char*) fname << "'" << oendl;
}
else
{
- qDebug( "Problem saving log to file '%s'", (const char*) fname );
+ odebug << "Problem saving log to file '" << (const char*) fname << "'" << oendl;
}
}
}
void WellenreiterMainWindow::fileSaveSession()
{
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QDataStream t( &f );
t << *mw->netView();
f.close();
- qDebug( "Saved session to file '%s'", (const char*) fname );
+ odebug << "Saved session to file '" << (const char*) fname << "'" << oendl;
}
else
{
- qDebug( "Problem saving session to file '%s'", (const char*) fname );
+ odebug << "Problem saving session to file '" << (const char*) fname << "'" << oendl;
}
}
}
void WellenreiterMainWindow::fileSaveHex()
{
#warning DOES NOT WORK AT THE MOMENT
/*
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QTextStream t( &f );
t << mw->hexWindow()->getLog();
f.close();
- qDebug( "Saved hex log to file '%s'", (const char*) fname );
+ odebug << "Saved hex log to file '" << (const char*) fname << "'" << oendl;
}
else
{
- qDebug( "Problem saving hex log to file '%s'", (const char*) fname );
+ odebug << "Problem saving hex log to file '" << (const char*) fname << "'" << oendl;
}
}
*/
}
void WellenreiterMainWindow::fileLoadSession()
{
QString fname = getFileName( false );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_ReadOnly) )
{
QDataStream t( &f );
t >> *mw->netView();
f.close();
- qDebug( "Loaded session from file '%s'", (const char*) fname );
+ odebug << "Loaded session from file '" << (const char*) fname << "'" << oendl;
}
else
{
- qDebug( "Problem loading session from file '%s'", (const char*) fname );
+ odebug << "Problem loading session from file '" << (const char*) fname << "'" << oendl;
}
}
}
void WellenreiterMainWindow::fileNew()
{
mw->netView()->clear();
mw->logWindow()->clear();
mw->hexWindow()->clear();
}
@@ -429,29 +430,29 @@ void WellenreiterMainWindow::uploadSession()
g->addWidget( reject = new QPushButton( tr( "&Cancel" ), d ), 3, 1 );
accept->setDefault( true );
accept->setAutoDefault( true );
from->setText( "WL II User" );
location->setText( "WL II Location" );
comments->setText( "No Comments." );
connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) );
connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) );
int result = d->exec();
if ( !result )
{
- qDebug( "Session upload cancelled :(" );
+ odebug << "Session upload cancelled :(" << oendl;
return;
}
- qDebug( "Starting upload..." );
+ odebug << "Starting upload..." << oendl;
struct sockaddr_in raddr;
struct hostent *rhost_info;
int sock = -1;
bool ok = false;
rhost_info = (struct hostent *) ::gethostbyname( CAP_hostname );
if ( rhost_info )
{
if ( !QFile::exists( mw->captureFileName() ) )
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp
index 3d3aa18..4df01da 100644
--- a/noncore/net/wellenreiter/gui/packetview.cpp
+++ b/noncore/net/wellenreiter/gui/packetview.cpp
@@ -75,25 +75,25 @@ void PacketView::showPacket( int number )
{
_list->clear();
_hex->setText("");
const OPacket* p = _packets.at( number );
if ( p )
{
_doSubPackets( const_cast<QObjectList*>( p->children() ), 0 );
_doHexPacket( p );
}
else
{
- qDebug( "D'oh! No packet!" );
+ odebug << "D'oh! No packet!" << oendl;
}
}
void PacketView::_doSubPackets( QObjectList* l, int counter )
{
if (!l) return;
QObject* o = l->first();
while ( o )
{
new OListViewItem( _list, QString::number( counter++ ), o->name() );
_doSubPackets( const_cast<QObjectList*>( o->children() ), counter );
o = l->next();
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp
index d98ef0b..cb17f51 100644
--- a/noncore/net/wellenreiter/gui/resource.cpp
+++ b/noncore/net/wellenreiter/gui/resource.cpp
@@ -20,30 +20,30 @@
#include <qiconset.h>
namespace Resource
{
QPixmap loadPixmap( const QString& pix )
{
QString filename;
filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix );
QPixmap pixmap( filename );
if ( pixmap.isNull() )
{
- qDebug( "Wellenreiter::Resource: can't find pixmap " + filename );
+ odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
}
return pixmap;
};
QIconSet loadIconSet( const QString& pix )
{
QString filename;
filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix );
QPixmap pixmap( filename );
if ( pixmap.isNull() )
{
- qDebug( "Wellenreiter::Resource: can't find pixmap " + filename );
+ odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
}
return QIconSet( pixmap );
};
};
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 3b7120a..a2be782 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -8,59 +8,58 @@
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "scanlist.h"
#include "configwindow.h"
#include "logwindow.h"
-#include <assert.h>
-#include <qcursor.h>
-#include <qdatetime.h>
-#include <qpopupmenu.h>
-#include <qcheckbox.h>
-
+/* OPIE */
#ifdef QWS
+#include <opie2/odebug.h>
#include <qpe/qpeapplication.h>
-#endif
-
-#ifdef QWS
#include <qpe/resource.h>
#else
#include "resource.h"
#endif
+using namespace Opie::Core;
+using namespace Opie::Ui;
+using namespace Opie::Net;
+
+/* QT */
+#include <qcursor.h>
+#include <qdatetime.h>
+#include <qpopupmenu.h>
+#include <qcheckbox.h>
+
+/* STD */
+#include <assert.h>
const int col_type = 0;
const int col_essid = 0;
const int col_sig = 1;
const int col_ap = 2;
const int col_channel = 3;
const int col_wep = 4;
const int col_traffic = 5;
const int col_ip = 6;
const int col_manuf = 7;
const int col_firstseen = 8;
const int col_lastseen = 9;
const int col_location = 10;
-using namespace Opie::Net;
-using namespace Opie::Ui;
-using namespace Opie::Net;
-using namespace Opie::Ui;
-using namespace Opie::Ui;
-using namespace Opie::Net;
MScanListView::MScanListView( QWidget* parent, const char* name )
:OListView( parent, name )
{
setFrameShape( QListView::StyledPanel );
setFrameShadow( QListView::Sunken );
addColumn( tr( "Net/Station" ) );
setColumnAlignment( col_essid, AlignLeft || AlignVCenter );
addColumn( tr( "#" ) );
setColumnAlignment( col_sig, AlignCenter );
addColumn( tr( "MAC" ) );
setColumnAlignment( col_ap, AlignCenter );
@@ -97,32 +96,32 @@ MScanListView::~MScanListView()
{
};
OListViewItem* MScanListView::childFactory()
{
return new MScanListItem( this );
}
void MScanListView::serializeTo( QDataStream& s) const
{
- qDebug( "serializing MScanListView" );
+ odebug << "serializing MScanListView" << oendl;
OListView::serializeTo( s );
}
void MScanListView::serializeFrom( QDataStream& s)
{
- qDebug( "serializing MScanListView" );
+ odebug << "serializing MScanListView" << oendl;
OListView::serializeFrom( s );
}
void MScanListView::addNewItem( const QString& type,
const QString& essid,
const OMacAddress& mac,
bool wep,
int channel,
int signal,
const GpsLocation& loc,
bool probe )
@@ -134,68 +133,68 @@ void MScanListView::addNewItem( const QString& type,
(const char*) essid, (const char*) macaddr, channel );
#endif
// search, if we already have seen this net
QString s;
MScanListItem* network;
MScanListItem* item = static_cast<MScanListItem*> ( firstChild() );
while ( item && ( item->text( col_essid ) != essid ) )
{
#ifdef DEBUG
- qDebug( "itemtext: %s", (const char*) item->text( col_essid ) );
+ odebug << "itemtext: " << (const char*) item->text( col_essid ) << "" << oendl;
#endif
item = static_cast<MScanListItem*> ( item->nextSibling() );
}
if ( item )
{
// we have already seen this net, check all childs if MAC exists
network = item;
item = static_cast<MScanListItem*> ( item->firstChild() );
assert( item ); // this shouldn't fail
while ( item && ( item->text( col_ap ) != macaddr ) )
{
#ifdef DEBUG
- qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) );
+ odebug << "subitemtext: " << (const char*) item->text( col_ap ) << "" << oendl;
#endif
item = static_cast<MScanListItem*> ( item->nextSibling() );
}
if ( item )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
- qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
+ odebug << "" << (const char*) macaddr << " is a dupe - ignoring..." << oendl;
#endif
item->receivedBeacon();
return;
}
}
else
{
s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid );
MLogWindow::logwindow()->log( s );
network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe );
}
// insert new station as child from network
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
#ifdef DEBUG
- qDebug( "inserting new station %s", (const char*) macaddr );
+ odebug << "inserting new station " << (const char*) macaddr << "" << oendl;
#endif
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
station->setManufacturer( mac.manufacturer() );
station->setLocation( loc.dmsPosition() );
if ( type == "managed" )
{
s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel );
}
else
{
@@ -203,196 +202,196 @@ void MScanListView::addNewItem( const QString& type,
}
MLogWindow::logwindow()->log( s );
}
void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type )
{
MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) )
{
#ifdef DEBUG
- qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) );
+ odebug << "subitemtext: " << (const char*) subitem->text( col_ap ) << "" << oendl;
#endif
subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
}
if ( subitem )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
- qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) );
+ odebug << "" << (const char*) addr.toString(true) << " is a dupe - ignoring..." << oendl;
#endif
subitem->receivedBeacon(); //FIXME: sent data bit
return;
}
// Hey, it seems to be a new item :-D
MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 );
station->setManufacturer( addr.manufacturer() );
QString s;
if ( type == "station" )
{
s.sprintf( "(i) New Station in '%s' [xx]", (const char*) network->text( col_essid ) );
}
else
{
s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) );
}
MLogWindow::logwindow()->log( s );
}
void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo )
{
- qDebug( "WDSTraffic: %s and %s seem to form a WDS", (const char*) viaFrom.toString(), (const char*) viaTo.toString() );
+ odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << (const char*) viaTo.toString() << " seem to form a WDS" << oendl;
QString s;
MScanListItem* network;
QListViewItemIterator it( this );
while ( it.current() &&
it.current()->text( col_ap ) != viaFrom.toString(true) &&
it.current()->text( col_ap ) != viaTo.toString(true) ) ++it;
MScanListItem* item = static_cast<MScanListItem*>( it.current() );
if ( item ) // Either viaFrom or viaTo AP has shown up yet, so just add our two new stations
{
addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from );
addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to );
}
else
{
- qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" );
+ odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl;
MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" );
}
}
void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
QString s;
MScanListItem* network;
QListViewItemIterator it( this );
while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
MScanListItem* item = static_cast<MScanListItem*>( it.current() );
if ( item ) // AP has shown up yet, so just add our new "from" - station
{
addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" );
}
else
{
- qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
+ odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" );
}
}
void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
QString s;
MScanListItem* network;
QListViewItemIterator it( this );
while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
MScanListItem* item = static_cast<MScanListItem*>( it.current() );
if ( item ) // AP has shown up yet, so just add our new "from" - station
{
addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" );
}
else
{
- qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
+ odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" );
}
}
void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
{
- qWarning( "D'oh! Not yet implemented..." );
+ owarn << "D'oh! Not yet implemented..." << oendl;
MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" );
}
void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
{
- qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip );
+ odebug << "identify " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
QListViewItemIterator it( this );
for ( ; it.current(); ++it )
{
if ( it.current()->text( col_ap ) == macaddr.toString(true) )
{
it.current()->setText( col_ip, ip );
return;
}
}
- qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" );
+ odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!",
(const char*) macaddr.toString(), (const char*) ip ) );
}
void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip )
{
- qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip );
+ odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
//TODO: Refactor that out, we need it all over the place.
// Best to do it in a more comfortable abstraction in OListView
// (Hmm, didn't I already start something in this direction?)
QListViewItemIterator it( this );
for ( ; it.current(); ++it )
{
if ( it.current()->text( col_ap ) == macaddr.toString(true) )
{
MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() );
while ( subitem && ( subitem->text( col_essid ) != name ) )
{
#ifdef DEBUG
- qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) );
+ odebug << "subitemtext: " << (const char*) subitem->text( col_essid ) << "" << oendl;
#endif
subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
}
if ( subitem )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
- qDebug( "%s is a dupe - ignoring...", (const char*) name );
+ odebug << "" << (const char*) name << " is a dupe - ignoring..." << oendl;
#endif
subitem->receivedBeacon(); //FIXME: sent data bit
return;
}
// never seen that - add new item
MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 );
item->setText( col_essid, name );
return;
}
}
- qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" );
+ odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!",
(const char*) macaddr.toString(), (const char*) ip ) );
}
void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col )
{
if ( !item ) return;
MScanListItem* itm = static_cast<MScanListItem*>( item );
qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'",
@@ -412,74 +411,74 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in
//============================================================
// MScanListItem
//============================================================
MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
bool wep, int channel, int signal, bool probed )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
_channel( channel ), _signal( signal ), _beacons( 1 )
{
#ifdef DEBUG
- qDebug( "creating scanlist item" );
+ odebug << "creating scanlist item" << oendl;
#endif
if ( WellenreiterConfigWindow::instance() )
WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
decorateItem( type, essid, macaddr, wep, channel, signal, probed );
}
MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
{
#ifdef DEBUG
- qDebug( "creating scanlist item" );
+ odebug << "creating scanlist item" << oendl;
#endif
if ( WellenreiterConfigWindow::instance() )
WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
decorateItem( type, essid, macaddr, wep, channel, signal, false );
}
const QString& MScanListItem::essid() const
{
if ( type == "network" )
return _essid;
else
return ( (MScanListItem*) parent() )->essid();
}
OListViewItem* MScanListItem::childFactory()
{
return new MScanListItem( this );
}
void MScanListItem::serializeTo( QDataStream& s ) const
{
#ifdef DEBUG
- qDebug( "serializing MScanListItem" );
+ odebug << "serializing MScanListItem" << oendl;
#endif
OListViewItem::serializeTo( s );
s << _type;
s << (Q_UINT8) ( _wep ? 'y' : 'n' );
}
void MScanListItem::serializeFrom( QDataStream& s )
{
#ifdef DEBUG
- qDebug( "serializing MScanListItem" );
+ odebug << "serializing MScanListItem" << oendl;
#endif
OListViewItem::serializeFrom( s );
char wep;
s >> _type;
s >> (Q_UINT8) wep;
_wep = (wep == 'y');
QString name;
name.sprintf( "wellenreiter/%s", (const char*) _type );
setPixmap( col_type, Resource::loadPixmap( name ) );
if ( _wep )
@@ -547,22 +546,22 @@ void MScanListItem::setManufacturer( const QString& manufacturer )
void MScanListItem::setLocation( const QString& location )
{
setText( col_location, location );
}
void MScanListItem::receivedBeacon()
{
_beacons++;
#ifdef DEBUG
- qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons );
+ odebug << "MScanListItem " << (const char*) _macaddr << ": received beacon #" << _beacons << "" << oendl;
#endif
setText( col_sig, QString::number( _beacons ) );
setText( col_lastseen, QTime::currentTime().toString() );
MScanListItem* p = (MScanListItem*) parent();
if ( p ) p->receivedBeacon();
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index fff7c35..fad6efd 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -2,80 +2,72 @@
** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
***********************************************************************/
-// Local
-
#include "gps.h"
#include "wellenreiter.h"
#include "scanlist.h"
#include "logwindow.h"
#include "packetview.h"
#include "configwindow.h"
#include "statwindow.h"
#include "graphwindow.h"
#include "protolistview.h"
-// Opie
-
+/* OPIE */
#ifdef QWS
#include <opie2/oapplication.h>
+#include <opie2/odebug.h>
#include <opie2/odevice.h>
#else
#include <qapplication.h>
#endif
#include <opie2/omanufacturerdb.h>
#include <opie2/onetwork.h>
#include <opie2/opcap.h>
#include <qpe/qcopenvelope_qws.h>
-using namespace Opie;
-
-// Qt
+using namespace Opie::Core;
+using namespace Opie::Net;
+using namespace Opie::Ui;
+/* QT */
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdatetime.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qobjectlist.h>
#include <qregexp.h>
#include <qspinbox.h>
#include <qtimer.h>
#include <qtoolbutton.h>
#include <qmainwindow.h>
-// Standard
-
+/* STD */
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
-using namespace Opie::Core;
-using namespace Opie::Net;
-using namespace Opie::Net;
-using namespace Opie::Core;
-using namespace Opie::Net;
-using namespace Opie::Core;
Wellenreiter::Wellenreiter( QWidget* parent )
: WellenreiterBase( parent, 0, 0 ),
sniffing( false ), iface( 0 ), configwindow( 0 )
{
logwindow->log( "(i) Wellenreiter has been started." );
//
// detect operating system
//
#ifdef QWS
@@ -97,25 +89,25 @@ Wellenreiter::Wellenreiter( QWidget* parent )
}
Wellenreiter::~Wellenreiter()
{
delete pcap;
}
void Wellenreiter::initialTimer()
{
- qDebug( "Wellenreiter::preloading manufacturer database..." );
+ odebug << "Wellenreiter::preloading manufacturer database..." << oendl;
OManufacturerDB::instance();
}
void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
{
configwindow = cw;
}
void Wellenreiter::channelHopped(int c)
{
@@ -140,104 +132,104 @@ void Wellenreiter::channelHopped(int c)
void Wellenreiter::handleNotification( OPacket* p )
{
QObjectList* l = p->queryList();
QObjectListIt it( *l );
QObject* o;
while ( (o = it.current()) != 0 )
{
QString name = it.current()->name();
if ( configwindow->parsePackets->isProtocolChecked( name ) )
{
QString action = configwindow->parsePackets->protocolAction( name );
- qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action );
+ odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
doAction( action, name, p );
}
else
{
- qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name );
+ odebug << "protocol '" << (const char*) name << "' not checked in parsePackets." << oendl;
}
++it;
}
}
void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage )
{
if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage );
else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage );
else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage );
- else qWarning( "Wellenreiter::handleManagementFrame(): '%s' - please handle me!", (const char*) manage->managementType() );
+ else owarn << "Wellenreiter::handleManagementFrame(): '" << (const char*) manage->managementType() << "' - please handle me!" << oendl;
}
void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request )
{
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
GpsLocation loc( -111, -111 );
if ( configwindow->enableGPS->isChecked() )
{
// TODO: add check if GPS is working!?
- qDebug( "Wellenreiter::gathering GPS data..." );
+ odebug << "Wellenreiter::gathering GPS data..." << oendl;
loc = gps->position();
- qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
+ odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
}
if ( essid.length() )
netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ );
- qDebug( "Wellenreiter::invalid frame [possibly noise] detected!" );
+ odebug << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
}
void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response )
{
}
void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
{
QString type;
if ( beacon->canIBSS() )
{
type = "adhoc";
}
else if ( beacon->canESS() )
{
type = "managed";
}
else
{
- qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" );
+ owarn << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
return;
}
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
GpsLocation loc( -111, -111 );
if ( configwindow->enableGPS->isChecked() )
{
// TODO: add check if GPS is working!?
- qDebug( "Wellenreiter::gathering GPS data..." );
+ odebug << "Wellenreiter::gathering GPS data..." << oendl;
loc = gps->position();
- qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
+ odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
}
netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc );
// update graph window
if ( ds )
{
OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) );
if ( prism )
graphwindow->traffic( ds->channel(), prism->signalStrength() );
else
graphwindow->traffic( ds->channel(), 95 );
@@ -246,25 +238,25 @@ void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPa
void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control )
{
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
if ( control->controlType() == "Acknowledge" )
{
netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
}
else
{
- qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() );
+ odebug << "Wellenreiter::handleControlFrame - please handle " << (const char*) control->controlType() << " in a future version! :D" << oendl;
}
}
void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to )
{
OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" );
if ( wlan->fromDS() && !wlan->toDS() )
{
netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() );
from = wlan->macAddress3();
to = wlan->macAddress2();
@@ -295,55 +287,55 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
from = data->sourceAddress();
to = data->destinationAddress();
netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) );
}
void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
{
OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
if ( arp )
{
- qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() );
+ odebug << "Received ARP traffic (type '" << (const char*) arp->type() << "'): " << oendl;
if ( arp->type() == "REQUEST" )
{
netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
}
else if ( arp->type() == "REPLY" )
{
netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() );
}
}
}
void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest )
{
//TODO: Implement more IP based protocols
ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" );
if ( dhcp )
{
- qDebug( "Received DHCP '%s' packet", (const char*) dhcp->type() );
+ odebug << "Received DHCP '" << (const char*) dhcp->type() << "' packet" << oendl;
if ( dhcp->type() == "OFFER" )
{
- qDebug( "DHCP: '%s' ('%s') seems to be a DHCP server.", (const char*) source.toString(), (const char*) dhcp->serverAddress().toString() );
+ odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << (const char*) dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
netView()->identify( source, dhcp->serverAddress().toString() );
netView()->addService( "DHCP", source, dhcp->serverAddress().toString() );
}
else if ( dhcp->type() == "ACK" )
{
- qDebug( "DHCP: '%s' ('%s') accepted the offered DHCP address.", (const char*) dhcp->clientMacAddress().toString(), (const char*) dhcp->yourAddress().toString() );
+ odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << (const char*) dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
}
}
}
QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol )
{
if ( configwindow->parsePackets->isProtocolChecked( protocol ) )
if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" )
return 0;
@@ -359,34 +351,34 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
return true; // semantic change - we're logging anyway now to /tmp/wellenreiter
QObjectList* l = p->queryList();
QObjectListIt it( *l );
QObject* o;
while ( (o = it.current()) != 0 )
{
QString name = it.current()->name();
if ( configwindow->capturePackets->isProtocolChecked( name ) )
{
QString action = configwindow->capturePackets->protocolAction( name );
- qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action );
+ odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
if ( action == "Discard" )
{
logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
return false;
}
}
else
{
- qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name );
+ odebug << "protocol '" << (const char*) name << "' not checked in capturePackets." << oendl;
}
++it;
}
return true;
}
void Wellenreiter::receivePacket( OPacket* p )
{
hexWindow()->add( p );
if ( checkDumpPacket( p ) )
@@ -542,70 +534,70 @@ void Wellenreiter::startClicked()
}
}
// set monitor mode
bool usePrism = configwindow->usePrismHeader();
switch ( cardtype )
{
case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
- case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break;
+ case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << (const char*) interface << "'" << oendl; break;
default: assert( 0 ); // shouldn't reach this
}
// switch device into monitor mode
if ( cardtype < DEVTYPE_FILE )
{
if ( cardtype != DEVTYPE_MANUAL )
iface->setMode( "monitor" );
if ( iface->mode() != "monitor" )
{
if ( QMessageBox::warning( this, "Wellenreiter II",
tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) +
tr( "\nContinue with limited functionality?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
return;
}
}
// open GPS device
if ( configwindow->enableGPS->isChecked() )
{
- qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
+ odebug << "Wellenreiter:GPS enabled @ " << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl;
gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
}
// open pcap and start sniffing
if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file?
{
dumpname = configwindow->captureFileName->text();
if ( dumpname.isEmpty() ) dumpname = "captureFile";
dumpname.append( '-' );
dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
dumpname.append( ".wellenreiter" );
}
else // write it anyway ;)
{
dumpname = "/var/log/dump.wellenreiter";
}
if ( cardtype != DEVTYPE_FILE )
pcap->open( interface );
else
pcap->open( QFile( interface ) );
- qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname );
+ odebug << "Wellenreiter:: dumping to " << (const char*) dumpname << "" << oendl;
pcap->openDumpFile( dumpname );
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg(
cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) ));
return;
}
// set capturer to non-blocking mode
pcap->setBlocking( false );
@@ -643,25 +635,25 @@ void Wellenreiter::startClicked()
emit( startedSniffing() );
if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
else
{
assert( parent() );
( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
}
}
void Wellenreiter::timerEvent( QTimerEvent* )
{
- qDebug( "Wellenreiter::timerEvent()" );
+ odebug << "Wellenreiter::timerEvent()" << oendl;
OPacket* p = pcap->next();
if ( !p ) // no more packets available
{
stopClicked();
}
else
{
receivePacket( p );
// We no longer delete packets here. Ownership of the packets is
// transferred to the PacketView.
//delete p;
}
@@ -706,28 +698,28 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
return;
}
qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s",
(const char*) iface->name(),
(const char*) type,
(const char*) essid,
channel,
(const char*) macaddr );
QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
int count = 3;
- qDebug("sending %d messages",count);
+ odebug << "sending " << count << " messages" << oendl;
msg << QString("count") << QString::number(count);
- qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() );
+ odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl;
msg << QString(iface->name()) << QString("Mode") << type;
- qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1());
+ odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl;
msg << QString(iface->name()) << QString("ESSID") << essid;
- qDebug("msg >%s< channel >%d<", iface->name(),channel);
+ odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl;
msg << QString(iface->name()) << QString("Channel") << channel;
-// qDebug("msg >%s< mac >%s<", iface->name(),macaddr);
+// odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl;
// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
#else
QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) );
#endif
}