summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-14 13:22:42 (UTC)
committer zecke <zecke>2004-03-14 13:22:42 (UTC)
commit0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44 (patch) (unidiff)
treef6a68afa76a9be4099c3de7a286caeadd250c966
parentd9d68663164078b8dbdbfe70d291291b9fd5aacf (diff)
downloadopie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.zip
opie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.tar.gz
opie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.tar.bz2
Convert net to ODP and QtAUX
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/linphone/main.cpp4
-rw-r--r--noncore/net/mail/accountitem.cpp5
-rw-r--r--noncore/net/mail/accountitem.h56
-rw-r--r--noncore/net/mail/accountview.cpp1
-rw-r--r--noncore/net/mail/accountview.h4
-rw-r--r--noncore/net/mail/composemail.cpp8
-rw-r--r--noncore/net/mail/composemail.h2
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp3
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h12
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.h4
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp3
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.h4
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.h12
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h4
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp3
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.h6
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.h8
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp13
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.h20
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp7
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h6
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp7
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.h6
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp3
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.h4
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.cpp3
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.h2
-rw-r--r--noncore/net/mail/mail.pro2
-rw-r--r--noncore/net/mail/main.cpp2
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.cpp2
-rw-r--r--noncore/net/mail/viewmail.cpp3
-rw-r--r--noncore/net/mail/viewmailbase.cpp2
-rw-r--r--noncore/net/opieftp/main.cpp2
-rw-r--r--noncore/net/opieirc/config.in2
-rw-r--r--noncore/net/opieirc/ircsettings.cpp6
-rw-r--r--noncore/net/opieirc/ircsettings.h16
-rw-r--r--noncore/net/opieirc/main.cpp3
-rw-r--r--noncore/net/opieirc/opieirc.pro2
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp2
-rw-r--r--noncore/net/opietooth/lib/device.cc12
-rw-r--r--noncore/net/opietooth/lib/device.h12
-rw-r--r--noncore/net/opietooth/lib/manager.cc22
-rw-r--r--noncore/net/opietooth/lib/manager.h26
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp6
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.h8
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp10
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.h8
-rw-r--r--noncore/net/opietooth/manager/main.cpp4
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp7
-rw-r--r--noncore/net/opietooth/manager/obexdialog.h2
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp6
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h4
-rw-r--r--noncore/net/ubrowser/main.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp6
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp3
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp5
-rw-r--r--noncore/net/wellenreiter/gui/packetview.cpp3
-rw-r--r--noncore/net/wellenreiter/gui/packetview.h6
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp6
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h26
-rw-r--r--noncore/net/wellenreiter/gui/statwindow.cpp3
-rw-r--r--noncore/net/wellenreiter/gui/statwindow.h4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp10
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h56
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.cpp3
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.h2
70 files changed, 310 insertions, 228 deletions
diff --git a/noncore/net/linphone/main.cpp b/noncore/net/linphone/main.cpp
index 9146fee..6368708 100644
--- a/noncore/net/linphone/main.cpp
+++ b/noncore/net/linphone/main.cpp
@@ -1,22 +1,24 @@
1/*************************************************************************** 1/***************************************************************************
2 main-opie.cpp - description 2 main-opie.cpp - description
3 ------------------- 3 -------------------
4 begin : ven mai 23 19:26:00 CEST 2003 4 begin : ven mai 23 19:26:00 CEST 2003
5 copyright : (C) 2003 by Simon Morlat 5 copyright : (C) 2003 by Simon Morlat
6 email : simon.morlat@linphone.org 6 email : simon.morlat@linphone.org
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include <opie/oapplicationfactory.h> 17#include <opie2/oapplicationfactory.h>
18#include "mainwindow.h" 18#include "mainwindow.h"
19 19
20
21using namespace Opie::Core;
20OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 22OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
21 23
22 24
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp
index 9a09c18..e4bb6c5 100644
--- a/noncore/net/mail/accountitem.cpp
+++ b/noncore/net/mail/accountitem.cpp
@@ -2,32 +2,33 @@
2#include "accountitem.h" 2#include "accountitem.h"
3#include "accountview.h" 3#include "accountview.h"
4#include "newmaildir.h" 4#include "newmaildir.h"
5#include "nntpgroupsdlg.h" 5#include "nntpgroupsdlg.h"
6#include "defines.h" 6#include "defines.h"
7 7
8/* OPIE */ 8/* OPIE */
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <libmailwrapper/abstractmail.h> 10#include <libmailwrapper/abstractmail.h>
11#include <libmailwrapper/mailwrapper.h> 11#include <libmailwrapper/mailwrapper.h>
12#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13 13
14/* QT */ 14/* QT */
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16#include <qmessagebox.h> 16#include <qmessagebox.h>
17 17
18using namespace Opie::Core;
18#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} 19#define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );}
19/** 20/**
20 * POP3 Account stuff 21 * POP3 Account stuff
21 */ 22 */
22POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) 23POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
23 : AccountViewItem( parent ) 24 : AccountViewItem( parent )
24{ 25{
25 account = a; 26 account = a;
26 wrapper = AbstractMail::getWrapper( account ); 27 wrapper = AbstractMail::getWrapper( account );
27 SETPIX(PIXMAP_POP3FOLDER); 28 SETPIX(PIXMAP_POP3FOLDER);
28#if 0 29#if 0
29 if (!account->getOffline()) 30 if (!account->getOffline())
30 { 31 {
31 setPixmap( 0, ); 32 setPixmap( 0, );
32 } 33 }
33 else 34 else
@@ -36,33 +37,33 @@ POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent )
36 } 37 }
37#endif 38#endif
38 setText( 0, account->getAccountName() ); 39 setText( 0, account->getAccountName() );
39 setOpen( true ); 40 setOpen( true );
40} 41}
41 42
42POP3viewItem::~POP3viewItem() 43POP3viewItem::~POP3viewItem()
43{ 44{
44 delete wrapper; 45 delete wrapper;
45} 46}
46 47
47AbstractMail *POP3viewItem::getWrapper() 48AbstractMail *POP3viewItem::getWrapper()
48{ 49{
49 return wrapper; 50 return wrapper;
50} 51}
51 52
52void POP3viewItem::refresh(QValueList<Opie::OSmartPointer<RecMail> > & ) 53void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & )
53{ 54{
54 refresh(); 55 refresh();
55} 56}
56 57
57void POP3viewItem::refresh() 58void POP3viewItem::refresh()
58{ 59{
59 if (account->getOffline()) return; 60 if (account->getOffline()) return;
60 QValueList<FolderP> *folders = wrapper->listFolders(); 61 QValueList<FolderP> *folders = wrapper->listFolders();
61 QListViewItem *child = firstChild(); 62 QListViewItem *child = firstChild();
62 while ( child ) 63 while ( child )
63 { 64 {
64 QListViewItem *tmp = child; 65 QListViewItem *tmp = child;
65 child = child->nextSibling(); 66 child = child->nextSibling();
66 delete tmp; 67 delete tmp;
67 } 68 }
68 QValueList<FolderP>::ConstIterator it; 69 QValueList<FolderP>::ConstIterator it;
@@ -1029,33 +1030,33 @@ AccountViewItem::AccountViewItem( AccountView *parent )
1029 init(); 1030 init();
1030 m_Backlink = parent; 1031 m_Backlink = parent;
1031} 1032}
1032 1033
1033AccountViewItem::AccountViewItem( QListViewItem *parent) 1034AccountViewItem::AccountViewItem( QListViewItem *parent)
1034 : QListViewItem( parent),folder(0) 1035 : QListViewItem( parent),folder(0)
1035{ 1036{
1036 init(); 1037 init();
1037} 1038}
1038 1039
1039AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) 1040AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after )
1040 :QListViewItem( parent,after ),folder(0) 1041 :QListViewItem( parent,after ),folder(0)
1041{ 1042{
1042 init(); 1043 init();
1043} 1044}
1044 1045
1045AccountViewItem::AccountViewItem( const Opie::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) 1046AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after )
1046 :QListViewItem( parent,after ),folder(folderInit) 1047 :QListViewItem( parent,after ),folder(folderInit)
1047{ 1048{
1048 init(); 1049 init();
1049} 1050}
1050 1051
1051void AccountViewItem::init() 1052void AccountViewItem::init()
1052{ 1053{
1053 m_Backlink = 0; 1054 m_Backlink = 0;
1054} 1055}
1055 1056
1056AccountViewItem::~AccountViewItem() 1057AccountViewItem::~AccountViewItem()
1057{ 1058{
1058 folder = 0; 1059 folder = 0;
1059} 1060}
1060 1061
1061AccountView*AccountViewItem::accountView() 1062AccountView*AccountViewItem::accountView()
diff --git a/noncore/net/mail/accountitem.h b/noncore/net/mail/accountitem.h
index 276eae0..6cdb260 100644
--- a/noncore/net/mail/accountitem.h
+++ b/noncore/net/mail/accountitem.h
@@ -11,200 +11,200 @@ class RecBody;
11class QPopupMenu; 11class QPopupMenu;
12class Selectstore; 12class Selectstore;
13class AccountView; 13class AccountView;
14class POP3account; 14class POP3account;
15class NNTPaccount; 15class NNTPaccount;
16class IMAPaccount; 16class IMAPaccount;
17class AbstractMail; 17class AbstractMail;
18class Folder; 18class Folder;
19 19
20class AccountViewItem : public QListViewItem 20class AccountViewItem : public QListViewItem
21{ 21{
22 22
23public: 23public:
24 AccountViewItem( AccountView *parent ); 24 AccountViewItem( AccountView *parent );
25 AccountViewItem( QListViewItem *parent); 25 AccountViewItem( QListViewItem *parent);
26 AccountViewItem( QListViewItem *parent , QListViewItem*after ); 26 AccountViewItem( QListViewItem *parent , QListViewItem*after );
27 AccountViewItem( const Opie::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); 27 AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after );
28 28
29 virtual ~AccountViewItem(); 29 virtual ~AccountViewItem();
30 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&)=0; 30 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0;
31 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&)=0; 31 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0;
32 virtual QPopupMenu * getContextMenu(){return 0;}; 32 virtual QPopupMenu * getContextMenu(){return 0;};
33 virtual void contextMenuSelected(int){} 33 virtual void contextMenuSelected(int){}
34 virtual AccountView*accountView(); 34 virtual AccountView*accountView();
35 virtual bool matchName(const QString&name)const; 35 virtual bool matchName(const QString&name)const;
36 virtual bool isDraftfolder(); 36 virtual bool isDraftfolder();
37 37
38protected: 38protected:
39 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); 39 AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0);
40 virtual void init(); 40 virtual void init();
41 virtual void removeChilds(); 41 virtual void removeChilds();
42 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::OSmartPointer<Folder>&f); 42 virtual void deleteAllMail(AbstractMail*wrapper,const Opie::Core::OSmartPointer<Folder>&f);
43 static const QString contextName; 43 static const QString contextName;
44 AccountView*m_Backlink; 44 AccountView*m_Backlink;
45 Opie::OSmartPointer<Folder> folder; 45 Opie::Core::OSmartPointer<Folder> folder;
46}; 46};
47 47
48class POP3viewItem : public AccountViewItem 48class POP3viewItem : public AccountViewItem
49{ 49{
50 50
51public: 51public:
52 POP3viewItem( POP3account *a, AccountView *parent ); 52 POP3viewItem( POP3account *a, AccountView *parent );
53 virtual ~POP3viewItem(); 53 virtual ~POP3viewItem();
54 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); 54 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target );
55 virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); 55 virtual RecBody fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
56 AbstractMail *getWrapper(); 56 AbstractMail *getWrapper();
57 virtual QPopupMenu * getContextMenu(); 57 virtual QPopupMenu * getContextMenu();
58 virtual void contextMenuSelected(int); 58 virtual void contextMenuSelected(int);
59 59
60protected: 60protected:
61 POP3account *account; 61 POP3account *account;
62 virtual void refresh(); 62 virtual void refresh();
63 AbstractMail *wrapper; 63 AbstractMail *wrapper;
64 void disconnect(); 64 void disconnect();
65 void setOnOffline(); 65 void setOnOffline();
66}; 66};
67 67
68class POP3folderItem : public AccountViewItem 68class POP3folderItem : public AccountViewItem
69{ 69{
70 70
71public: 71public:
72 POP3folderItem( const Opie::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); 72 POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after );
73 virtual ~POP3folderItem(); 73 virtual ~POP3folderItem();
74 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); 74 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&);
75 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); 75 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
76 virtual QPopupMenu * getContextMenu(); 76 virtual QPopupMenu * getContextMenu();
77 virtual void contextMenuSelected(int); 77 virtual void contextMenuSelected(int);
78 78
79protected: 79protected:
80 void downloadMails(); 80 void downloadMails();
81 POP3viewItem *pop3; 81 POP3viewItem *pop3;
82}; 82};
83 83
84 84
85class NNTPviewItem : public AccountViewItem 85class NNTPviewItem : public AccountViewItem
86{ 86{
87 87
88public: 88public:
89 NNTPviewItem( NNTPaccount *a, AccountView *parent ); 89 NNTPviewItem( NNTPaccount *a, AccountView *parent );
90 virtual ~NNTPviewItem(); 90 virtual ~NNTPviewItem();
91 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); 91 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target );
92 virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); 92 virtual RecBody fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
93 AbstractMail *getWrapper(); 93 AbstractMail *getWrapper();
94 virtual QPopupMenu * getContextMenu(); 94 virtual QPopupMenu * getContextMenu();
95 virtual void contextMenuSelected(int); 95 virtual void contextMenuSelected(int);
96 96
97protected: 97protected:
98 NNTPaccount *account; 98 NNTPaccount *account;
99 virtual void refresh(); 99 virtual void refresh();
100 AbstractMail *wrapper; 100 AbstractMail *wrapper;
101 void disconnect(); 101 void disconnect();
102 void setOnOffline(); 102 void setOnOffline();
103 void subscribeGroups(); 103 void subscribeGroups();
104}; 104};
105 105
106class NNTPfolderItem : public AccountViewItem 106class NNTPfolderItem : public AccountViewItem
107{ 107{
108 108
109public: 109public:
110 NNTPfolderItem(const Opie::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); 110 NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after );
111 virtual ~NNTPfolderItem(); 111 virtual ~NNTPfolderItem();
112 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); 112 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&);
113 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); 113 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
114 virtual QPopupMenu * getContextMenu(); 114 virtual QPopupMenu * getContextMenu();
115 virtual void contextMenuSelected(int); 115 virtual void contextMenuSelected(int);
116 116
117protected: 117protected:
118 void downloadMails(); 118 void downloadMails();
119 NNTPviewItem *nntp; 119 NNTPviewItem *nntp;
120}; 120};
121 121
122 122
123 123
124class IMAPviewItem : public AccountViewItem 124class IMAPviewItem : public AccountViewItem
125{ 125{
126 friend class IMAPfolderItem; 126 friend class IMAPfolderItem;
127public: 127public:
128 IMAPviewItem( IMAPaccount *a, AccountView *parent ); 128 IMAPviewItem( IMAPaccount *a, AccountView *parent );
129 virtual ~IMAPviewItem(); 129 virtual ~IMAPviewItem();
130 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); 130 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&);
131 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); 131 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
132 AbstractMail *getWrapper(); 132 AbstractMail *getWrapper();
133 virtual QPopupMenu * getContextMenu(); 133 virtual QPopupMenu * getContextMenu();
134 virtual void contextMenuSelected(int); 134 virtual void contextMenuSelected(int);
135 const QStringList&subFolders(); 135 const QStringList&subFolders();
136 virtual void refreshFolders(bool force=false); 136 virtual void refreshFolders(bool force=false);
137 bool offline(); 137 bool offline();
138 138
139protected: 139protected:
140 virtual void createNewFolder(); 140 virtual void createNewFolder();
141 IMAPaccount *account; 141 IMAPaccount *account;
142 AbstractMail *wrapper; 142 AbstractMail *wrapper;
143 QStringList currentFolders; 143 QStringList currentFolders;
144}; 144};
145 145
146class IMAPfolderItem : public AccountViewItem 146class IMAPfolderItem : public AccountViewItem
147{ 147{
148 148
149public: 149public:
150 IMAPfolderItem( const Opie::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); 150 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after );
151 IMAPfolderItem( const Opie::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); 151 IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master );
152 virtual ~IMAPfolderItem(); 152 virtual ~IMAPfolderItem();
153 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); 153 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&);
154 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); 154 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
155 virtual QPopupMenu * getContextMenu(); 155 virtual QPopupMenu * getContextMenu();
156 virtual void contextMenuSelected(int); 156 virtual void contextMenuSelected(int);
157 virtual const QString& Delemiter()const; 157 virtual const QString& Delemiter()const;
158protected: 158protected:
159 virtual void createNewFolder(); 159 virtual void createNewFolder();
160 virtual void deleteFolder(); 160 virtual void deleteFolder();
161 virtual void downloadMails(); 161 virtual void downloadMails();
162 IMAPviewItem *imap; 162 IMAPviewItem *imap;
163}; 163};
164 164
165class MHviewItem : public AccountViewItem 165class MHviewItem : public AccountViewItem
166{ 166{
167 friend class MHfolderItem; 167 friend class MHfolderItem;
168 168
169public: 169public:
170 MHviewItem( const QString&aMboxPath, AccountView *parent ); 170 MHviewItem( const QString&aMboxPath, AccountView *parent );
171 virtual ~MHviewItem(); 171 virtual ~MHviewItem();
172 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&target ); 172 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target );
173 virtual RecBody fetchBody( const Opie::OSmartPointer<RecMail> &mail ); 173 virtual RecBody fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail );
174 AbstractMail *getWrapper(); 174 AbstractMail *getWrapper();
175 virtual QPopupMenu * getContextMenu(); 175 virtual QPopupMenu * getContextMenu();
176 virtual void contextMenuSelected(int); 176 virtual void contextMenuSelected(int);
177 QStringList subFolders(); 177 QStringList subFolders();
178 virtual void refresh(bool force=false); 178 virtual void refresh(bool force=false);
179 179
180protected: 180protected:
181 void downloadMails(); 181 void downloadMails();
182 virtual void createFolder(); 182 virtual void createFolder();
183 QString m_Path; 183 QString m_Path;
184 AbstractMail *wrapper; 184 AbstractMail *wrapper;
185 QStringList currentFolders; 185 QStringList currentFolders;
186}; 186};
187 187
188class MHfolderItem : public AccountViewItem 188class MHfolderItem : public AccountViewItem
189{ 189{
190 190
191public: 191public:
192 MHfolderItem( const Opie::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); 192 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after );
193 MHfolderItem( const Opie::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); 193 MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master);
194 virtual ~MHfolderItem(); 194 virtual ~MHfolderItem();
195 virtual void refresh(QValueList<Opie::OSmartPointer<RecMail> >&); 195 virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&);
196 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&); 196 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&);
197 virtual QPopupMenu * getContextMenu(); 197 virtual QPopupMenu * getContextMenu();
198 virtual void contextMenuSelected(int); 198 virtual void contextMenuSelected(int);
199 virtual const Opie::OSmartPointer<Folder>&getFolder()const; 199 virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const;
200 virtual bool isDraftfolder(); 200 virtual bool isDraftfolder();
201 201
202protected: 202protected:
203 void downloadMails(); 203 void downloadMails();
204 virtual void createFolder(); 204 virtual void createFolder();
205 virtual void deleteFolder(); 205 virtual void deleteFolder();
206 void initName(); 206 void initName();
207 MHviewItem *mbox; 207 MHviewItem *mbox;
208}; 208};
209 209
210#endif 210#endif
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 26107ff..811e57a 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,32 +1,33 @@
1 1
2#include "accountview.h" 2#include "accountview.h"
3#include "accountitem.h" 3#include "accountitem.h"
4#include "selectstore.h" 4#include "selectstore.h"
5 5
6/* OPIE */ 6/* OPIE */
7#include <libmailwrapper/settings.h> 7#include <libmailwrapper/settings.h>
8#include <libmailwrapper/mailwrapper.h> 8#include <libmailwrapper/mailwrapper.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <libmailwrapper/abstractmail.h> 10#include <libmailwrapper/abstractmail.h>
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12 12
13/* QT */ 13/* QT */
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16 16
17using namespace Opie::Core;
17AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 18AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
18 : QListView( parent, name, flags ) 19 : QListView( parent, name, flags )
19{ 20{
20 connect( this, SIGNAL( selectionChanged(QListViewItem*) ), 21 connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
21 SLOT( refresh(QListViewItem*) ) ); 22 SLOT( refresh(QListViewItem*) ) );
22 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 23 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
23 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); 24 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
24 setSorting(0); 25 setSorting(0);
25} 26}
26 27
27AccountView::~AccountView() 28AccountView::~AccountView()
28{ 29{
29 imapAccounts.clear(); 30 imapAccounts.clear();
30 mhAccounts.clear(); 31 mhAccounts.clear();
31} 32}
32 33
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index d236058..b082b1f 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -8,34 +8,34 @@
8 8
9class Selectstore; 9class Selectstore;
10class Folder; 10class Folder;
11class AbstractMail; 11class AbstractMail;
12class Account; 12class Account;
13class IMAPviewItem; 13class IMAPviewItem;
14class MHviewItem; 14class MHviewItem;
15 15
16class AccountView : public QListView 16class AccountView : public QListView
17{ 17{
18 Q_OBJECT 18 Q_OBJECT
19 19
20public: 20public:
21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
22 virtual ~AccountView(); 22 virtual ~AccountView();
23 virtual void populate( QList<Account> list ); 23 virtual void populate( QList<Account> list );
24 virtual RecBody fetchBody(const Opie::OSmartPointer<RecMail>&aMail); 24 virtual RecBody fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail);
25 virtual void downloadMails(const Opie::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
26 virtual bool currentisDraft(); 26 virtual bool currentisDraft();
27 27
28public slots: 28public slots:
29 virtual void refreshAll(); 29 virtual void refreshAll();
30 virtual void refresh(QListViewItem *item); 30 virtual void refresh(QListViewItem *item);
31 virtual void refreshCurrent(); 31 virtual void refreshCurrent();
32 virtual void slotHold(int, QListViewItem *,const QPoint&,int); 32 virtual void slotHold(int, QListViewItem *,const QPoint&,int);
33 virtual void slotContextMenu(int id); 33 virtual void slotContextMenu(int id);
34 void setupFolderselect(Selectstore*sels); 34 void setupFolderselect(Selectstore*sels);
35 35
36signals: 36signals:
37 void refreshMailview(const QValueList<RecMailP>& ); 37 void refreshMailview(const QValueList<RecMailP>& );
38 38
39protected: 39protected:
40 QListViewItem* m_currentItem; 40 QListViewItem* m_currentItem;
41 QValueList<IMAPviewItem*> imapAccounts; 41 QValueList<IMAPviewItem*> imapAccounts;
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 74ccc7b..5bc2883 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,31 +1,33 @@
1#include <qt.h> 1#include <qt.h>
2 2
3#include <opie2/ofiledialog.h> 3#include <opie2/ofiledialog.h>
4#include <qpe/resource.h> 4#include <qpe/resource.h>
5#include <qpe/config.h> 5#include <qpe/config.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qpe/contact.h> 7#include <qpe/contact.h>
8 8
9#include "composemail.h" 9#include "composemail.h"
10 10
11#include <libmailwrapper/smtpwrapper.h> 11#include <libmailwrapper/smtpwrapper.h>
12#include <libmailwrapper/storemail.h> 12#include <libmailwrapper/storemail.h>
13#include <libmailwrapper/abstractmail.h> 13#include <libmailwrapper/abstractmail.h>
14#include <libmailwrapper/mailtypes.h> 14#include <libmailwrapper/mailtypes.h>
15 15
16using namespace Opie::Core;
17using namespace Opie::Ui;
16ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 18ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
17 : ComposeMailUI( parent, name, modal, flags ) 19 : ComposeMailUI( parent, name, modal, flags )
18{ 20{
19 settings = s; 21 settings = s;
20 m_replyid = ""; 22 m_replyid = "";
21 23
22 QString vfilename = Global::applicationFileName("addressbook", 24 QString vfilename = Global::applicationFileName("addressbook",
23 "businesscard.vcf"); 25 "businesscard.vcf");
24 Contact c; 26 Contact c;
25 if (QFile::exists(vfilename)) { 27 if (QFile::exists(vfilename)) {
26 c = Contact::readVCard( vfilename )[0]; 28 c = Contact::readVCard( vfilename )[0];
27 } 29 }
28 30
29 QStringList mails = c.emailList(); 31 QStringList mails = c.emailList();
30 QString defmail = c.defaultEmail(); 32 QString defmail = c.defaultEmail();
31 33
@@ -147,61 +149,61 @@ void ComposeMail::fillValues( int )
147#endif 149#endif
148} 150}
149 151
150void ComposeMail::slotAdjustColumns() 152void ComposeMail::slotAdjustColumns()
151{ 153{
152 int currPage = tabWidget->currentPageIndex(); 154 int currPage = tabWidget->currentPageIndex();
153 155
154 tabWidget->showPage( attachTab ); 156 tabWidget->showPage( attachTab );
155 attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); 157 attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
156 attList->setColumnWidth( 1, 80 ); 158 attList->setColumnWidth( 1, 80 );
157 159
158 tabWidget->setCurrentPage( currPage ); 160 tabWidget->setCurrentPage( currPage );
159} 161}
160 162
161void ComposeMail::addAttachment() 163void ComposeMail::addAttachment()
162{ 164{
163 DocLnk lnk = Opie::OFileDialog::getOpenFileName( 1, "/" ); 165 DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" );
164 if ( !lnk.name().isEmpty() ) { 166 if ( !lnk.name().isEmpty() ) {
165 Attachment *att = new Attachment( lnk ); 167 Attachment *att = new Attachment( lnk );
166 (void) new AttachViewItem( attList, att ); 168 (void) new AttachViewItem( attList, att );
167 } 169 }
168} 170}
169 171
170void ComposeMail::removeAttachment() 172void ComposeMail::removeAttachment()
171{ 173{
172 if ( !attList->currentItem() ) { 174 if ( !attList->currentItem() ) {
173 QMessageBox::information( this, tr( "Error" ), 175 QMessageBox::information( this, tr( "Error" ),
174 tr( "<p>Please select a File.</p>" ), 176 tr( "<p>Please select a File.</p>" ),
175 tr( "Ok" ) ); 177 tr( "Ok" ) );
176 } else { 178 } else {
177 attList->takeItem( attList->currentItem() ); 179 attList->takeItem( attList->currentItem() );
178 } 180 }
179} 181}
180 182
181void ComposeMail::accept() 183void ComposeMail::accept()
182{ 184{
183 if ( checkBoxLater->isChecked() ) { 185 if ( checkBoxLater->isChecked() ) {
184 qDebug( "Send later" ); 186 qDebug( "Send later" );
185 } 187 }
186 188
187#if 0 189#if 0
188 qDebug( "Sending Mail with " + 190 qDebug( "Sending Mail with " +
189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 191 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
190#endif 192#endif
191 Opie::OSmartPointer<Mail> mail=new Mail; 193 Opie::Core::OSmartPointer<Mail> mail=new Mail;
192 194
193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 195 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
194 mail->setMail(fromBox->currentText()); 196 mail->setMail(fromBox->currentText());
195 197
196 if ( !toLine->text().isEmpty() ) { 198 if ( !toLine->text().isEmpty() ) {
197 mail->setTo( toLine->text() ); 199 mail->setTo( toLine->text() );
198 } else { 200 } else {
199 QMessageBox::warning(0,tr("Sending mail"), 201 QMessageBox::warning(0,tr("Sending mail"),
200 tr("No Receiver spezified" ) ); 202 tr("No Receiver spezified" ) );
201 return; 203 return;
202 } 204 }
203 mail->setName(senderNameEdit->text()); 205 mail->setName(senderNameEdit->text());
204 mail->setCC( ccLine->text() ); 206 mail->setCC( ccLine->text() );
205 mail->setBCC( bccLine->text() ); 207 mail->setBCC( bccLine->text() );
206 mail->setReply( replyLine->text() ); 208 mail->setReply( replyLine->text() );
207 mail->setSubject( subjectLine->text() ); 209 mail->setSubject( subjectLine->text() );
@@ -223,33 +225,33 @@ void ComposeMail::accept()
223 } 225 }
224 226
225 SMTPwrapper wrapper( smtp ); 227 SMTPwrapper wrapper( smtp );
226 wrapper.sendMail( mail,checkBoxLater->isChecked() ); 228 wrapper.sendMail( mail,checkBoxLater->isChecked() );
227 229
228 QDialog::accept(); 230 QDialog::accept();
229} 231}
230 232
231void ComposeMail::reject() 233void ComposeMail::reject()
232{ 234{
233 int yesno = QMessageBox::warning(0,tr("Store message"), 235 int yesno = QMessageBox::warning(0,tr("Store message"),
234 tr("Store message into drafts?"), 236 tr("Store message into drafts?"),
235 tr("Yes"), 237 tr("Yes"),
236 tr("No"),QString::null,0,1); 238 tr("No"),QString::null,0,1);
237 239
238 if (yesno == 0) { 240 if (yesno == 0) {
239 Opie::OSmartPointer<Mail> mail=new Mail(); 241 Opie::Core::OSmartPointer<Mail> mail=new Mail();
240 mail->setMail(fromBox->currentText()); 242 mail->setMail(fromBox->currentText());
241 mail->setTo( toLine->text() ); 243 mail->setTo( toLine->text() );
242 mail->setName(senderNameEdit->text()); 244 mail->setName(senderNameEdit->text());
243 mail->setCC( ccLine->text() ); 245 mail->setCC( ccLine->text() );
244 mail->setBCC( bccLine->text() ); 246 mail->setBCC( bccLine->text() );
245 mail->setReply( replyLine->text() ); 247 mail->setReply( replyLine->text() );
246 mail->setSubject( subjectLine->text() ); 248 mail->setSubject( subjectLine->text() );
247 if (!m_replyid.isEmpty()) { 249 if (!m_replyid.isEmpty()) {
248 QStringList ids; 250 QStringList ids;
249 ids.append(m_replyid); 251 ids.append(m_replyid);
250 mail->setInreply(ids); 252 mail->setInreply(ids);
251 } 253 }
252 QString txt = message->text(); 254 QString txt = message->text();
253 if ( !sigMultiLine->text().isEmpty() ) { 255 if ( !sigMultiLine->text().isEmpty() ) {
254 txt.append( "\n--\n" ); 256 txt.append( "\n--\n" );
255 txt.append( sigMultiLine->text() ); 257 txt.append( sigMultiLine->text() );
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index c12eb30..4693927 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -24,33 +24,33 @@ public:
24protected: 24protected:
25 QString selectedNames; 25 QString selectedNames;
26 void accept(); 26 void accept();
27 27
28}; 28};
29 29
30class RecMail; 30class RecMail;
31 31
32class ComposeMail : public ComposeMailUI 32class ComposeMail : public ComposeMailUI
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35 35
36public: 36public:
37 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); 37 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 );
38 virtual ~ComposeMail(); 38 virtual ~ComposeMail();
39 39
40 void reEditMail(const Opie::OSmartPointer<RecMail>&current); 40 void reEditMail(const Opie::Core::OSmartPointer<RecMail>&current);
41 41
42public slots: 42public slots:
43 void slotAdjustColumns(); 43 void slotAdjustColumns();
44 44
45 void setTo( const QString & to ); 45 void setTo( const QString & to );
46 void setSubject( const QString & subject ); 46 void setSubject( const QString & subject );
47 void setInReplyTo( const QString & messageId ); 47 void setInReplyTo( const QString & messageId );
48 void setMessage( const QString & text ); 48 void setMessage( const QString & text );
49 49
50protected slots: 50protected slots:
51 void accept(); 51 void accept();
52 void reject(); 52 void reject();
53 53
54private slots: 54private slots:
55 void fillValues( int current ); 55 void fillValues( int current );
56 void pickAddress( QLineEdit *line ); 56 void pickAddress( QLineEdit *line );
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index 68a7a4d..6bebb7b 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -1,29 +1,30 @@
1#include "abstractmail.h" 1#include "abstractmail.h"
2#include "imapwrapper.h" 2#include "imapwrapper.h"
3#include "pop3wrapper.h" 3#include "pop3wrapper.h"
4#include "nntpwrapper.h" 4#include "nntpwrapper.h"
5#include "mhwrapper.h" 5#include "mhwrapper.h"
6#include "mailtypes.h" 6#include "mailtypes.h"
7 7
8#include <qfile.h> 8#include <qfile.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <stdlib.h> 10#include <stdlib.h>
11#include <libetpan/mailmime_content.h> 11#include <libetpan/mailmime_content.h>
12#include <libetpan/mailmime.h> 12#include <libetpan/mailmime.h>
13 13
14using namespace Opie::Core;
14AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) 15AbstractMail* AbstractMail::getWrapper(IMAPaccount *a)
15{ 16{
16 return new IMAPwrapper(a); 17 return new IMAPwrapper(a);
17} 18}
18 19
19AbstractMail* AbstractMail::getWrapper(POP3account *a) 20AbstractMail* AbstractMail::getWrapper(POP3account *a)
20{ 21{
21 return new POP3wrapper(a); 22 return new POP3wrapper(a);
22} 23}
23 24
24AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) 25AbstractMail* AbstractMail::getWrapper(NNTPaccount *a)
25{ 26{
26 return new NNTPwrapper(a); 27 return new NNTPwrapper(a);
27} 28}
28 29
29AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) 30AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name)
@@ -116,33 +117,33 @@ int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool)
116 return 0; 117 return 0;
117} 118}
118 119
119QString AbstractMail::defaultLocalfolder() 120QString AbstractMail::defaultLocalfolder()
120{ 121{
121 QString f = getenv( "HOME" ); 122 QString f = getenv( "HOME" );
122 f += "/Applications/opiemail/localmail"; 123 f += "/Applications/opiemail/localmail";
123 return f; 124 return f;
124} 125}
125 126
126QString AbstractMail::draftFolder() 127QString AbstractMail::draftFolder()
127{ 128{
128 return QString("Drafts"); 129 return QString("Drafts");
129} 130}
130 131
131/* temporary - will be removed when implemented in all classes */ 132/* temporary - will be removed when implemented in all classes */
132void AbstractMail::deleteMails(const QString &,const QValueList<Opie::OSmartPointer<RecMail> > &) 133void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &)
133{ 134{
134} 135}
135 136
136void AbstractMail::mvcpAllMails(const FolderP&fromFolder, 137void AbstractMail::mvcpAllMails(const FolderP&fromFolder,
137 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 138 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
138{ 139{
139 QValueList<RecMailP> t; 140 QValueList<RecMailP> t;
140 listMessages(fromFolder->getName(),t); 141 listMessages(fromFolder->getName(),t);
141 encodedString*st = 0; 142 encodedString*st = 0;
142 while (t.count()>0) { 143 while (t.count()>0) {
143 RecMailP r = (*t.begin()); 144 RecMailP r = (*t.begin());
144 st = fetchRawBody(r); 145 st = fetchRawBody(r);
145 if (st) { 146 if (st) {
146 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder); 147 targetWrapper->storeMessage(st->Content(),st->Length(),targetFolder);
147 delete st; 148 delete st;
148 } 149 }
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h
index b03d757..2d55c83 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.h
+++ b/noncore/net/mail/libmailwrapper/abstractmail.h
@@ -8,59 +8,59 @@
8#include <qobject.h> 8#include <qobject.h>
9#include <opie2/osmartpointer.h> 9#include <opie2/osmartpointer.h>
10#include "mailtypes.h" 10#include "mailtypes.h"
11 11
12class IMAPwrapper; 12class IMAPwrapper;
13class POP3wrapper; 13class POP3wrapper;
14class Folder; 14class Folder;
15class encodedString; 15class encodedString;
16struct folderStat; 16struct folderStat;
17 17
18class AbstractMail:public QObject 18class AbstractMail:public QObject
19{ 19{
20 Q_OBJECT 20 Q_OBJECT
21public: 21public:
22 AbstractMail(){}; 22 AbstractMail(){};
23 virtual ~AbstractMail(){} 23 virtual ~AbstractMail(){}
24 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders()=0; 24 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0;
25 virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target )=0; 25 virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target )=0;
26 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; 26 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0;
27 virtual RecBody fetchBody(const RecMailP&mail)=0; 27 virtual RecBody fetchBody(const RecMailP&mail)=0;
28 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part)=0; 28 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part)=0;
29 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part)=0; 29 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part)=0;
30 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part)=0; 30 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part)=0;
31 virtual encodedString* fetchRawBody(const RecMailP&mail)=0; 31 virtual encodedString* fetchRawBody(const RecMailP&mail)=0;
32 32
33 virtual void deleteMail(const RecMailP&mail)=0; 33 virtual void deleteMail(const RecMailP&mail)=0;
34 virtual void answeredMail(const RecMailP&mail)=0; 34 virtual void answeredMail(const RecMailP&mail)=0;
35 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&)=0; 35 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0;
36 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::OSmartPointer<RecMail> >&target); 36 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target);
37 virtual int deleteMbox(const Opie::OSmartPointer<Folder>&)=0; 37 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0;
38 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; 38 virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0;
39 39
40 virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, 40 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
41 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 41 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
42 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 42 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
43 43
44 virtual void cleanMimeCache(){}; 44 virtual void cleanMimeCache(){};
45 /* mail box methods */ 45 /* mail box methods */
46 /* parameter is the box to create. 46 /* parameter is the box to create.
47 * if the implementing subclass has prefixes, 47 * if the implementing subclass has prefixes,
48 * them has to be appended automatic. 48 * them has to be appended automatic.
49 */ 49 */
50 virtual int createMbox(const QString&,const Opie::OSmartPointer<Folder>&parentfolder=0, 50 virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0,
51 const QString& delemiter="/",bool getsubfolder=false); 51 const QString& delemiter="/",bool getsubfolder=false);
52 virtual void logout()=0; 52 virtual void logout()=0;
53 53
54 static AbstractMail* getWrapper(IMAPaccount *a); 54 static AbstractMail* getWrapper(IMAPaccount *a);
55 static AbstractMail* getWrapper(POP3account *a); 55 static AbstractMail* getWrapper(POP3account *a);
56 static AbstractMail* getWrapper(NNTPaccount *a); 56 static AbstractMail* getWrapper(NNTPaccount *a);
57 /* mbox only! */ 57 /* mbox only! */
58 static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); 58 static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders");
59 static AbstractMail* getWrapper(Account*a); 59 static AbstractMail* getWrapper(Account*a);
60 60
61 static QString defaultLocalfolder(); 61 static QString defaultLocalfolder();
62 static QString draftFolder(); 62 static QString draftFolder();
63 63
64 virtual MAILLIB::ATYPE getType()const=0; 64 virtual MAILLIB::ATYPE getType()const=0;
65 virtual const QString&getName()const=0; 65 virtual const QString&getName()const=0;
66 66
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp
index cb7ccc0..cb58d82 100644
--- a/noncore/net/mail/libmailwrapper/generatemail.cpp
+++ b/noncore/net/mail/libmailwrapper/generatemail.cpp
@@ -1,23 +1,24 @@
1#include "generatemail.h" 1#include "generatemail.h"
2#include "mailwrapper.h" 2#include "mailwrapper.h"
3 3
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5 5
6#include <qt.h> 6#include <qt.h>
7 7
8using namespace Opie::Core;
8const char* Generatemail::USER_AGENT="OpieMail v0.6"; 9const char* Generatemail::USER_AGENT="OpieMail v0.6";
9 10
10Generatemail::Generatemail() 11Generatemail::Generatemail()
11{ 12{
12} 13}
13 14
14Generatemail::~Generatemail() 15Generatemail::~Generatemail()
15{ 16{
16} 17}
17 18
18void Generatemail::addRcpts( clist *list, mailimf_address_list *addr_list ) { 19void Generatemail::addRcpts( clist *list, mailimf_address_list *addr_list ) {
19 clistiter *it, *it2; 20 clistiter *it, *it2;
20 21
21 for ( it = clist_begin( addr_list->ad_list ); it; it = it->next ) { 22 for ( it = clist_begin( addr_list->ad_list ); it; it = it->next ) {
22 mailimf_address *addr; 23 mailimf_address *addr;
23 addr = (mailimf_address *) it->data; 24 addr = (mailimf_address *) it->data;
@@ -266,33 +267,33 @@ err_free_fields:
266 mailmime_fields_free( fields ); 267 mailmime_fields_free( fields );
267err_free_content: 268err_free_content:
268 mailmime_content_free( content ); 269 mailmime_content_free( content );
269err_free_param: 270err_free_param:
270 mailmime_parameter_free( param ); 271 mailmime_parameter_free( param );
271err_free: 272err_free:
272 qDebug( "buildTxtPart - error" ); 273 qDebug( "buildTxtPart - error" );
273 274
274 return NULL; // Error :( 275 return NULL; // Error :(
275} 276}
276 277
277mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) { 278mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) {
278 return mailimf_mailbox_new( strdup( name.latin1() ), 279 return mailimf_mailbox_new( strdup( name.latin1() ),
279 strdup( mail.latin1() ) ); 280 strdup( mail.latin1() ) );
280} 281}
281 282
282mailimf_fields *Generatemail::createImfFields(const Opie::OSmartPointer<Mail>&mail ) 283mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Mail>&mail )
283{ 284{
284 mailimf_fields *fields = NULL; 285 mailimf_fields *fields = NULL;
285 mailimf_field *xmailer = NULL; 286 mailimf_field *xmailer = NULL;
286 mailimf_mailbox *sender=0,*fromBox=0; 287 mailimf_mailbox *sender=0,*fromBox=0;
287 mailimf_mailbox_list *from=0; 288 mailimf_mailbox_list *from=0;
288 mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0; 289 mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0;
289 clist*in_reply_to = 0; 290 clist*in_reply_to = 0;
290 char *subject = strdup( mail->getSubject().latin1() ); 291 char *subject = strdup( mail->getSubject().latin1() );
291 int err; 292 int err;
292 int res = 1; 293 int res = 1;
293 294
294 sender = newMailbox( mail->getName(), mail->getMail() ); 295 sender = newMailbox( mail->getName(), mail->getMail() );
295 if ( sender == NULL ) { 296 if ( sender == NULL ) {
296 res = 0; 297 res = 0;
297 } 298 }
298 299
@@ -386,33 +387,33 @@ mailimf_fields *Generatemail::createImfFields(const Opie::OSmartPointer<Mail>&ma
386 if (fromBox) { 387 if (fromBox) {
387 mailimf_mailbox_free( fromBox ); 388 mailimf_mailbox_free( fromBox );
388 } else if (from) { 389 } else if (from) {
389 mailimf_mailbox_list_free( from ); 390 mailimf_mailbox_list_free( from );
390 } 391 }
391 if (sender) { 392 if (sender) {
392 mailimf_mailbox_free( sender ); 393 mailimf_mailbox_free( sender );
393 } 394 }
394 if (subject) { 395 if (subject) {
395 free( subject ); 396 free( subject );
396 } 397 }
397 } 398 }
398 } 399 }
399 return fields; 400 return fields;
400} 401}
401 402
402mailmime *Generatemail::createMimeMail(const Opie::OSmartPointer<Mail> &mail ) { 403mailmime *Generatemail::createMimeMail(const Opie::Core::OSmartPointer<Mail> &mail ) {
403 mailmime *message, *txtPart; 404 mailmime *message, *txtPart;
404 mailimf_fields *fields; 405 mailimf_fields *fields;
405 int err; 406 int err;
406 407
407 fields = createImfFields( mail ); 408 fields = createImfFields( mail );
408 if ( fields == NULL ) 409 if ( fields == NULL )
409 goto err_free; 410 goto err_free;
410 411
411 message = mailmime_new_message_data( NULL ); 412 message = mailmime_new_message_data( NULL );
412 if ( message == NULL ) 413 if ( message == NULL )
413 goto err_free_fields; 414 goto err_free_fields;
414 415
415 mailmime_set_imf_fields( message, fields ); 416 mailmime_set_imf_fields( message, fields );
416 417
417 txtPart = buildTxtPart( mail->getMessage() ); 418 txtPart = buildTxtPart( mail->getMessage() );
418 419
diff --git a/noncore/net/mail/libmailwrapper/generatemail.h b/noncore/net/mail/libmailwrapper/generatemail.h
index c246a2a..a767b61 100644
--- a/noncore/net/mail/libmailwrapper/generatemail.h
+++ b/noncore/net/mail/libmailwrapper/generatemail.h
@@ -23,24 +23,24 @@ class Generatemail : public QObject
23{ 23{
24 Q_OBJECT 24 Q_OBJECT
25public: 25public:
26 Generatemail(); 26 Generatemail();
27 virtual ~Generatemail(); 27 virtual ~Generatemail();
28 28
29protected: 29protected:
30 static void addRcpts( clist *list, mailimf_address_list *addr_list ); 30 static void addRcpts( clist *list, mailimf_address_list *addr_list );
31 static char *getFrom( mailmime *mail ); 31 static char *getFrom( mailmime *mail );
32 static char *getFrom( mailimf_field *ffrom); 32 static char *getFrom( mailimf_field *ffrom);
33 static mailimf_field *getField( mailimf_fields *fields, int type ); 33 static mailimf_field *getField( mailimf_fields *fields, int type );
34 mailimf_address_list *parseAddresses(const QString&addr ); 34 mailimf_address_list *parseAddresses(const QString&addr );
35 void addFileParts( mailmime *message,const QList<Attachment>&files ); 35 void addFileParts( mailmime *message,const QList<Attachment>&files );
36 mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); 36 mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content);
37 mailmime *buildTxtPart(const QString&str ); 37 mailmime *buildTxtPart(const QString&str );
38 mailimf_mailbox *newMailbox(const QString&name,const QString&mail ); 38 mailimf_mailbox *newMailbox(const QString&name,const QString&mail );
39 mailimf_fields *createImfFields(const Opie::OSmartPointer<Mail> &mail ); 39 mailimf_fields *createImfFields(const Opie::Core::OSmartPointer<Mail> &mail );
40 mailmime *createMimeMail(const Opie::OSmartPointer<Mail>&mail ); 40 mailmime *createMimeMail(const Opie::Core::OSmartPointer<Mail>&mail );
41 clist *createRcptList( mailimf_fields *fields ); 41 clist *createRcptList( mailimf_fields *fields );
42 42
43 static const char* USER_AGENT; 43 static const char* USER_AGENT;
44}; 44};
45 45
46#endif 46#endif
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index ee2c8cd..f428415 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -1,20 +1,21 @@
1#include "genericwrapper.h" 1#include "genericwrapper.h"
2#include <libetpan/libetpan.h> 2#include <libetpan/libetpan.h>
3#include "mailtypes.h" 3#include "mailtypes.h"
4 4
5using namespace Opie::Core;
5Genericwrapper::Genericwrapper() 6Genericwrapper::Genericwrapper()
6 : AbstractMail() 7 : AbstractMail()
7{ 8{
8 bodyCache.clear(); 9 bodyCache.clear();
9 m_storage = 0; 10 m_storage = 0;
10 m_folder = 0; 11 m_folder = 0;
11} 12}
12 13
13Genericwrapper::~Genericwrapper() 14Genericwrapper::~Genericwrapper()
14{ 15{
15 if (m_folder) { 16 if (m_folder) {
16 mailfolder_free(m_folder); 17 mailfolder_free(m_folder);
17 } 18 }
18 if (m_storage) { 19 if (m_storage) {
19 mailstorage_free(m_storage); 20 mailstorage_free(m_storage);
20 } 21 }
@@ -374,33 +375,33 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
374 clistiter * current = 0; 375 clistiter * current = 0;
375 for ( current = clist_begin( in_replies->mid_list ); current != NULL; current = current->next ) { 376 for ( current = clist_begin( in_replies->mid_list ); current != NULL; current = current->next ) {
376 QString h((char*)current->data); 377 QString h((char*)current->data);
377 while (h.length()>0 && h[0]=='<') { 378 while (h.length()>0 && h[0]=='<') {
378 h.remove(0,1); 379 h.remove(0,1);
379 } 380 }
380 while (h.length()>0 && h[h.length()-1]=='>') { 381 while (h.length()>0 && h[h.length()-1]=='>') {
381 h.remove(h.length()-1,1); 382 h.remove(h.length()-1,1);
382 } 383 }
383 if (h.length()>0) { 384 if (h.length()>0) {
384 res.append(h); 385 res.append(h);
385 } 386 }
386 } 387 }
387 return res; 388 return res;
388} 389}
389 390
390void Genericwrapper::parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) 391void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
391{ 392{
392 int r; 393 int r;
393 mailmessage_list * env_list = 0; 394 mailmessage_list * env_list = 0;
394 r = mailsession_get_messages_list(session,&env_list); 395 r = mailsession_get_messages_list(session,&env_list);
395 if (r != MAIL_NO_ERROR) { 396 if (r != MAIL_NO_ERROR) {
396 qDebug("Error message list"); 397 qDebug("Error message list");
397 return; 398 return;
398 } 399 }
399 r = mailsession_get_envelopes_list(session, env_list); 400 r = mailsession_get_envelopes_list(session, env_list);
400 if (r != MAIL_NO_ERROR) { 401 if (r != MAIL_NO_ERROR) {
401 qDebug("Error filling message list"); 402 qDebug("Error filling message list");
402 if (env_list) { 403 if (env_list) {
403 mailmessage_list_free(env_list); 404 mailmessage_list_free(env_list);
404 } 405 }
405 return; 406 return;
406 } 407 }
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h
index f9968d1..f5b9504 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.h
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.h
@@ -25,43 +25,43 @@ struct mailimf_in_reply_to;
25 25
26/* this class hold just the funs shared between 26/* this class hold just the funs shared between
27 * mbox and pop3 (later mh, too) mail access. 27 * mbox and pop3 (later mh, too) mail access.
28 * it is not desigend to make a instance of it! 28 * it is not desigend to make a instance of it!
29 */ 29 */
30class Genericwrapper : public AbstractMail 30class Genericwrapper : public AbstractMail
31{ 31{
32 Q_OBJECT 32 Q_OBJECT
33public: 33public:
34 Genericwrapper(); 34 Genericwrapper();
35 virtual ~Genericwrapper(); 35 virtual ~Genericwrapper();
36 36
37 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part); 37 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part);
38 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part); 38 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part);
39 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part); 39 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part);
40 virtual void cleanMimeCache(); 40 virtual void cleanMimeCache();
41 virtual int deleteMbox(const Opie::OSmartPointer<Folder>&){return 1;} 41 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&){return 1;}
42 virtual void logout(){}; 42 virtual void logout(){};
43 virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; 43 virtual void storeMessage(const char*msg,size_t length, const QString&folder){};
44 44
45protected: 45protected:
46 RecBody parseMail( mailmessage * msg ); 46 RecBody parseMail( mailmessage * msg );
47 QString parseMailboxList( mailimf_mailbox_list *list ); 47 QString parseMailboxList( mailimf_mailbox_list *list );
48 QString parseMailbox( mailimf_mailbox *box ); 48 QString parseMailbox( mailimf_mailbox *box );
49 QString parseGroup( mailimf_group *group ); 49 QString parseGroup( mailimf_group *group );
50 QString parseAddressList( mailimf_address_list *list ); 50 QString parseAddressList( mailimf_address_list *list );
51 QString parseDateTime( mailimf_date_time *date ); 51 QString parseDateTime( mailimf_date_time *date );
52 52
53 void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); 53 void traverseBody(RecBody&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1);
54 static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime); 54 static void fillSingleBody(RecPart&target,mailmessage*message,mailmime*mime);
55 static void fillParameters(RecPart&target,clist*parameters); 55 static void fillParameters(RecPart&target,clist*parameters);
56 static QString getencoding(mailmime_mechanism*aEnc); 56 static QString getencoding(mailmime_mechanism*aEnc);
57 virtual void parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); 57 virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false);
58 QStringList parseInreplies(mailimf_in_reply_to * in_replies); 58 QStringList parseInreplies(mailimf_in_reply_to * in_replies);
59 59
60 QString msgTempName; 60 QString msgTempName;
61 unsigned int last_msg_id; 61 unsigned int last_msg_id;
62 QMap<QString,encodedString*> bodyCache; 62 QMap<QString,encodedString*> bodyCache;
63 mailstorage * m_storage; 63 mailstorage * m_storage;
64 mailfolder*m_folder; 64 mailfolder*m_folder;
65}; 65};
66 66
67#endif 67#endif
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 071e734..56e7df9 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -1,24 +1,25 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <libetpan/libetpan.h> 2#include <libetpan/libetpan.h>
3#include <qpe/global.h> 3#include <qpe/global.h>
4 4
5#include "imapwrapper.h" 5#include "imapwrapper.h"
6#include "mailtypes.h" 6#include "mailtypes.h"
7#include "logindialog.h" 7#include "logindialog.h"
8 8
9using namespace Opie::Core;
9IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 10IMAPwrapper::IMAPwrapper( IMAPaccount *a )
10 : AbstractMail() 11 : AbstractMail()
11{ 12{
12 account = a; 13 account = a;
13 m_imap = 0; 14 m_imap = 0;
14 m_Lastmbox = ""; 15 m_Lastmbox = "";
15} 16}
16 17
17IMAPwrapper::~IMAPwrapper() 18IMAPwrapper::~IMAPwrapper()
18{ 19{
19 logout(); 20 logout();
20} 21}
21 22
22/* to avoid to often select statements in loops etc. 23/* to avoid to often select statements in loops etc.
23 we trust that we are logged in and connection is established!*/ 24 we trust that we are logged in and connection is established!*/
24int IMAPwrapper::selectMbox(const QString&mbox) 25int IMAPwrapper::selectMbox(const QString&mbox)
@@ -192,33 +193,33 @@ void IMAPwrapper::login()
192 mailimap_free( m_imap ); 193 mailimap_free( m_imap );
193 m_imap = 0; 194 m_imap = 0;
194 } 195 }
195} 196}
196 197
197void IMAPwrapper::logout() 198void IMAPwrapper::logout()
198{ 199{
199 int err = MAILIMAP_NO_ERROR; 200 int err = MAILIMAP_NO_ERROR;
200 if (!m_imap) return; 201 if (!m_imap) return;
201 err = mailimap_logout( m_imap ); 202 err = mailimap_logout( m_imap );
202 err = mailimap_close( m_imap ); 203 err = mailimap_close( m_imap );
203 mailimap_free( m_imap ); 204 mailimap_free( m_imap );
204 m_imap = 0; 205 m_imap = 0;
205 m_Lastmbox = ""; 206 m_Lastmbox = "";
206} 207}
207 208
208void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::OSmartPointer<RecMail> > &target ) 209void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
209{ 210{
210 int err = MAILIMAP_NO_ERROR; 211 int err = MAILIMAP_NO_ERROR;
211 clist *result = 0; 212 clist *result = 0;
212 clistcell *current; 213 clistcell *current;
213 mailimap_fetch_type *fetchType = 0; 214 mailimap_fetch_type *fetchType = 0;
214 mailimap_set *set = 0; 215 mailimap_set *set = 0;
215 216
216 login(); 217 login();
217 if (!m_imap) { 218 if (!m_imap) {
218 return; 219 return;
219 } 220 }
220 /* select mailbox READONLY for operations */ 221 /* select mailbox READONLY for operations */
221 err = selectMbox(mailbox); 222 err = selectMbox(mailbox);
222 if ( err != MAILIMAP_NO_ERROR ) { 223 if ( err != MAILIMAP_NO_ERROR ) {
223 return; 224 return;
224 } 225 }
@@ -253,33 +254,33 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::OSmartPoin
253 msg_att = (mailimap_msg_att*)current->data; 254 msg_att = (mailimap_msg_att*)current->data;
254 RecMail*m = parse_list_result(msg_att); 255 RecMail*m = parse_list_result(msg_att);
255 if (m) { 256 if (m) {
256 m->setNumber(i); 257 m->setNumber(i);
257 m->setMbox(mailbox); 258 m->setMbox(mailbox);
258 m->setWrapper(this); 259 m->setWrapper(this);
259 target.append(m); 260 target.append(m);
260 } 261 }
261 } 262 }
262 Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count())); 263 Global::statusMessage(tr("Mailbox has %1 mails").arg(target.count()));
263 } else { 264 } else {
264 Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response)); 265 Global::statusMessage(tr("Error fetching headers: %1").arg(m_imap->imap_response));
265 } 266 }
266 if (result) mailimap_fetch_list_free(result); 267 if (result) mailimap_fetch_list_free(result);
267} 268}
268 269
269QValueList<Opie::OSmartPointer<Folder> >* IMAPwrapper::listFolders() 270QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
270{ 271{
271 const char *path, *mask; 272 const char *path, *mask;
272 int err = MAILIMAP_NO_ERROR; 273 int err = MAILIMAP_NO_ERROR;
273 clist *result = 0; 274 clist *result = 0;
274 clistcell *current = 0; 275 clistcell *current = 0;
275 clistcell*cur_flag = 0; 276 clistcell*cur_flag = 0;
276 mailimap_mbx_list_flags*bflags = 0; 277 mailimap_mbx_list_flags*bflags = 0;
277 278
278 QValueList<FolderP>* folders = new QValueList<FolderP>(); 279 QValueList<FolderP>* folders = new QValueList<FolderP>();
279 login(); 280 login();
280 if (!m_imap) { 281 if (!m_imap) {
281 return folders; 282 return folders;
282 } 283 }
283 284
284/* 285/*
285 * First we have to check for INBOX 'cause it sometimes it's not inside the path. 286 * First we have to check for INBOX 'cause it sometimes it's not inside the path.
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h
index 3bd5967..7448acb 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.h
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.h
@@ -10,53 +10,53 @@ struct mailimap;
10struct mailimap_body; 10struct mailimap_body;
11struct mailimap_body_type_1part; 11struct mailimap_body_type_1part;
12struct mailimap_body_type_text; 12struct mailimap_body_type_text;
13struct mailimap_body_type_basic; 13struct mailimap_body_type_basic;
14struct mailimap_body_type_msg; 14struct mailimap_body_type_msg;
15struct mailimap_body_type_mpart; 15struct mailimap_body_type_mpart;
16struct mailimap_body_fields; 16struct mailimap_body_fields;
17struct mailimap_msg_att; 17struct mailimap_msg_att;
18class encodedString; 18class encodedString;
19 19
20class IMAPwrapper : public AbstractMail 20class IMAPwrapper : public AbstractMail
21{ 21{
22 Q_OBJECT 22 Q_OBJECT
23public: 23public:
24 IMAPwrapper( IMAPaccount *a ); 24 IMAPwrapper( IMAPaccount *a );
25 virtual ~IMAPwrapper(); 25 virtual ~IMAPwrapper();
26 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); 26 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
27 virtual void listMessages(const QString & mailbox,QValueList<Opie::OSmartPointer<RecMail> >&target ); 27 virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target );
28 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 28 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
29 29
30 virtual void deleteMail(const RecMailP&mail); 30 virtual void deleteMail(const RecMailP&mail);
31 virtual void answeredMail(const RecMailP&mail); 31 virtual void answeredMail(const RecMailP&mail);
32 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&folder); 32 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder);
33 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 33 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
34 virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, 34 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
35 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 35 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
36 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 36 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
37 37
38 virtual RecBody fetchBody(const RecMailP&mail); 38 virtual RecBody fetchBody(const RecMailP&mail);
39 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part); 39 virtual QString fetchTextPart(const RecMailP&mail,const RecPart&part);
40 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part); 40 virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPart&part);
41 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part); 41 virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPart&part);
42 virtual encodedString* fetchRawBody(const RecMailP&mail); 42 virtual encodedString* fetchRawBody(const RecMailP&mail);
43 43
44 virtual int createMbox(const QString&,const Opie::OSmartPointer<Folder>&parentfolder=0, 44 virtual int createMbox(const QString&,const Opie::Core::OSmartPointer<Folder>&parentfolder=0,
45 const QString& delemiter="/",bool getsubfolder=false); 45 const QString& delemiter="/",bool getsubfolder=false);
46 virtual int deleteMbox(const Opie::OSmartPointer<Folder>&folder); 46 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&folder);
47 47
48 static void imap_progress( size_t current, size_t maximum ); 48 static void imap_progress( size_t current, size_t maximum );
49 49
50 virtual void logout(); 50 virtual void logout();
51 virtual MAILLIB::ATYPE getType()const; 51 virtual MAILLIB::ATYPE getType()const;
52 virtual const QString&getName()const; 52 virtual const QString&getName()const;
53 53
54protected: 54protected:
55 RecMail*parse_list_result(mailimap_msg_att*); 55 RecMail*parse_list_result(mailimap_msg_att*);
56 void login(); 56 void login();
57 bool start_tls(bool force=true); 57 bool start_tls(bool force=true);
58 58
59 virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); 59 virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc="");
60 virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); 60 virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call);
61 int selectMbox(const QString&mbox); 61 int selectMbox(const QString&mbox);
62 62
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp
index 7dd7e58..fd91fe5 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.cpp
+++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp
@@ -1,27 +1,28 @@
1#include "mailtypes.h" 1#include "mailtypes.h"
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4using namespace Opie::Core;
4RecMail::RecMail() 5RecMail::RecMail()
5 :Opie::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) 6 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7)
6{ 7{
7 init(); 8 init();
8} 9}
9 10
10RecMail::RecMail(const RecMail&old) 11RecMail::RecMail(const RecMail&old)
11 :Opie::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) 12 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
12{ 13{
13 init(); 14 init();
14 copy_old(old); 15 copy_old(old);
15 qDebug("Copy constructor RecMail"); 16 qDebug("Copy constructor RecMail");
16} 17}
17 18
18RecMail::~RecMail() 19RecMail::~RecMail()
19{ 20{
20 wrapper = 0; 21 wrapper = 0;
21} 22}
22 23
23void RecMail::copy_old(const RecMail&old) 24void RecMail::copy_old(const RecMail&old)
24{ 25{
25 subject = old.subject; 26 subject = old.subject;
26 date = old.date; 27 date = old.date;
27 mbox = old.mbox; 28 mbox = old.mbox;
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h
index dc10de6..941556a 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.h
+++ b/noncore/net/mail/libmailwrapper/mailtypes.h
@@ -16,33 +16,33 @@
16#include <qmap.h> 16#include <qmap.h>
17#include <qvaluelist.h> 17#include <qvaluelist.h>
18 18
19class AbstractMail; 19class AbstractMail;
20/* a class to describe mails in a mailbox */ 20/* a class to describe mails in a mailbox */
21/* Attention! 21/* Attention!
22 From programmers point of view it would make sense to 22 From programmers point of view it would make sense to
23 store the mail body into this class, too. 23 store the mail body into this class, too.
24 But: not from the point of view of the device. 24 But: not from the point of view of the device.
25 Mailbodies can be real large. So we request them when 25 Mailbodies can be real large. So we request them when
26 needed from the mail-wrapper class direct from the server itself 26 needed from the mail-wrapper class direct from the server itself
27 (imap) or from a file-based cache (pop3?) 27 (imap) or from a file-based cache (pop3?)
28 So there is no interface "const QString&body()" but you should 28 So there is no interface "const QString&body()" but you should
29 make a request to the mailwrapper with this class as parameter to 29 make a request to the mailwrapper with this class as parameter to
30 get the body. Same words for the attachments. 30 get the body. Same words for the attachments.
31*/ 31*/
32class RecMail:public Opie::ORefCount 32class RecMail:public Opie::Core::ORefCount
33{ 33{
34public: 34public:
35 RecMail(); 35 RecMail();
36 RecMail(const RecMail&old); 36 RecMail(const RecMail&old);
37 virtual ~RecMail(); 37 virtual ~RecMail();
38 38
39 const unsigned int getNumber()const{return msg_number;} 39 const unsigned int getNumber()const{return msg_number;}
40 void setNumber(unsigned int number){msg_number=number;} 40 void setNumber(unsigned int number){msg_number=number;}
41 const QString&getDate()const{ return date; } 41 const QString&getDate()const{ return date; }
42 void setDate( const QString&a ) { date = a; } 42 void setDate( const QString&a ) { date = a; }
43 const QString&getFrom()const{ return from; } 43 const QString&getFrom()const{ return from; }
44 void setFrom( const QString&a ) { from = a; } 44 void setFrom( const QString&a ) { from = a; }
45 const QString&getSubject()const { return subject; } 45 const QString&getSubject()const { return subject; }
46 void setSubject( const QString&s ) { subject = s; } 46 void setSubject( const QString&s ) { subject = s; }
47 const QString&getMbox()const{return mbox;} 47 const QString&getMbox()const{return mbox;}
48 void setMbox(const QString&box){mbox = box;} 48 void setMbox(const QString&box){mbox = box;}
@@ -68,33 +68,33 @@ public:
68 const QBitArray&getFlags()const{return msg_flags;} 68 const QBitArray&getFlags()const{return msg_flags;}
69 void setFlags(const QBitArray&flags){msg_flags = flags;} 69 void setFlags(const QBitArray&flags){msg_flags = flags;}
70 70
71 void setWrapper(AbstractMail*wrapper); 71 void setWrapper(AbstractMail*wrapper);
72 AbstractMail* Wrapper(); 72 AbstractMail* Wrapper();
73 73
74protected: 74protected:
75 QString subject,date,from,mbox,msg_id,replyto; 75 QString subject,date,from,mbox,msg_id,replyto;
76 unsigned int msg_number,msg_size; 76 unsigned int msg_number,msg_size;
77 QBitArray msg_flags; 77 QBitArray msg_flags;
78 QStringList to,cc,bcc,in_reply_to,references; 78 QStringList to,cc,bcc,in_reply_to,references;
79 AbstractMail*wrapper; 79 AbstractMail*wrapper;
80 void init(); 80 void init();
81 void copy_old(const RecMail&old); 81 void copy_old(const RecMail&old);
82}; 82};
83 83
84typedef Opie::OSmartPointer<RecMail> RecMailP; 84typedef Opie::Core::OSmartPointer<RecMail> RecMailP;
85typedef QMap<QString,QString> part_plist_t; 85typedef QMap<QString,QString> part_plist_t;
86 86
87class RecPart 87class RecPart
88{ 88{
89protected: 89protected:
90 QString m_type,m_subtype,m_identifier,m_encoding,m_description; 90 QString m_type,m_subtype,m_identifier,m_encoding,m_description;
91 unsigned int m_lines,m_size; 91 unsigned int m_lines,m_size;
92 part_plist_t m_Parameters; 92 part_plist_t m_Parameters;
93 /* describes the position in the mail */ 93 /* describes the position in the mail */
94 QValueList<int> m_poslist; 94 QValueList<int> m_poslist;
95 95
96public: 96public:
97 RecPart(); 97 RecPart();
98 virtual ~RecPart(); 98 virtual ~RecPart();
99 99
100 const QString&Type()const; 100 const QString&Type()const;
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index 9bf2fd3..eddc0b9 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -8,32 +8,33 @@
8 8
9#include "mailwrapper.h" 9#include "mailwrapper.h"
10//#include "logindialog.h" 10//#include "logindialog.h"
11//#include "defines.h" 11//#include "defines.h"
12 12
13#define UNDEFINED 64 13#define UNDEFINED 64
14#define MAXLINE 76 14#define MAXLINE 76
15#define UTF16MASK 0x03FFUL 15#define UTF16MASK 0x03FFUL
16#define UTF16SHIFT 10 16#define UTF16SHIFT 10
17#define UTF16BASE 0x10000UL 17#define UTF16BASE 0x10000UL
18#define UTF16HIGHSTART 0xD800UL 18#define UTF16HIGHSTART 0xD800UL
19#define UTF16HIGHEND 0xDBFFUL 19#define UTF16HIGHEND 0xDBFFUL
20#define UTF16LOSTART 0xDC00UL 20#define UTF16LOSTART 0xDC00UL
21#define UTF16LOEND 0xDFFFUL 21#define UTF16LOEND 0xDFFFUL
22 22
23 23
24using namespace Opie::Core;
24Attachment::Attachment( DocLnk lnk ) 25Attachment::Attachment( DocLnk lnk )
25{ 26{
26 doc = lnk; 27 doc = lnk;
27 size = QFileInfo( doc.file() ).size(); 28 size = QFileInfo( doc.file() ).size();
28} 29}
29 30
30Folder::Folder(const QString&tmp_name, const QString&sep ) 31Folder::Folder(const QString&tmp_name, const QString&sep )
31{ 32{
32 name = tmp_name; 33 name = tmp_name;
33 nameDisplay = name; 34 nameDisplay = name;
34 separator = sep; 35 separator = sep;
35 prefix = ""; 36 prefix = "";
36} 37}
37 38
38Folder::~Folder() 39Folder::~Folder()
39{ 40{
@@ -142,33 +143,33 @@ QString IMAPFolder::decodeFolderName( const QString &name )
142 /* copy it */ 143 /* copy it */
143 for (c = 0; c < i; ++c) { 144 for (c = 0; c < i; ++c) {
144 dst += utf8[c]; 145 dst += utf8[c];
145 } 146 }
146 } 147 }
147 } 148 }
148 /* skip over trailing '-' in modified UTF-7 encoding */ 149 /* skip over trailing '-' in modified UTF-7 encoding */
149 if (src[srcPtr] == '-') 150 if (src[srcPtr] == '-')
150 ++srcPtr; 151 ++srcPtr;
151 } 152 }
152 } 153 }
153 154
154 return QString::fromUtf8( dst.data() ); 155 return QString::fromUtf8( dst.data() );
155} 156}
156 157
157Mail::Mail() 158Mail::Mail()
158 :Opie::ORefCount(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("") 159 :Opie::Core::ORefCount(),name(""), mail(""), to(""), cc(""), bcc(""), reply(""), subject(""), message("")
159{ 160{
160} 161}
161 162
162MHFolder::MHFolder(const QString&disp_name,const QString&mbox) 163MHFolder::MHFolder(const QString&disp_name,const QString&mbox)
163 : Folder( disp_name,"/" ) 164 : Folder( disp_name,"/" )
164{ 165{
165 separator = "/"; 166 separator = "/";
166 name = mbox; 167 name = mbox;
167 if (!disp_name.startsWith("/") && disp_name.length()>0) 168 if (!disp_name.startsWith("/") && disp_name.length()>0)
168 name+="/"; 169 name+="/";
169 name+=disp_name; 170 name+=disp_name;
170 if (disp_name.length()==0) { 171 if (disp_name.length()==0) {
171 nameDisplay = separator; 172 nameDisplay = separator;
172 } 173 }
173 prefix = mbox; 174 prefix = mbox;
174} 175}
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.h b/noncore/net/mail/libmailwrapper/mailwrapper.h
index 6bf0078..542de03 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.h
@@ -15,33 +15,33 @@ class Attachment
15public: 15public:
16 Attachment( DocLnk lnk ); 16 Attachment( DocLnk lnk );
17 virtual ~Attachment(){} 17 virtual ~Attachment(){}
18 const QString getFileName()const{ return doc.file(); } 18 const QString getFileName()const{ return doc.file(); }
19 const QString getName()const{ return doc.name(); } 19 const QString getName()const{ return doc.name(); }
20 const QString getMimeType()const{ return doc.type(); } 20 const QString getMimeType()const{ return doc.type(); }
21 const QPixmap getPixmap()const{ return doc.pixmap(); } 21 const QPixmap getPixmap()const{ return doc.pixmap(); }
22 const int getSize()const { return size; } 22 const int getSize()const { return size; }
23 DocLnk getDocLnk() { return doc; } 23 DocLnk getDocLnk() { return doc; }
24 24
25protected: 25protected:
26 DocLnk doc; 26 DocLnk doc;
27 int size; 27 int size;
28 28
29}; 29};
30 30
31class Mail:public Opie::ORefCount 31class Mail:public Opie::Core::ORefCount
32{ 32{
33public: 33public:
34 Mail(); 34 Mail();
35 /* Possible that this destructor must not be declared virtual 35 /* Possible that this destructor must not be declared virtual
36 * 'cause it seems that it will never have some child classes. 36 * 'cause it seems that it will never have some child classes.
37 * in this case this object will not get a virtual table -> memory and 37 * in this case this object will not get a virtual table -> memory and
38 * speed will be a little bit better? 38 * speed will be a little bit better?
39 */ 39 */
40 virtual ~Mail(){} 40 virtual ~Mail(){}
41 void addAttachment( Attachment *att ) { attList.append( att ); } 41 void addAttachment( Attachment *att ) { attList.append( att ); }
42 const QList<Attachment>& getAttachments()const { return attList; } 42 const QList<Attachment>& getAttachments()const { return attList; }
43 void removeAttachment( Attachment *att ) { attList.remove( att ); } 43 void removeAttachment( Attachment *att ) { attList.remove( att ); }
44 const QString&getName()const { return name; } 44 const QString&getName()const { return name; }
45 void setName( QString s ) { name = s; } 45 void setName( QString s ) { name = s; }
46 const QString&getMail()const{ return mail; } 46 const QString&getMail()const{ return mail; }
47 void setMail( const QString&s ) { mail = s; } 47 void setMail( const QString&s ) { mail = s; }
@@ -53,49 +53,49 @@ public:
53 void setBCC( const QString&s ) { bcc = s; } 53 void setBCC( const QString&s ) { bcc = s; }
54 const QString&getMessage()const { return message; } 54 const QString&getMessage()const { return message; }
55 void setMessage( const QString&s ) { message = s; } 55 void setMessage( const QString&s ) { message = s; }
56 const QString&getSubject()const { return subject; } 56 const QString&getSubject()const { return subject; }
57 void setSubject( const QString&s ) { subject = s; } 57 void setSubject( const QString&s ) { subject = s; }
58 const QString&getReply()const{ return reply; } 58 const QString&getReply()const{ return reply; }
59 void setReply( const QString&a ) { reply = a; } 59 void setReply( const QString&a ) { reply = a; }
60 void setInreply(const QStringList&list){m_in_reply_to = list;} 60 void setInreply(const QStringList&list){m_in_reply_to = list;}
61 const QStringList&Inreply()const{return m_in_reply_to;} 61 const QStringList&Inreply()const{return m_in_reply_to;}
62 62
63private: 63private:
64 QList<Attachment> attList; 64 QList<Attachment> attList;
65 QString name, mail, to, cc, bcc, reply, subject, message; 65 QString name, mail, to, cc, bcc, reply, subject, message;
66 QStringList m_in_reply_to; 66 QStringList m_in_reply_to;
67}; 67};
68 68
69class Folder:public Opie::ORefCount 69class Folder:public Opie::Core::ORefCount
70{ 70{
71public: 71public:
72 Folder( const QString&init_name,const QString&sep ); 72 Folder( const QString&init_name,const QString&sep );
73 virtual ~Folder(); 73 virtual ~Folder();
74 const QString&getDisplayName()const { return nameDisplay; } 74 const QString&getDisplayName()const { return nameDisplay; }
75 const QString&getName()const { return name; } 75 const QString&getName()const { return name; }
76 const QString&getPrefix()const{return prefix; } 76 const QString&getPrefix()const{return prefix; }
77 virtual bool may_select()const{return true;} 77 virtual bool may_select()const{return true;}
78 virtual bool no_inferior()const{return true;} 78 virtual bool no_inferior()const{return true;}
79 const QString&Separator()const; 79 const QString&Separator()const;
80 80
81protected: 81protected:
82 QString nameDisplay, name, separator,prefix; 82 QString nameDisplay, name, separator,prefix;
83}; 83};
84 84
85typedef Opie::OSmartPointer<Folder> FolderP; 85typedef Opie::Core::OSmartPointer<Folder> FolderP;
86 86
87class MHFolder : public Folder 87class MHFolder : public Folder
88{ 88{
89public: 89public:
90 MHFolder(const QString&disp_name,const QString&mbox); 90 MHFolder(const QString&disp_name,const QString&mbox);
91 virtual ~MHFolder(); 91 virtual ~MHFolder();
92}; 92};
93 93
94class IMAPFolder : public Folder 94class IMAPFolder : public Folder
95{ 95{
96 public: 96 public:
97 IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" ); 97 IMAPFolder(const QString&name, const QString&sep, bool select=true,bool noinf=false,const QString&prefix="" );
98 virtual ~IMAPFolder(); 98 virtual ~IMAPFolder();
99 virtual bool may_select()const{return m_MaySelect;} 99 virtual bool may_select()const{return m_MaySelect;}
100 virtual bool no_inferior()const{return m_NoInferior;} 100 virtual bool no_inferior()const{return m_NoInferior;}
101 private: 101 private:
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
index 5e6b714..4aee0be 100644
--- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
@@ -1,24 +1,25 @@
1#include "mboxwrapper.h" 1#include "mboxwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <stdlib.h> 6#include <stdlib.h>
7#include <qpe/global.h> 7#include <qpe/global.h>
8 8
9using namespace Opie::Core;
9MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) 10MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name)
10 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name) 11 : Genericwrapper(),MBOXPath(mbox_dir),MBOXName(mbox_name)
11{ 12{
12 QDir dir(MBOXPath); 13 QDir dir(MBOXPath);
13 if (!dir.exists()) { 14 if (!dir.exists()) {
14 dir.mkdir(MBOXPath); 15 dir.mkdir(MBOXPath);
15 } 16 }
16} 17}
17 18
18MBOXwrapper::~MBOXwrapper() 19MBOXwrapper::~MBOXwrapper()
19{ 20{
20} 21}
21 22
22void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) 23void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target )
23{ 24{
24 mailstorage*storage = mailstorage_new(NULL); 25 mailstorage*storage = mailstorage_new(NULL);
@@ -31,35 +32,35 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta
31 r = mailfolder_connect(folder); 32 r = mailfolder_connect(folder);
32 if (r != MAIL_NO_ERROR) { 33 if (r != MAIL_NO_ERROR) {
33 qDebug("Error initializing mbox"); 34 qDebug("Error initializing mbox");
34 mailfolder_free(folder); 35 mailfolder_free(folder);
35 mailstorage_free(storage); 36 mailstorage_free(storage);
36 return; 37 return;
37 } 38 }
38 39
39 parseList(target,folder->fld_session,mailbox); 40 parseList(target,folder->fld_session,mailbox);
40 41
41 mailfolder_disconnect(folder); 42 mailfolder_disconnect(folder);
42 mailfolder_free(folder); 43 mailfolder_free(folder);
43 mailstorage_free(storage); 44 mailstorage_free(storage);
44 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 45 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
45} 46}
46 47
47QValueList<Opie::OSmartPointer<Folder> >* MBOXwrapper::listFolders() 48QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders()
48{ 49{
49 QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); 50 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
50 QDir dir(MBOXPath); 51 QDir dir(MBOXPath);
51 if (!dir.exists()) return folders; 52 if (!dir.exists()) return folders;
52 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); 53 dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable);
53 QStringList entries = dir.entryList(); 54 QStringList entries = dir.entryList();
54 QStringList::ConstIterator it = entries.begin(); 55 QStringList::ConstIterator it = entries.begin();
55 for (;it!=entries.end();++it) { 56 for (;it!=entries.end();++it) {
56 FolderP inb=new Folder(*it,"/"); 57 FolderP inb=new Folder(*it,"/");
57 folders->append(inb); 58 folders->append(inb);
58 } 59 }
59 return folders; 60 return folders;
60} 61}
61 62
62void MBOXwrapper::deleteMail(const RecMailP & mail) 63void MBOXwrapper::deleteMail(const RecMailP & mail)
63{ 64{
64 mailstorage*storage = mailstorage_new(NULL); 65 mailstorage*storage = mailstorage_new(NULL);
65 QString p = MBOXPath+"/"; 66 QString p = MBOXPath+"/";
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.h b/noncore/net/mail/libmailwrapper/mboxwrapper.h
index 33eeb1e..a2ecfee 100644
--- a/noncore/net/mail/libmailwrapper/mboxwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mboxwrapper.h
@@ -3,44 +3,44 @@
3 3
4#include "genericwrapper.h" 4#include "genericwrapper.h"
5#include <qstring.h> 5#include <qstring.h>
6 6
7class encodedString; 7class encodedString;
8struct mailmbox_folder; 8struct mailmbox_folder;
9 9
10class MBOXwrapper : public Genericwrapper 10class MBOXwrapper : public Genericwrapper
11{ 11{
12 Q_OBJECT 12 Q_OBJECT
13 13
14public: 14public:
15 MBOXwrapper(const QString & dir,const QString&name); 15 MBOXwrapper(const QString & dir,const QString&name);
16 virtual ~MBOXwrapper(); 16 virtual ~MBOXwrapper();
17 17
18 virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); 18 virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target );
19 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); 19 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
20 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 20 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
21 21
22 virtual void deleteMail(const RecMailP&mail); 22 virtual void deleteMail(const RecMailP&mail);
23 virtual void answeredMail(const RecMailP&mail); 23 virtual void answeredMail(const RecMailP&mail);
24 24
25 virtual int createMbox(const QString&folder,const Opie::OSmartPointer<Folder>&f=0, 25 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0,
26 const QString&d="",bool s=false); 26 const QString&d="",bool s=false);
27 virtual int deleteMbox(const Opie::OSmartPointer<Folder>&); 27 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&);
28 28
29 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 29 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
30 30
31 virtual RecBody fetchBody( const RecMailP &mail ); 31 virtual RecBody fetchBody( const RecMailP &mail );
32 static void mbox_progress( size_t current, size_t maximum ); 32 static void mbox_progress( size_t current, size_t maximum );
33 33
34 virtual encodedString* fetchRawBody(const RecMailP&mail); 34 virtual encodedString* fetchRawBody(const RecMailP&mail);
35 virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); 35 virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target);
36 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); 36 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
37 virtual MAILLIB::ATYPE getType()const; 37 virtual MAILLIB::ATYPE getType()const;
38 virtual const QString&getName()const; 38 virtual const QString&getName()const;
39 39
40protected: 40protected:
41 static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); 41 static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target);
42 QString MBOXPath; 42 QString MBOXPath;
43 QString MBOXName; 43 QString MBOXName;
44}; 44};
45 45
46#endif 46#endif
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 0b00a2e..21e24a0 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -1,26 +1,29 @@
1#include "mhwrapper.h" 1#include "mhwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <qpe/global.h> 8#include <qpe/global.h>
9#include <opie2/oprocess.h> 9#include <opie2/oprocess.h>
10 10
11using namespace Opie::Core;
12using namespace Opie::Core;
13using namespace Opie::Core;
11MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 14MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
12 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 15 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
13{ 16{
14 if (MHPath.length()>0) { 17 if (MHPath.length()>0) {
15 if (MHPath[MHPath.length()-1]=='/') { 18 if (MHPath[MHPath.length()-1]=='/') {
16 MHPath=MHPath.left(MHPath.length()-1); 19 MHPath=MHPath.left(MHPath.length()-1);
17 } 20 }
18 qDebug(MHPath); 21 qDebug(MHPath);
19 QDir dir(MHPath); 22 QDir dir(MHPath);
20 if (!dir.exists()) { 23 if (!dir.exists()) {
21 dir.mkdir(MHPath); 24 dir.mkdir(MHPath);
22 } 25 }
23 init_storage(); 26 init_storage();
24 } 27 }
25} 28}
26 29
@@ -47,51 +50,51 @@ void MHwrapper::init_storage()
47} 50}
48 51
49void MHwrapper::clean_storage() 52void MHwrapper::clean_storage()
50{ 53{
51 if (m_storage) { 54 if (m_storage) {
52 mailstorage_disconnect(m_storage); 55 mailstorage_disconnect(m_storage);
53 mailstorage_free(m_storage); 56 mailstorage_free(m_storage);
54 m_storage = 0; 57 m_storage = 0;
55 } 58 }
56} 59}
57 60
58MHwrapper::~MHwrapper() 61MHwrapper::~MHwrapper()
59{ 62{
60 clean_storage(); 63 clean_storage();
61} 64}
62 65
63void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ) 66void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
64{ 67{
65 init_storage(); 68 init_storage();
66 if (!m_storage) { 69 if (!m_storage) {
67 return; 70 return;
68 } 71 }
69 QString f = buildPath(mailbox); 72 QString f = buildPath(mailbox);
70 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 73 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
71 if (r!=MAIL_NO_ERROR) { 74 if (r!=MAIL_NO_ERROR) {
72 qDebug("listMessages: error selecting folder!"); 75 qDebug("listMessages: error selecting folder!");
73 return; 76 return;
74 } 77 }
75 parseList(target,m_storage->sto_session,f); 78 parseList(target,m_storage->sto_session,f);
76 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 79 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
77} 80}
78 81
79QValueList<Opie::OSmartPointer<Folder> >* MHwrapper::listFolders() 82QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
80{ 83{
81 QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); 84 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
82 /* this is needed! */ 85 /* this is needed! */
83 if (m_storage) mailstorage_disconnect(m_storage); 86 if (m_storage) mailstorage_disconnect(m_storage);
84 init_storage(); 87 init_storage();
85 if (!m_storage) { 88 if (!m_storage) {
86 return folders; 89 return folders;
87 } 90 }
88 mail_list*flist = 0; 91 mail_list*flist = 0;
89 clistcell*current=0; 92 clistcell*current=0;
90 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 93 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
91 if (r != MAIL_NO_ERROR || !flist) { 94 if (r != MAIL_NO_ERROR || !flist) {
92 qDebug("error getting folder list"); 95 qDebug("error getting folder list");
93 return folders; 96 return folders;
94 } 97 }
95 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { 98 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
96 QString t = (char*)current->data; 99 QString t = (char*)current->data;
97 t.replace(0,MHPath.length(),""); 100 t.replace(0,MHPath.length(),"");
@@ -304,35 +307,35 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
304 if (!tfolder) return 0; 307 if (!tfolder) return 0;
305 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; 308 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
306 309
307 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 310 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
308 311
309 if (r != MAIL_NO_ERROR) { 312 if (r != MAIL_NO_ERROR) {
310 qDebug("error deleting mail box"); 313 qDebug("error deleting mail box");
311 return 0; 314 return 0;
312 } 315 }
313 QString cmd = "rm -rf "+tfolder->getName(); 316 QString cmd = "rm -rf "+tfolder->getName();
314 QStringList command; 317 QStringList command;
315 command << "/bin/sh"; 318 command << "/bin/sh";
316 command << "-c"; 319 command << "-c";
317 command << cmd.latin1(); 320 command << cmd.latin1();
318 OProcess *process = new OProcess(); 321 OProcess *process = new OProcess();
319 322
320 connect(process, SIGNAL(processExited(OProcess*)), 323 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
321 this, SLOT( processEnded(OProcess*))); 324 this, SLOT( processEnded(OProcess*)));
322 connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)), 325 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
323 this, SLOT( oprocessStderr(OProcess*,char*,int))); 326 this, SLOT( oprocessStderr(OProcess*,char*,int)));
324 327
325 *process << command; 328 *process << command;
326 removeMboxfailed = false; 329 removeMboxfailed = false;
327 if(!process->start(OProcess::Block, OProcess::All) ) { 330 if(!process->start(OProcess::Block, OProcess::All) ) {
328 qDebug("could not start process"); 331 qDebug("could not start process");
329 return 0; 332 return 0;
330 } 333 }
331 qDebug("mail box deleted"); 334 qDebug("mail box deleted");
332 return 1; 335 return 1;
333} 336}
334 337
335void MHwrapper::processEnded(OProcess *p) 338void MHwrapper::processEnded(OProcess *p)
336{ 339{
337 if (p) delete p; 340 if (p) delete p;
338} 341}
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.h b/noncore/net/mail/libmailwrapper/mhwrapper.h
index 208cf2f..1245507 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.h
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.h
@@ -1,60 +1,60 @@
1#ifndef __MH_WRAPPER_H 1#ifndef __MH_WRAPPER_H
2#define __MH_WRAPPER_H 2#define __MH_WRAPPER_H
3 3
4#include "maildefines.h" 4#include "maildefines.h"
5 5
6#include "genericwrapper.h" 6#include "genericwrapper.h"
7#include <qstring.h> 7#include <qstring.h>
8 8
9class encodedString; 9class encodedString;
10struct mailmbox_folder; 10struct mailmbox_folder;
11class OProcess; 11namespace Opie {namespace Core {class Opie::Core::OProcess;}}
12 12
13class MHwrapper : public Genericwrapper 13class MHwrapper : public Genericwrapper
14{ 14{
15 Q_OBJECT 15 Q_OBJECT
16public: 16public:
17 MHwrapper(const QString & dir,const QString&name); 17 MHwrapper(const QString & dir,const QString&name);
18 virtual ~MHwrapper(); 18 virtual ~MHwrapper();
19 19
20 virtual void listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ); 20 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target );
21 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); 21 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
22 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 22 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
23 23
24 virtual void deleteMail(const RecMailP&mail); 24 virtual void deleteMail(const RecMailP&mail);
25 virtual void answeredMail(const RecMailP&mail); 25 virtual void answeredMail(const RecMailP&mail);
26 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 26 virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
27 virtual void mvcpAllMails(const Opie::OSmartPointer<Folder>&fromFolder, 27 virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,
28 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 28 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit);
29 29
30 virtual int createMbox(const QString&folder,const Opie::OSmartPointer<Folder>&f=0, 30 virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0,
31 const QString&d="",bool s=false); 31 const QString&d="",bool s=false);
32 virtual int deleteMbox(const Opie::OSmartPointer<Folder>&); 32 virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&);
33 33
34 virtual void storeMessage(const char*msg,size_t length, const QString&folder); 34 virtual void storeMessage(const char*msg,size_t length, const QString&folder);
35 35
36 virtual RecBody fetchBody( const RecMailP &mail ); 36 virtual RecBody fetchBody( const RecMailP &mail );
37 static void mbox_progress( size_t current, size_t maximum ); 37 static void mbox_progress( size_t current, size_t maximum );
38 38
39 virtual encodedString* fetchRawBody(const RecMailP&mail); 39 virtual encodedString* fetchRawBody(const RecMailP&mail);
40 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::OSmartPointer<RecMail> > &target); 40 virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target);
41 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); 41 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
42 virtual MAILLIB::ATYPE getType()const; 42 virtual MAILLIB::ATYPE getType()const;
43 virtual const QString&getName()const; 43 virtual const QString&getName()const;
44 44
45public slots: 45public slots:
46 /* for deleting maildirs we are using a system call */ 46 /* for deleting maildirs we are using a system call */
47 virtual void oprocessStderr(OProcess*, char *buffer, int ); 47 virtual void oprocessStderr(Opie::Core::OProcess*, char *buffer, int );
48 virtual void processEnded(OProcess *); 48 virtual void processEnded(Opie::Core::OProcess *);
49protected: 49protected:
50 QString buildPath(const QString&p); 50 QString buildPath(const QString&p);
51 QString MHPath; 51 QString MHPath;
52 QString MHName; 52 QString MHName;
53 53
54 void init_storage(); 54 void init_storage();
55 void clean_storage(); 55 void clean_storage();
56 56
57 bool removeMboxfailed; 57 bool removeMboxfailed;
58}; 58};
59 59
60#endif 60#endif
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index c0b3eec..9de958d 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -1,29 +1,30 @@
1#include "nntpwrapper.h" 1#include "nntpwrapper.h"
2#include "logindialog.h" 2#include "logindialog.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4 4
5#include <qfile.h> 5#include <qfile.h>
6 6
7#include <stdlib.h> 7#include <stdlib.h>
8 8
9#include <libetpan/libetpan.h> 9#include <libetpan/libetpan.h>
10 10
11 11
12#define HARD_MSG_SIZE_LIMIT 5242880 12#define HARD_MSG_SIZE_LIMIT 5242880
13 13
14using namespace Opie::Core;
14NNTPwrapper::NNTPwrapper( NNTPaccount *a ) 15NNTPwrapper::NNTPwrapper( NNTPaccount *a )
15: Genericwrapper() { 16: Genericwrapper() {
16 account = a; 17 account = a;
17 m_nntp = NULL; 18 m_nntp = NULL;
18 msgTempName = a->getFileName()+"_msg_cache"; 19 msgTempName = a->getFileName()+"_msg_cache";
19 last_msg_id = 0; 20 last_msg_id = 0;
20} 21}
21 22
22NNTPwrapper::~NNTPwrapper() { 23NNTPwrapper::~NNTPwrapper() {
23 logout(); 24 logout();
24 QFile msg_cache(msgTempName); 25 QFile msg_cache(msgTempName);
25 if (msg_cache.exists()) { 26 if (msg_cache.exists()) {
26 msg_cache.remove(); 27 msg_cache.remove();
27 } 28 }
28} 29}
29 30
@@ -83,33 +84,33 @@ RecBody NNTPwrapper::fetchBody( const RecMailP &mail ) {
83 msg_data->msg_fetched = 1; 84 msg_data->msg_fetched = 1;
84 msg_data->msg_message = message; 85 msg_data->msg_message = message;
85 msg_data->msg_length = strlen(message); 86 msg_data->msg_length = strlen(message);
86 } 87 }
87 body = parseMail(mailmsg); 88 body = parseMail(mailmsg);
88 89
89 /* clean up */ 90 /* clean up */
90 if (mailmsg) 91 if (mailmsg)
91 mailmessage_free(mailmsg); 92 mailmessage_free(mailmsg);
92 if (message) 93 if (message)
93 free(message); 94 free(message);
94 95
95 return body; 96 return body;
96} 97}
97 98
98 99
99void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::OSmartPointer<RecMail> > &target ) 100void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
100{ 101{
101 login(); 102 login();
102 if (!m_nntp) 103 if (!m_nntp)
103 return; 104 return;
104 uint32_t res_messages,res_recent,res_unseen; 105 uint32_t res_messages,res_recent,res_unseen;
105 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); 106 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen);
106 parseList(target,m_nntp->sto_session,which,true); 107 parseList(target,m_nntp->sto_session,which,true);
107} 108}
108 109
109void NNTPwrapper::login() 110void NNTPwrapper::login()
110{ 111{
111 if (account->getOffline()) 112 if (account->getOffline())
112 return; 113 return;
113 /* we'll hold the line */ 114 /* we'll hold the line */
114 if ( m_nntp != NULL ) 115 if ( m_nntp != NULL )
115 return; 116 return;
@@ -175,35 +176,35 @@ void NNTPwrapper::login()
175 mailstorage_free(m_nntp); 176 mailstorage_free(m_nntp);
176 m_nntp = 0; 177 m_nntp = 0;
177 178
178 } 179 }
179 180
180} 181}
181 182
182void NNTPwrapper::logout() 183void NNTPwrapper::logout()
183{ 184{
184 int err = NEWSNNTP_NO_ERROR; 185 int err = NEWSNNTP_NO_ERROR;
185 if ( m_nntp == NULL ) 186 if ( m_nntp == NULL )
186 return; 187 return;
187 mailstorage_free(m_nntp); 188 mailstorage_free(m_nntp);
188 m_nntp = 0; 189 m_nntp = 0;
189} 190}
190 191
191QValueList<Opie::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { 192QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() {
192 193
193 QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); 194 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
194 QStringList groups; 195 QStringList groups;
195 if (account) { 196 if (account) {
196 groups = account->getGroups(); 197 groups = account->getGroups();
197 } 198 }
198 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { 199 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) {
199 folders->append(new Folder((*it),".")); 200 folders->append(new Folder((*it),"."));
200 } 201 }
201 return folders; 202 return folders;
202} 203}
203 204
204/* we made this method in raw nntp access of etpan and not via generic interface 205/* we made this method in raw nntp access of etpan and not via generic interface
205 * 'cause in that case there will be doubled copy operations. eg. the etpan would 206 * 'cause in that case there will be doubled copy operations. eg. the etpan would
206 * copy that stuff into its own structures and we must copy it into useable c++ 207 * copy that stuff into its own structures and we must copy it into useable c++
207 * structures for our frontend. this would not make sense, so it is better to reimplement 208 * structures for our frontend. this would not make sense, so it is better to reimplement
208 * the stuff from generic interface of etpan but copy it direct to qt classes. 209 * the stuff from generic interface of etpan but copy it direct to qt classes.
209 */ 210 */
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h
index a7e4b95..a87a8e8 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h
@@ -7,41 +7,41 @@
7#include <libetpan/clist.h> 7#include <libetpan/clist.h>
8 8
9class encodedString; 9class encodedString;
10struct mailstorage; 10struct mailstorage;
11struct mailfolder; 11struct mailfolder;
12 12
13class NNTPwrapper : public Genericwrapper 13class NNTPwrapper : public Genericwrapper
14{ 14{
15 15
16 Q_OBJECT 16 Q_OBJECT
17 17
18public: 18public:
19 NNTPwrapper( NNTPaccount *a ); 19 NNTPwrapper( NNTPaccount *a );
20 virtual ~NNTPwrapper(); 20 virtual ~NNTPwrapper();
21 21
22 /* mailbox will be ignored */ 22 /* mailbox will be ignored */
23 virtual void listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ); 23 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target );
24 /* should only get the subscribed one */ 24 /* should only get the subscribed one */
25 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); 25 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
26 /* mailbox will be ignored */ 26 /* mailbox will be ignored */
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28 QStringList listAllNewsgroups(const QString&mask = QString::null); 28 QStringList listAllNewsgroups(const QString&mask = QString::null);
29 virtual void deleteMail(const RecMailP&mail); 29 virtual void deleteMail(const RecMailP&mail);
30 virtual void answeredMail(const RecMailP&mail); 30 virtual void answeredMail(const RecMailP&mail);
31 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); 31 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
32 32
33 virtual RecBody fetchBody( const RecMailP &mail ); 33 virtual RecBody fetchBody( const RecMailP &mail );
34 virtual encodedString* fetchRawBody(const RecMailP&mail); 34 virtual encodedString* fetchRawBody(const RecMailP&mail);
35 virtual void logout(); 35 virtual void logout();
36 virtual MAILLIB::ATYPE getType()const; 36 virtual MAILLIB::ATYPE getType()const;
37 virtual const QString&getName()const; 37 virtual const QString&getName()const;
38 static void nntp_progress( size_t current, size_t maximum ); 38 static void nntp_progress( size_t current, size_t maximum );
39 39
40protected: 40protected:
41 void login(); 41 void login();
42 NNTPaccount *account; 42 NNTPaccount *account;
43 mailstorage* m_nntp; 43 mailstorage* m_nntp;
44 44
45 45
46}; 46};
47 47
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 6737d6c..f5694fe 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -1,28 +1,29 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include "pop3wrapper.h" 2#include "pop3wrapper.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4#include "logindialog.h" 4#include "logindialog.h"
5#include <libetpan/libetpan.h> 5#include <libetpan/libetpan.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qfile.h> 7#include <qfile.h>
8//#include <qstring.h> 8//#include <qstring.h>
9 9
10/* we don't fetch messages larger than 5 MB */ 10/* we don't fetch messages larger than 5 MB */
11#define HARD_MSG_SIZE_LIMIT 5242880 11#define HARD_MSG_SIZE_LIMIT 5242880
12 12
13using namespace Opie::Core;
13POP3wrapper::POP3wrapper( POP3account *a ) 14POP3wrapper::POP3wrapper( POP3account *a )
14: Genericwrapper() { 15: Genericwrapper() {
15 account = a; 16 account = a;
16 m_pop3 = NULL; 17 m_pop3 = NULL;
17 msgTempName = a->getFileName()+"_msg_cache"; 18 msgTempName = a->getFileName()+"_msg_cache";
18 last_msg_id = 0; 19 last_msg_id = 0;
19} 20}
20 21
21POP3wrapper::~POP3wrapper() { 22POP3wrapper::~POP3wrapper() {
22 logout(); 23 logout();
23 QFile msg_cache(msgTempName); 24 QFile msg_cache(msgTempName);
24 if (msg_cache.exists()) { 25 if (msg_cache.exists()) {
25 msg_cache.remove(); 26 msg_cache.remove();
26 } 27 }
27} 28}
28 29
@@ -80,33 +81,33 @@ RecBody POP3wrapper::fetchBody( const RecMailP &mail ) {
80 msg_data = (generic_message_t *)mailmsg->msg_data; 81 msg_data = (generic_message_t *)mailmsg->msg_data;
81 msg_data->msg_fetched = 1; 82 msg_data->msg_fetched = 1;
82 msg_data->msg_message = message; 83 msg_data->msg_message = message;
83 msg_data->msg_length = strlen(message); 84 msg_data->msg_length = strlen(message);
84 } 85 }
85 body = parseMail(mailmsg); 86 body = parseMail(mailmsg);
86 87
87 /* clean up */ 88 /* clean up */
88 if (mailmsg) 89 if (mailmsg)
89 mailmessage_free(mailmsg); 90 mailmessage_free(mailmsg);
90 if (message) 91 if (message)
91 free(message); 92 free(message);
92 93
93 return body; 94 return body;
94} 95}
95 96
96void POP3wrapper::listMessages(const QString &, QValueList<Opie::OSmartPointer<RecMail> > &target ) 97void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
97{ 98{
98 login(); 99 login();
99 if (!m_pop3) 100 if (!m_pop3)
100 return; 101 return;
101 uint32_t res_messages,res_recent,res_unseen; 102 uint32_t res_messages,res_recent,res_unseen;
102 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); 103 mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen);
103 parseList(target,m_pop3->sto_session,"INBOX"); 104 parseList(target,m_pop3->sto_session,"INBOX");
104 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages)); 105 Global::statusMessage( tr("Mailbox contains %1 mail(s)").arg(res_messages));
105} 106}
106 107
107void POP3wrapper::login() 108void POP3wrapper::login()
108{ 109{
109 if (account->getOffline()) 110 if (account->getOffline())
110 return; 111 return;
111 /* we'll hold the line */ 112 /* we'll hold the line */
112 if ( m_pop3 != NULL ) 113 if ( m_pop3 != NULL )
@@ -163,34 +164,34 @@ void POP3wrapper::login()
163 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); 164 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) );
164 Global::statusMessage(tr("Error initializing folder")); 165 Global::statusMessage(tr("Error initializing folder"));
165 mailstorage_free(m_pop3); 166 mailstorage_free(m_pop3);
166 m_pop3 = 0; 167 m_pop3 = 0;
167 } 168 }
168} 169}
169 170
170void POP3wrapper::logout() 171void POP3wrapper::logout()
171{ 172{
172 if ( m_pop3 == NULL ) 173 if ( m_pop3 == NULL )
173 return; 174 return;
174 mailstorage_free(m_pop3); 175 mailstorage_free(m_pop3);
175 m_pop3 = 0; 176 m_pop3 = 0;
176} 177}
177 178
178 179
179QValueList<Opie::OSmartPointer<Folder> >* POP3wrapper::listFolders() { 180QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() {
180 QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); 181 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>();
181 FolderP inb=new Folder("INBOX","/"); 182 FolderP inb=new Folder("INBOX","/");
182 folders->append(inb); 183 folders->append(inb);
183 return folders; 184 return folders;
184} 185}
185 186
186void POP3wrapper::deleteMail(const RecMailP&mail) { 187void POP3wrapper::deleteMail(const RecMailP&mail) {
187 login(); 188 login();
188 if (!m_pop3) 189 if (!m_pop3)
189 return; 190 return;
190 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber()); 191 int err = mailsession_remove_message(m_pop3->sto_session,mail->getNumber());
191 if (err != MAIL_NO_ERROR) { 192 if (err != MAIL_NO_ERROR) {
192 Global::statusMessage(tr("error deleting mail")); 193 Global::statusMessage(tr("error deleting mail"));
193 } 194 }
194} 195}
195 196
196void POP3wrapper::answeredMail(const RecMailP&) {} 197void POP3wrapper::answeredMail(const RecMailP&) {}
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h
index 31eb6f1..c46b941 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.h
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h
@@ -4,39 +4,39 @@
4#include "mailwrapper.h" 4#include "mailwrapper.h"
5#include "genericwrapper.h" 5#include "genericwrapper.h"
6#include <qstring.h> 6#include <qstring.h>
7 7
8class encodedString; 8class encodedString;
9struct mailstorage; 9struct mailstorage;
10struct mailfolder; 10struct mailfolder;
11 11
12class POP3wrapper : public Genericwrapper 12class POP3wrapper : public Genericwrapper
13{ 13{
14 Q_OBJECT 14 Q_OBJECT
15 15
16public: 16public:
17 POP3wrapper( POP3account *a ); 17 POP3wrapper( POP3account *a );
18 virtual ~POP3wrapper(); 18 virtual ~POP3wrapper();
19 /* mailbox will be ignored */ 19 /* mailbox will be ignored */
20 virtual void listMessages(const QString & mailbox, QValueList<Opie::OSmartPointer<RecMail> > &target ); 20 virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target );
21 virtual QValueList<Opie::OSmartPointer<Folder> >* listFolders(); 21 virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders();
22 /* mailbox will be ignored */ 22 /* mailbox will be ignored */
23 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 23 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
24 24
25 virtual void deleteMail(const RecMailP&mail); 25 virtual void deleteMail(const RecMailP&mail);
26 virtual void answeredMail(const RecMailP&mail); 26 virtual void answeredMail(const RecMailP&mail);
27 virtual int deleteAllMail(const Opie::OSmartPointer<Folder>&); 27 virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&);
28 28
29 virtual RecBody fetchBody( const RecMailP &mail ); 29 virtual RecBody fetchBody( const RecMailP &mail );
30 virtual encodedString* fetchRawBody(const RecMailP&mail); 30 virtual encodedString* fetchRawBody(const RecMailP&mail);
31 virtual void logout(); 31 virtual void logout();
32 virtual MAILLIB::ATYPE getType()const; 32 virtual MAILLIB::ATYPE getType()const;
33 virtual const QString&getName()const; 33 virtual const QString&getName()const;
34 static void pop3_progress( size_t current, size_t maximum ); 34 static void pop3_progress( size_t current, size_t maximum );
35 35
36protected: 36protected:
37 void login(); 37 void login();
38 POP3account *account; 38 POP3account *account;
39 mailstorage*m_pop3; 39 mailstorage*m_pop3;
40}; 40};
41 41
42#endif 42#endif
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index 86673aa..e2cea7a 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -1,31 +1,32 @@
1#include "smtpwrapper.h" 1#include "smtpwrapper.h"
2#include "mailwrapper.h" 2#include "mailwrapper.h"
3#include "abstractmail.h" 3#include "abstractmail.h"
4#include "logindialog.h" 4#include "logindialog.h"
5#include "mailtypes.h" 5#include "mailtypes.h"
6#include "sendmailprogress.h" 6#include "sendmailprogress.h"
7 7
8#include <qt.h> 8#include <qt.h>
9 9
10#include <qpe/config.h> 10#include <qpe/config.h>
11#include <qpe/qcopenvelope_qws.h> 11#include <qpe/qcopenvelope_qws.h>
12 12
13#include <libetpan/libetpan.h> 13#include <libetpan/libetpan.h>
14 14
15 15
16using namespace Opie::Core;
16progressMailSend*SMTPwrapper::sendProgress = 0; 17progressMailSend*SMTPwrapper::sendProgress = 0;
17 18
18SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) 19SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp )
19 : Generatemail() 20 : Generatemail()
20{ 21{
21 m_SmtpAccount = aSmtp; 22 m_SmtpAccount = aSmtp;
22 Config cfg( "mail" ); 23 Config cfg( "mail" );
23 cfg.setGroup( "Status" ); 24 cfg.setGroup( "Status" );
24 m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); 25 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
25 emit queuedMails( m_queuedMail ); 26 emit queuedMails( m_queuedMail );
26 connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); 27 connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) );
27 m_smtp = 0; 28 m_smtp = 0;
28} 29}
29 30
30SMTPwrapper::~SMTPwrapper() 31SMTPwrapper::~SMTPwrapper()
31{ 32{
@@ -299,33 +300,33 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
299 failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err)); 300 failuretext=tr("Error sending mail: %1").arg(mailsmtpError(err));
300 result = 0; 301 result = 0;
301 } 302 }
302 } else { 303 } else {
303 result = 0; 304 result = 0;
304 } 305 }
305 306
306 if (!result) { 307 if (!result) {
307 storeFailedMail(data,size,failuretext); 308 storeFailedMail(data,size,failuretext);
308 } else { 309 } else {
309 qDebug( "Mail sent." ); 310 qDebug( "Mail sent." );
310 storeMail(data,size,"Sent"); 311 storeMail(data,size,"Sent");
311 } 312 }
312 return result; 313 return result;
313} 314}
314 315
315void SMTPwrapper::sendMail(const Opie::OSmartPointer<Mail>&mail,bool later ) 316void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
316{ 317{
317 mailmime * mimeMail; 318 mailmime * mimeMail;
318 319
319 mimeMail = createMimeMail(mail ); 320 mimeMail = createMimeMail(mail );
320 if ( mimeMail == NULL ) { 321 if ( mimeMail == NULL ) {
321 qDebug( "sendMail: error creating mime mail" ); 322 qDebug( "sendMail: error creating mime mail" );
322 } else { 323 } else {
323 sendProgress = new progressMailSend(); 324 sendProgress = new progressMailSend();
324 sendProgress->show(); 325 sendProgress->show();
325 sendProgress->setMaxMails(1); 326 sendProgress->setMaxMails(1);
326 smtpSend( mimeMail,later); 327 smtpSend( mimeMail,later);
327 qDebug("Clean up done"); 328 qDebug("Clean up done");
328 sendProgress->hide(); 329 sendProgress->hide();
329 delete sendProgress; 330 delete sendProgress;
330 sendProgress = 0; 331 sendProgress = 0;
331 mailmime_free( mimeMail ); 332 mailmime_free( mimeMail );
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h
index 71ae35c..6c5bbe8 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h
@@ -10,54 +10,54 @@
10 10
11#include "settings.h" 11#include "settings.h"
12#include "generatemail.h" 12#include "generatemail.h"
13 13
14#include <opie2/osmartpointer.h> 14#include <opie2/osmartpointer.h>
15 15
16class SMTPaccount; 16class SMTPaccount;
17class AbstractMail; 17class AbstractMail;
18 18
19class SMTPwrapper : public Generatemail 19class SMTPwrapper : public Generatemail
20{ 20{
21 Q_OBJECT 21 Q_OBJECT
22 22
23public: 23public:
24 SMTPwrapper(SMTPaccount * aSmtp); 24 SMTPwrapper(SMTPaccount * aSmtp);
25 virtual ~SMTPwrapper(); 25 virtual ~SMTPwrapper();
26 void sendMail(const Opie::OSmartPointer<Mail>& mail,bool later=false ); 26 void sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false );
27 bool flushOutbox(); 27 bool flushOutbox();
28 28
29 static progressMailSend*sendProgress; 29 static progressMailSend*sendProgress;
30 30
31signals: 31signals:
32 void queuedMails( int ); 32 void queuedMails( int );
33 33
34protected: 34protected:
35 mailsmtp *m_smtp; 35 mailsmtp *m_smtp;
36 SMTPaccount * m_SmtpAccount; 36 SMTPaccount * m_SmtpAccount;
37 37
38 void connect_server(); 38 void connect_server();
39 void disc_server(); 39 void disc_server();
40 int start_smtp_tls(); 40 int start_smtp_tls();
41 41
42 42
43 void smtpSend( mailmime *mail,bool later); 43 void smtpSend( mailmime *mail,bool later);
44 44
45 static void storeMail(const char*mail, size_t length, const QString&box); 45 static void storeMail(const char*mail, size_t length, const QString&box);
46 static QString mailsmtpError( int err ); 46 static QString mailsmtpError( int err );
47 static void progress( size_t current, size_t maximum ); 47 static void progress( size_t current, size_t maximum );
48 48
49 int smtpSend(char*from,clist*rcpts,const char*data,size_t size); 49 int smtpSend(char*from,clist*rcpts,const char*data,size_t size);
50 50
51 void storeMail(mailmime*mail, const QString&box); 51 void storeMail(mailmime*mail, const QString&box);
52 52
53 int sendQueuedMail(AbstractMail*wrap,const Opie::OSmartPointer<RecMail>&which); 53 int sendQueuedMail(AbstractMail*wrap,const Opie::Core::OSmartPointer<RecMail>&which);
54 void storeFailedMail(const char*data,unsigned int size, const char*failuremessage); 54 void storeFailedMail(const char*data,unsigned int size, const char*failuremessage);
55 55
56 int m_queuedMail; 56 int m_queuedMail;
57 57
58protected slots: 58protected slots:
59 void emitQCop( int queued ); 59 void emitQCop( int queued );
60 60
61}; 61};
62 62
63#endif 63#endif
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp
index 595e7fc..914a11d 100644
--- a/noncore/net/mail/libmailwrapper/storemail.cpp
+++ b/noncore/net/mail/libmailwrapper/storemail.cpp
@@ -1,27 +1,28 @@
1#include "storemail.h" 1#include "storemail.h"
2#include "mailwrapper.h" 2#include "mailwrapper.h"
3#include "settings.h" 3#include "settings.h"
4#include "abstractmail.h" 4#include "abstractmail.h"
5 5
6#include <libetpan/libetpan.h> 6#include <libetpan/libetpan.h>
7 7
8#include <qstring.h> 8#include <qstring.h>
9 9
10#include <stdlib.h> 10#include <stdlib.h>
11 11
12using namespace Opie::Core;
12Storemail::Storemail(Account*aAccount,const QString&aFolder) 13Storemail::Storemail(Account*aAccount,const QString&aFolder)
13 : Generatemail() 14 : Generatemail()
14{ 15{
15 wrapper = 0; 16 wrapper = 0;
16 m_Account = aAccount; 17 m_Account = aAccount;
17 m_tfolder = aFolder; 18 m_tfolder = aFolder;
18 wrapper = AbstractMail::getWrapper(m_Account); 19 wrapper = AbstractMail::getWrapper(m_Account);
19 if (wrapper) { 20 if (wrapper) {
20 wrapper->createMbox(m_tfolder); 21 wrapper->createMbox(m_tfolder);
21 } 22 }
22} 23}
23 24
24Storemail::Storemail(const QString&dir,const QString&aFolder) 25Storemail::Storemail(const QString&dir,const QString&aFolder)
25 : Generatemail() 26 : Generatemail()
26{ 27{
27 wrapper = 0; 28 wrapper = 0;
@@ -36,33 +37,33 @@ Storemail::Storemail(const QString&dir,const QString&aFolder)
36Storemail::Storemail(const QString&aFolder) 37Storemail::Storemail(const QString&aFolder)
37 : Generatemail() 38 : Generatemail()
38{ 39{
39 wrapper = 0; 40 wrapper = 0;
40 m_Account = 0; 41 m_Account = 0;
41 m_tfolder = aFolder; 42 m_tfolder = aFolder;
42 wrapper = AbstractMail::getWrapper(AbstractMail::defaultLocalfolder()); 43 wrapper = AbstractMail::getWrapper(AbstractMail::defaultLocalfolder());
43 if (wrapper) { 44 if (wrapper) {
44 wrapper->createMbox(m_tfolder); 45 wrapper->createMbox(m_tfolder);
45 } 46 }
46} 47}
47 48
48Storemail::~Storemail() 49Storemail::~Storemail()
49{ 50{
50} 51}
51 52
52int Storemail::storeMail(const Opie::OSmartPointer<Mail>&mail) 53int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail)
53{ 54{
54 if (!wrapper) return 0; 55 if (!wrapper) return 0;
55 int ret = 1; 56 int ret = 1;
56 57
57 mailmime * mimeMail = 0; 58 mailmime * mimeMail = 0;
58 mimeMail = createMimeMail(mail ); 59 mimeMail = createMimeMail(mail );
59 if ( mimeMail == NULL ) { 60 if ( mimeMail == NULL ) {
60 qDebug( "storeMail: error creating mime mail" ); 61 qDebug( "storeMail: error creating mime mail" );
61 return 0; 62 return 0;
62 } 63 }
63 char *data; 64 char *data;
64 size_t size; 65 size_t size;
65 data = 0; 66 data = 0;
66 67
67 mailmessage * msg = 0; 68 mailmessage * msg = 0;
68 msg = mime_message_init(mimeMail); 69 msg = mime_message_init(mimeMail);
diff --git a/noncore/net/mail/libmailwrapper/storemail.h b/noncore/net/mail/libmailwrapper/storemail.h
index 80c7431..4433de0 100644
--- a/noncore/net/mail/libmailwrapper/storemail.h
+++ b/noncore/net/mail/libmailwrapper/storemail.h
@@ -5,25 +5,25 @@
5 5
6#include "generatemail.h" 6#include "generatemail.h"
7 7
8class Account; 8class Account;
9class Mail; 9class Mail;
10class AbstractMail; 10class AbstractMail;
11 11
12class Storemail : public Generatemail 12class Storemail : public Generatemail
13{ 13{
14 Q_OBJECT 14 Q_OBJECT
15public: 15public:
16 Storemail(Account*aAccount,const QString&aFolder); 16 Storemail(Account*aAccount,const QString&aFolder);
17 Storemail(const QString&dir,const QString&aFolder); 17 Storemail(const QString&dir,const QString&aFolder);
18 Storemail(const QString&aFolder); 18 Storemail(const QString&aFolder);
19 virtual ~Storemail(); 19 virtual ~Storemail();
20 20
21 int storeMail(const Opie::OSmartPointer<Mail>&mail); 21 int storeMail(const Opie::Core::OSmartPointer<Mail>&mail);
22 22
23protected: 23protected:
24 Account* m_Account; 24 Account* m_Account;
25 QString m_tfolder; 25 QString m_tfolder;
26 AbstractMail*wrapper; 26 AbstractMail*wrapper;
27}; 27};
28 28
29#endif 29#endif
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 005a839..926cdbd 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -39,28 +39,28 @@ SOURCES = main.cpp \
39 39
40INTERFACES = editaccountsui.ui \ 40INTERFACES = editaccountsui.ui \
41 selectmailtypeui.ui \ 41 selectmailtypeui.ui \
42 imapconfigui.ui \ 42 imapconfigui.ui \
43 pop3configui.ui \ 43 pop3configui.ui \
44 nntpconfigui.ui \ 44 nntpconfigui.ui \
45 smtpconfigui.ui \ 45 smtpconfigui.ui \
46 addresspickerui.ui \ 46 addresspickerui.ui \
47 composemailui.ui \ 47 composemailui.ui \
48 settingsdialogui.ui \ 48 settingsdialogui.ui \
49 statuswidgetui.ui \ 49 statuswidgetui.ui \
50 newmaildirui.ui \ 50 newmaildirui.ui \
51 selectstoreui.ui \ 51 selectstoreui.ui \
52 nntpgroupsui.ui 52 nntpgroupsui.ui
53 53
54 54
55INCLUDEPATH += $(OPIEDIR)/include 55INCLUDEPATH += $(OPIEDIR)/include /usr/local/include
56 56
57CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 57CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
58contains( CONFTEST, y ){ 58contains( CONFTEST, y ){
59 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper -liconv 59 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper -liconv
60}else{ 60}else{
61 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper 61 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper
62} 62}
63 63
64TARGET = opiemail 64TARGET = opiemail
65 65
66include ( $(OPIEDIR)/include.pro ) 66include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/main.cpp b/noncore/net/mail/main.cpp
index 54ac7fb..4942083 100644
--- a/noncore/net/mail/main.cpp
+++ b/noncore/net/mail/main.cpp
@@ -1,5 +1,7 @@
1#include <opie2/oapplicationfactory.h> 1#include <opie2/oapplicationfactory.h>
2 2
3#include "opiemail.h" 3#include "opiemail.h"
4 4
5using namespace Opie::Core;
6using namespace Opie::Core;
5OPIE_EXPORT_APP( OApplicationFactory<OpieMail> ) 7OPIE_EXPORT_APP( OApplicationFactory<OpieMail> )
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp
index de32007..f672a36 100644
--- a/noncore/net/mail/taskbarapplet/mailapplet.cpp
+++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp
@@ -1,31 +1,31 @@
1#include <qpainter.h> 1#include <qpainter.h>
2#include <qtimer.h> 2#include <qtimer.h>
3 3
4#include <qpe/qcopenvelope_qws.h> 4#include <qpe/qcopenvelope_qws.h>
5#include <qpe/resource.h> 5#include <qpe/resource.h>
6#include <qpe/config.h> 6#include <qpe/config.h>
7#include <qpe/applnk.h> 7#include <qpe/applnk.h>
8 8
9#include <opie2/odevice.h> 9#include <opie2/odevice.h>
10 10
11#include <libmailwrapper/settings.h> 11#include <libmailwrapper/settings.h>
12 12
13#include "mailapplet.h" 13#include "mailapplet.h"
14 14
15using namespace Opie; 15using namespace Opie::Core;
16 16
17MailApplet::MailApplet( QWidget *parent ) 17MailApplet::MailApplet( QWidget *parent )
18: QWidget( parent ) { 18: QWidget( parent ) {
19 19
20 m_config = new Config( "mail" ); 20 m_config = new Config( "mail" );
21 m_config->setGroup( "Applet" ); 21 m_config->setGroup( "Applet" );
22 22
23 setFixedWidth( AppLnk::smallIconSize() ); 23 setFixedWidth( AppLnk::smallIconSize() );
24 setFixedHeight( AppLnk::smallIconSize() ); 24 setFixedHeight( AppLnk::smallIconSize() );
25 25
26 hide(); 26 hide();
27 27
28 m_newMails = 0; 28 m_newMails = 0;
29 m_statusMail = 0l; 29 m_statusMail = 0l;
30 30
31 if ( !m_config->readBoolEntry( "Disabled", false ) ) { 31 if ( !m_config->readBoolEntry( "Disabled", false ) ) {
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 894a386..f00d2cb 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -5,32 +5,33 @@
5#include <libmailwrapper/settings.h> 5#include <libmailwrapper/settings.h>
6#include <libmailwrapper/abstractmail.h> 6#include <libmailwrapper/abstractmail.h>
7#include <libmailwrapper/mailtypes.h> 7#include <libmailwrapper/mailtypes.h>
8 8
9#include <opie2/ofiledialog.h> 9#include <opie2/ofiledialog.h>
10#include <qpe/config.h> 10#include <qpe/config.h>
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12 12
13/* QT */ 13/* QT */
14#include <qtextbrowser.h> 14#include <qtextbrowser.h>
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <qtextstream.h> 16#include <qtextstream.h>
17#include <qaction.h> 17#include <qaction.h>
18#include <qpopupmenu.h> 18#include <qpopupmenu.h>
19#include <qfile.h> 19#include <qfile.h>
20 20
21using namespace Opie::Ui;
21AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 22AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
22 const QString&fsize,int num,const QValueList<int>&path) 23 const QString&fsize,int num,const QValueList<int>&path)
23 : QListViewItem(parent,after),_partNum(num) 24 : QListViewItem(parent,after),_partNum(num)
24{ 25{
25 _path=path; 26 _path=path;
26 setText(0, mime); 27 setText(0, mime);
27 setText(1, desc); 28 setText(1, desc);
28 setText(2, file); 29 setText(2, file);
29 setText(3, fsize); 30 setText(3, fsize);
30} 31}
31 32
32AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 33AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
33 const QString&fsize,int num,const QValueList<int>&path) 34 const QString&fsize,int num,const QValueList<int>&path)
34 : QListViewItem(parent,after),_partNum(num) 35 : QListViewItem(parent,after),_partNum(num)
35{ 36{
36 _path=path; 37 _path=path;
@@ -207,33 +208,33 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
207 208
208 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) 209 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" )
209 { 210 {
210 menu->insertItem( tr( "Show Text" ), 1 ); 211 menu->insertItem( tr( "Show Text" ), 1 );
211 } 212 }
212 menu->insertItem( tr( "Save Attachment" ), 0 ); 213 menu->insertItem( tr( "Save Attachment" ), 0 );
213 menu->insertSeparator(1); 214 menu->insertSeparator(1);
214 215
215 ret = menu->exec( point, 0 ); 216 ret = menu->exec( point, 0 );
216 217
217 switch(ret) 218 switch(ret)
218 { 219 {
219 case 0: 220 case 0:
220 { 221 {
221 MimeTypes types; 222 MimeTypes types;
222 types.insert( "all", "*" ); 223 types.insert( "all", "*" );
223 QString str = Opie::OFileDialog::getSaveFileName( 1, 224 QString str = OFileDialog::getSaveFileName( 1,
224 "/", item->text( 2 ) , types, 0 ); 225 "/", item->text( 2 ) , types, 0 );
225 226
226 if( !str.isEmpty() ) 227 if( !str.isEmpty() )
227 { 228 {
228 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 229 encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
229 if (content) 230 if (content)
230 { 231 {
231 QFile output(str); 232 QFile output(str);
232 output.open(IO_WriteOnly); 233 output.open(IO_WriteOnly);
233 output.writeBlock(content->Content(),content->Length()); 234 output.writeBlock(content->Content(),content->Length());
234 output.close(); 235 output.close();
235 delete content; 236 delete content;
236 } 237 }
237 } 238 }
238 } 239 }
239 break ; 240 break ;
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp
index c2bf08c..cbb98cc 100644
--- a/noncore/net/mail/viewmailbase.cpp
+++ b/noncore/net/mail/viewmailbase.cpp
@@ -1,23 +1,23 @@
1#include <qtextbrowser.h> 1#include <qtextbrowser.h>
2#include <qlistview.h> 2#include <qlistview.h>
3#include <qaction.h> 3#include <qaction.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qvbox.h> 5#include <qvbox.h>
6 6
7#include <qpe/qpetoolbar.h> 7#include <qtoolbar.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qpe/resource.h> 9#include <qpe/resource.h>
10 10
11#include "viewmailbase.h" 11#include "viewmailbase.h"
12//#include "opendiag.h" 12//#include "opendiag.h"
13 13
14ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) 14ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
15 : QMainWindow(parent, name, fl) 15 : QMainWindow(parent, name, fl)
16{ 16{
17 setCaption(tr("E-Mail by %1")); 17 setCaption(tr("E-Mail by %1"));
18 setToolBarsMovable(false); 18 setToolBarsMovable(false);
19 19
20 toolbar = new QToolBar(this); 20 toolbar = new QToolBar(this);
21 menubar = new QMenuBar( toolbar ); 21 menubar = new QMenuBar( toolbar );
22 mailmenu = new QPopupMenu( menubar ); 22 mailmenu = new QPopupMenu( menubar );
23 menubar->insertItem( tr( "Mail" ), mailmenu ); 23 menubar->insertItem( tr( "Mail" ), mailmenu );
diff --git a/noncore/net/opieftp/main.cpp b/noncore/net/opieftp/main.cpp
index d9da4b2..330ca52 100644
--- a/noncore/net/opieftp/main.cpp
+++ b/noncore/net/opieftp/main.cpp
@@ -1,16 +1,18 @@
1 1
2/*************************************************************************** 2/***************************************************************************
3
3 main.cpp - description 4 main.cpp - description
4 ------------------- 5 -------------------
5 begin : March 10, 2002 6 begin : March 10, 2002
6 copyright : (C) 2002 by llornkcor 7 copyright : (C) 2002 by llornkcor
7 email : ljp@llornkcor.com 8 email : ljp@llornkcor.com
8 * This program is free software; you can redistribute it and/or modify * 9 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by * 10 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or * 11 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. * 12 * (at your option) any later version. *
12 ***************************************************************************/ 13 ***************************************************************************/
13#include <opie2/oapplicationfactory.h> 14#include <opie2/oapplicationfactory.h>
14#include "opieftp.h" 15#include "opieftp.h"
15 16
17using namespace Opie::Core;
16OPIE_EXPORT_APP( OApplicationFactory<OpieFtp> ) 18OPIE_EXPORT_APP( OApplicationFactory<OpieFtp> )
diff --git a/noncore/net/opieirc/config.in b/noncore/net/opieirc/config.in
index 7c6949d..38fa347 100644
--- a/noncore/net/opieirc/config.in
+++ b/noncore/net/opieirc/config.in
@@ -1,4 +1,4 @@
1 config OPIEIRC 1 config OPIEIRC
2 boolean "opie-irc (chat via your favorite IRC server)" 2 boolean "opie-irc (chat via your favorite IRC server)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 && LIBQTAUX
diff --git a/noncore/net/opieirc/ircsettings.cpp b/noncore/net/opieirc/ircsettings.cpp
index f69d2c4..13fcc24 100644
--- a/noncore/net/opieirc/ircsettings.cpp
+++ b/noncore/net/opieirc/ircsettings.cpp
@@ -1,29 +1,31 @@
1 1
2#include "ircsettings.h" 2#include "ircsettings.h"
3#include "irctab.h" 3#include "irctab.h"
4 4
5/* OPIE */ 5/* OPIE */
6#include <opie/ocolorbutton.h> 6#include <opie2/ocolorbutton.h>
7#include <opie/otabwidget.h> 7#include <opie2/otabwidget.h>
8#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
9 9
10/* QT */ 10/* QT */
11#include <qvalidator.h> 11#include <qvalidator.h>
12#include <qwhatsthis.h> 12#include <qwhatsthis.h>
13 13
14using namespace Opie;
15using namespace Opie::Ui;
14IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp) 16IRCSettings::IRCSettings(QWidget* parent, const char* name, bool modal, WFlags) : QDialog(parent, name, modal, WStyle_ContextHelp)
15{ 17{
16 setCaption(tr("Settings") ); 18 setCaption(tr("Settings") );
17 m_config = new Config("OpieIRC"); 19 m_config = new Config("OpieIRC");
18 m_config->setGroup("OpieIRC"); 20 m_config->setGroup("OpieIRC");
19 QHBoxLayout *l = new QHBoxLayout(this, 2, 2); 21 QHBoxLayout *l = new QHBoxLayout(this, 2, 2);
20 OTabWidget *tw = new OTabWidget(this); 22 OTabWidget *tw = new OTabWidget(this);
21 l->addWidget(tw); 23 l->addWidget(tw);
22 /* General Configuration */ 24 /* General Configuration */
23 QWidget *genwidget = new QWidget(tw); 25 QWidget *genwidget = new QWidget(tw);
24 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0); 26 QGridLayout *layout = new QGridLayout(genwidget, 1, 2, 5, 0);
25 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget); 27 QLabel *label = new QLabel(tr("Lines displayed :"), genwidget);
26 layout->addWidget(label, 0, 0); 28 layout->addWidget(label, 0, 0);
27 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget); 29 m_lines = new QLineEdit(m_config->readEntry("Lines", "100"), genwidget);
28 QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this")); 30 QWhatsThis::add(m_lines, tr("Amount of lines to be displayed in chats before old lines get deleted - this is necessary to restrain memory consumption. Set to 0 if you don't need this"));
29 QIntValidator *validator = new QIntValidator(this); 31 QIntValidator *validator = new QIntValidator(this);
diff --git a/noncore/net/opieirc/ircsettings.h b/noncore/net/opieirc/ircsettings.h
index cb8d896..56e667b 100644
--- a/noncore/net/opieirc/ircsettings.h
+++ b/noncore/net/opieirc/ircsettings.h
@@ -12,38 +12,40 @@
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19*/ 19*/
20 20
21#ifndef __IRCSETTINGS_H 21#ifndef __IRCSETTINGS_H
22#define __IRCSETTINGS_H 22#define __IRCSETTINGS_H
23 23
24#include <qpe/config.h> 24#include <qpe/config.h>
25#include <qdialog.h> 25#include <qdialog.h>
26#include <qlineedit.h> 26#include <qlineedit.h>
27 27
28namespace Opie {
28class OColorButton; 29class OColorButton;
30}
29 31
30class IRCSettings : public QDialog { 32class IRCSettings : public QDialog {
31 Q_OBJECT 33 Q_OBJECT
32public: 34public:
33 IRCSettings(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0); 35 IRCSettings(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0);
34 ~IRCSettings(); 36 ~IRCSettings();
35protected slots: 37protected slots:
36 void accept(); 38 void accept();
37protected: 39protected:
38 Config *m_config; 40 Config *m_config;
39 OColorButton *m_background; 41 Opie::OColorButton *m_background;
40 OColorButton *m_text; 42 Opie::OColorButton *m_text;
41 OColorButton *m_error; 43 Opie::OColorButton *m_error;
42 OColorButton *m_self; 44 Opie::OColorButton *m_self;
43 OColorButton *m_server; 45 Opie::OColorButton *m_server;
44 OColorButton *m_other; 46 Opie::OColorButton *m_other;
45 OColorButton *m_notification; 47 Opie::OColorButton *m_notification;
46 QLineEdit *m_lines; 48 QLineEdit *m_lines;
47}; 49};
48 50
49#endif /* __IRCSETTINGS_H */ 51#endif /* __IRCSETTINGS_H */
diff --git a/noncore/net/opieirc/main.cpp b/noncore/net/opieirc/main.cpp
index da38024..f3cbecc 100644
--- a/noncore/net/opieirc/main.cpp
+++ b/noncore/net/opieirc/main.cpp
@@ -1,6 +1,7 @@
1#include "mainwindow.h" 1#include "mainwindow.h"
2 2
3#include <opie/oapplicationfactory.h> 3#include <opie2/oapplicationfactory.h>
4 4
5 5
6using namespace Opie::Core;
6OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 7OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/net/opieirc/opieirc.pro b/noncore/net/opieirc/opieirc.pro
index 537f810..9039ff8 100644
--- a/noncore/net/opieirc/opieirc.pro
+++ b/noncore/net/opieirc/opieirc.pro
@@ -5,21 +5,21 @@ HEADERS = ircchannel.h ircconnection.h \
5 ircperson.h ircserver.h ircsession.h \ 5 ircperson.h ircserver.h ircsession.h \
6 mainwindow.h irctab.h ircservertab.h \ 6 mainwindow.h irctab.h ircservertab.h \
7 ircchanneltab.h ircchannellist.h \ 7 ircchanneltab.h ircchannellist.h \
8 ircserverlist.h ircservereditor.h \ 8 ircserverlist.h ircservereditor.h \
9 ircquerytab.h ircsettings.h ircmisc.h 9 ircquerytab.h ircsettings.h ircmisc.h
10 SOURCES = ircchannel.cpp ircconnection.cpp \ 10 SOURCES = ircchannel.cpp ircconnection.cpp \
11 ircmessage.cpp \ 11 ircmessage.cpp \
12 ircmessageparser.cpp ircoutput.cpp \ 12 ircmessageparser.cpp ircoutput.cpp \
13 ircperson.cpp ircserver.cpp \ 13 ircperson.cpp ircserver.cpp \
14 ircsession.cpp main.cpp mainwindow.cpp \ 14 ircsession.cpp main.cpp mainwindow.cpp \
15 irctab.cpp ircservertab.cpp \ 15 irctab.cpp ircservertab.cpp \
16 ircchanneltab.cpp ircchannellist.cpp \ 16 ircchanneltab.cpp ircchannellist.cpp \
17 ircserverlist.cpp ircservereditor.cpp \ 17 ircserverlist.cpp ircservereditor.cpp \
18 ircquerytab.cpp ircsettings.cpp ircmisc.cpp 18 ircquerytab.cpp ircsettings.cpp ircmisc.cpp
19INCLUDEPATH += $(OPIEDIR)/include 19INCLUDEPATH += $(OPIEDIR)/include
20 DEPENDPATH+= $(OPIEDIR)/include 20 DEPENDPATH+= $(OPIEDIR)/include
21LIBS += -lqpe -lopie 21LIBS += -lqpe -lopieui2 -lqtaux2
22 22
23 TARGET= opieirc 23 TARGET= opieirc
24 24
25include ( $(OPIEDIR)/include.pro ) 25include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 817936d..93b2c67 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -21,33 +21,33 @@
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-= this library; see the file COPYING.LIB. 22    --        :-= this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29 29
30#include "bluezapplet.h" 30#include "bluezapplet.h"
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36 36
37#include <opie/odevice.h> 37#include <opie2/odevice.h>
38 38
39#include <qpoint.h> 39#include <qpoint.h>
40#include <qpainter.h> 40#include <qpainter.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qframe.h> 42#include <qframe.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qstring.h> 44#include <qstring.h>
45#include <qtimer.h> 45#include <qtimer.h>
46#include <qpopupmenu.h> 46#include <qpopupmenu.h>
47 47
48#include <device.h> 48#include <device.h>
49 49
50using namespace Opie; 50using namespace Opie;
51 51
52namespace OpieTooth { 52namespace OpieTooth {
53 53
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index bae1c47..d913853 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -1,25 +1,27 @@
1 1
2#include <signal.h> 2#include <signal.h>
3 3
4#include <opie/oprocess.h> 4#include <opie2/oprocess.h>
5 5
6#include "device.h" 6#include "device.h"
7 7
8using namespace OpieTooth; 8using namespace OpieTooth;
9 9
10using namespace Opie::Core;
11using namespace Opie::Core;
10namespace { 12namespace {
11 int parsePid( const QCString& par ){ 13 int parsePid( const QCString& par ){
12 int id=0; 14 int id=0;
13 QString string( par ); 15 QString string( par );
14 QStringList list = QStringList::split( '\n', string ); 16 QStringList list = QStringList::split( '\n', string );
15 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ 17 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
16 qWarning("parsePID: %s", (*it).latin1() ); 18 qWarning("parsePID: %s", (*it).latin1() );
17 if( !(*it).startsWith("CSR") ){ 19 if( !(*it).startsWith("CSR") ){
18 id = (*it).toInt(); 20 id = (*it).toInt();
19 break; 21 break;
20 } 22 }
21 } 23 }
22 return id; 24 return id;
23 } 25 }
24} 26}
25 27
@@ -34,37 +36,37 @@ Device::Device(const QString &device, const QString &mode, const QString &speed
34 m_mode = mode; 36 m_mode = mode;
35 m_speed = speed; 37 m_speed = speed;
36 attach(); 38 attach();
37} 39}
38Device::~Device(){ 40Device::~Device(){
39 detach(); 41 detach();
40} 42}
41void Device::attach(){ 43void Device::attach(){
42 qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() ); 44 qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() );
43 if(m_process == 0 ){ 45 if(m_process == 0 ){
44 m_output.resize(0); 46 m_output.resize(0);
45 qWarning("new process to create" ); 47 qWarning("new process to create" );
46 m_process = new OProcess(); 48 m_process = new OProcess();
47 *m_process << "hciattach"; 49 *m_process << "hciattach";
48 *m_process << "-p"; 50 *m_process << "-p";
49 *m_process << m_device << m_mode << m_speed; 51 *m_process << m_device << m_mode << m_speed;
50 connect(m_process, SIGNAL( processExited(OProcess*) ), 52 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ),
51 this, SLOT( slotExited(OProcess* ) ) ); 53 this, SLOT( slotExited(OProcess* ) ) );
52 connect(m_process, SIGNAL( receivedStdout(OProcess*, char*, int) ), 54 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ),
53 this, SLOT(slotStdOut(OProcess*,char*,int ) ) ); 55 this, SLOT(slotStdOut(OProcess*,char*,int ) ) );
54 connect(m_process, SIGNAL(receivedStderr(OProcess*, char*, int ) ), 56 connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ),
55 this, SLOT(slotStdErr(OProcess*,char*,int) ) ); 57 this, SLOT(slotStdErr(OProcess*,char*,int) ) );
56 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ 58 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){
57 qWarning("Could not start" ); 59 qWarning("Could not start" );
58 delete m_process; 60 delete m_process;
59 m_process = 0; 61 m_process = 0;
60 } 62 }
61 }; 63 };
62} 64}
63void Device::detach(){ 65void Device::detach(){
64 delete m_hci; 66 delete m_hci;
65 delete m_process; 67 delete m_process;
66 // kill the pid we got 68 // kill the pid we got
67 if(m_attached ){ 69 if(m_attached ){
68 //kill the pid 70 //kill the pid
69 qWarning( "killing" ); 71 qWarning( "killing" );
70 kill(pid, 9); 72 kill(pid, 9);
@@ -83,33 +85,33 @@ void Device::slotExited( OProcess* proc)
83 if(proc== m_process ){ 85 if(proc== m_process ){
84 qWarning("proc == m_process" ); 86 qWarning("proc == m_process" );
85 if( m_process->normalExit() ){ // normal exit 87 if( m_process->normalExit() ){ // normal exit
86 qWarning("normalExit" ); 88 qWarning("normalExit" );
87 int ret = m_process->exitStatus(); 89 int ret = m_process->exitStatus();
88 if( ret == 0 ){ // attached 90 if( ret == 0 ){ // attached
89 qWarning("attached" ); 91 qWarning("attached" );
90 qWarning("Output: %s", m_output.data() ); 92 qWarning("Output: %s", m_output.data() );
91 pid = parsePid( m_output ); 93 pid = parsePid( m_output );
92 qWarning("Pid = %d", pid ); 94 qWarning("Pid = %d", pid );
93 // now hciconfig hci0 up ( determine hciX FIXME) 95 // now hciconfig hci0 up ( determine hciX FIXME)
94 // and call hciconfig hci0 up 96 // and call hciconfig hci0 up
95 // FIXME hardcoded to hci0 now :( 97 // FIXME hardcoded to hci0 now :(
96 m_hci = new OProcess( ); 98 m_hci = new OProcess( );
97 *m_hci << "hciconfig"; 99 *m_hci << "hciconfig";
98 *m_hci << "hci0 up"; 100 *m_hci << "hci0 up";
99 connect(m_hci, SIGNAL( processExited(OProcess*) ), 101 connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ),
100 this, SLOT( slotExited(OProcess* ) ) ); 102 this, SLOT( slotExited(OProcess* ) ) );
101 if(!m_hci->start() ){ 103 if(!m_hci->start() ){
102 qWarning("could not start" ); 104 qWarning("could not start" );
103 m_attached = false; 105 m_attached = false;
104 emit device("hci0", false ); 106 emit device("hci0", false );
105 } 107 }
106 }else{ 108 }else{
107 qWarning("crass" ); 109 qWarning("crass" );
108 m_attached = false; 110 m_attached = false;
109 emit device("hci0", false ); 111 emit device("hci0", false );
110 112
111 } 113 }
112 } 114 }
113 delete m_process; 115 delete m_process;
114 m_process = 0; 116 m_process = 0;
115 }else if(proc== m_hci ){ 117 }else if(proc== m_hci ){
diff --git a/noncore/net/opietooth/lib/device.h b/noncore/net/opietooth/lib/device.h
index ce7fccc..f3339fc 100644
--- a/noncore/net/opietooth/lib/device.h
+++ b/noncore/net/opietooth/lib/device.h
@@ -1,27 +1,27 @@
1 1
2#ifndef OpieToothDevice_H 2#ifndef OpieToothDevice_H
3#define OpieToothDevice_H 3#define OpieToothDevice_H
4 4
5#include <qobject.h> 5#include <qobject.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qvaluelist.h> 7#include <qvaluelist.h>
8 8
9#include <sys/types.h> 9#include <sys/types.h>
10 10
11class OProcess; 11namespace Opie {namespace Core {class Opie::Core::OProcess;}}
12namespace OpieTooth { 12namespace OpieTooth {
13 /** 13 /**
14 * Device takes care of attaching serial 14 * Device takes care of attaching serial
15 * devices to the blueZ stack. 15 * devices to the blueZ stack.
16 * After attaching it hciconfig ups it 16 * After attaching it hciconfig ups it
17 */ 17 */
18 class Device : public QObject { 18 class Device : public QObject {
19 19
20 Q_OBJECT 20 Q_OBJECT
21 21
22 public: 22 public:
23 23
24 /** 24 /**
25 * Brings up an device. 25 * Brings up an device.
26 * Usage example: new Device(/dev/ttySB0, csr) 26 * Usage example: new Device(/dev/ttySB0, csr)
27 * 27 *
@@ -54,35 +54,35 @@ namespace OpieTooth {
54 54
55 /** 55 /**
56 * Returns the device name 56 * Returns the device name
57 * @return QString, the device name 57 * @return QString, the device name
58 */ 58 */
59 QString devName()const ; // hci0 59 QString devName()const ; // hci0
60 60
61 signals: 61 signals:
62 62
63 /** 63 /**
64 * Signals devicename and up status 64 * Signals devicename and up status
65 * @return &device QString, Devicename 65 * @return &device QString, Devicename
66 * @return up bool, if the device is up or not. 66 * @return up bool, if the device is up or not.
67 */ 67 */
68 void device(const QString& device, bool up ); 68 void device(const QString& device, bool up );
69 private slots: 69 private slots:
70 virtual void slotExited( OProcess* ); 70 virtual void slotExited( Opie::Core::OProcess* );
71 virtual void slotStdOut(OProcess*, char*, int ); 71 virtual void slotStdOut(Opie::Core::OProcess*, char*, int );
72 virtual void slotStdErr(OProcess*, char*, int ); 72 virtual void slotStdErr(Opie::Core::OProcess*, char*, int );
73 private: 73 private:
74 class Private; 74 class Private;
75 Private *d; 75 Private *d;
76 QString m_device; 76 QString m_device;
77 bool m_attached:1; 77 bool m_attached:1;
78 OProcess* m_hci; 78 Opie::Core::OProcess* m_hci;
79 OProcess* m_process; 79 Opie::Core::OProcess* m_process;
80 QString m_devId; 80 QString m_devId;
81 QString m_mode; 81 QString m_mode;
82 QString m_speed; 82 QString m_speed;
83 pid_t pid; 83 pid_t pid;
84 QCString m_output; 84 QCString m_output;
85 }; 85 };
86}; 86};
87 87
88#endif 88#endif
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index c89d325..56156a8 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -1,26 +1,28 @@
1 1
2 2
3#include <opie/oprocess.h> 3#include <opie2/oprocess.h>
4 4
5#include "parser.h" 5#include "parser.h"
6#include "manager.h" 6#include "manager.h"
7 7
8 8
9using namespace OpieTooth; 9using namespace OpieTooth;
10 10
11using namespace Opie::Core;
12using namespace Opie::Core;
11Manager::Manager( const QString& dev ) 13Manager::Manager( const QString& dev )
12 : QObject() 14 : QObject()
13{ 15{
14 qWarning("created"); 16 qWarning("created");
15 m_device = dev; 17 m_device = dev;
16 m_hcitool = 0; 18 m_hcitool = 0;
17 m_sdp = 0; 19 m_sdp = 0;
18} 20}
19Manager::Manager( Device* /*dev*/ ) 21Manager::Manager( Device* /*dev*/ )
20 : QObject() 22 : QObject()
21{ 23{
22 m_hcitool = 0; 24 m_hcitool = 0;
23 m_sdp = 0; 25 m_sdp = 0;
24} 26}
25Manager::Manager() 27Manager::Manager()
26 : QObject() 28 : QObject()
@@ -29,53 +31,53 @@ Manager::Manager()
29 m_sdp = 0; 31 m_sdp = 0;
30} 32}
31Manager::~Manager(){ 33Manager::~Manager(){
32 delete m_hcitool; 34 delete m_hcitool;
33 delete m_sdp; 35 delete m_sdp;
34} 36}
35void Manager::setDevice( const QString& dev ){ 37void Manager::setDevice( const QString& dev ){
36 m_device = dev; 38 m_device = dev;
37} 39}
38void Manager::setDevice( Device* /*dev*/ ){ 40void Manager::setDevice( Device* /*dev*/ ){
39 41
40} 42}
41void Manager::isAvailable( const QString& device ){ 43void Manager::isAvailable( const QString& device ){
42 OProcess* l2ping = new OProcess(); 44 OProcess* l2ping = new OProcess();
43 l2ping->setName( device.latin1() ); 45 l2ping->setName( device.latin1() );
44 *l2ping << "l2ping" << "-c1" << device; 46 *l2ping << "l2ping" << "-c1" << device;
45 connect(l2ping, SIGNAL(processExited(OProcess* ) ), 47 connect(l2ping, SIGNAL(processExited(Opie::Core::OProcess* ) ),
46 this, SLOT(slotProcessExited(OProcess*) ) ); 48 this, SLOT(slotProcessExited(OProcess*) ) );
47 if (!l2ping->start() ) { 49 if (!l2ping->start() ) {
48 emit available( device, false ); 50 emit available( device, false );
49 delete l2ping; 51 delete l2ping;
50 } 52 }
51 53
52} 54}
53 55
54void Manager::isAvailable( Device* /*dev*/ ){ 56void Manager::isAvailable( Device* /*dev*/ ){
55 57
56 58
57} 59}
58void Manager::searchDevices( const QString& device ){ 60void Manager::searchDevices( const QString& device ){
59 qWarning("search devices"); 61 qWarning("search devices");
60 OProcess* hcitool = new OProcess(); 62 OProcess* hcitool = new OProcess();
61 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() ); 63 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() );
62 *hcitool << "hcitool" << "scan"; 64 *hcitool << "hcitool" << "scan";
63 connect( hcitool, SIGNAL(processExited(OProcess*) ) , 65 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) ,
64 this, SLOT(slotHCIExited(OProcess* ) ) ); 66 this, SLOT(slotHCIExited(OProcess* ) ) );
65 connect( hcitool, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 67 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
66 this, SLOT(slotHCIOut(OProcess*, char*, int ) ) ); 68 this, SLOT(slotHCIOut(OProcess*, char*, int ) ) );
67 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 69 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
68 qWarning("could not start"); 70 qWarning("could not start");
69 RemoteDevice::ValueList list; 71 RemoteDevice::ValueList list;
70 emit foundDevices( device, list ); 72 emit foundDevices( device, list );
71 delete hcitool; 73 delete hcitool;
72 } 74 }
73} 75}
74 76
75void Manager::searchDevices(Device* /*d*/ ){ 77void Manager::searchDevices(Device* /*d*/ ){
76 78
77 79
78} 80}
79void Manager::addService(const QString& name ){ 81void Manager::addService(const QString& name ){
80 OProcess proc; 82 OProcess proc;
81 proc << "sdptool" << "add" << name; 83 proc << "sdptool" << "add" << name;
@@ -94,35 +96,35 @@ void Manager::removeService( const QString& name ){
94 prc << "sdptool" << "del" << name; 96 prc << "sdptool" << "del" << name;
95 bool bo = true; 97 bool bo = true;
96 if (!prc.start(OProcess::DontCare ) ) 98 if (!prc.start(OProcess::DontCare ) )
97 bo = false; 99 bo = false;
98 emit removedService( name, bo ); 100 emit removedService( name, bo );
99} 101}
100void Manager::removeServices( const QStringList& list){ 102void Manager::removeServices( const QStringList& list){
101 QStringList::ConstIterator it; 103 QStringList::ConstIterator it;
102 for (it = list.begin(); it != list.end(); ++it ) 104 for (it = list.begin(); it != list.end(); ++it )
103 removeService( (*it) ); 105 removeService( (*it) );
104} 106}
105void Manager::searchServices( const QString& remDevice ){ 107void Manager::searchServices( const QString& remDevice ){
106 OProcess *m_sdp =new OProcess(); 108 OProcess *m_sdp =new OProcess();
107 *m_sdp << "sdptool" << "browse" << remDevice; 109 *m_sdp << "sdptool" << "browse" << remDevice;
108 m_sdp->setName( remDevice.latin1() ); 110 m_sdp->setName( remDevice.latin1() );
109 qWarning("search Services for %s", remDevice.latin1() ); 111 qWarning("search Services for %s", remDevice.latin1() );
110 connect(m_sdp, SIGNAL(processExited(OProcess*) ), 112 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ),
111 this, SLOT(slotSDPExited(OProcess* ) ) ); 113 this, SLOT(slotSDPExited(OProcess* ) ) );
112 connect(m_sdp, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 114 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
113 this, SLOT(slotSDPOut(OProcess*, char*, int) ) ); 115 this, SLOT(slotSDPOut(OProcess*, char*, int) ) );
114 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 116 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
115 qWarning("could not start sdptool" ); 117 qWarning("could not start sdptool" );
116 delete m_sdp; 118 delete m_sdp;
117 Services::ValueList list; 119 Services::ValueList list;
118 emit foundServices( remDevice, list ); 120 emit foundServices( remDevice, list );
119 } 121 }
120} 122}
121void Manager::searchServices( const RemoteDevice& dev){ 123void Manager::searchServices( const RemoteDevice& dev){
122 searchServices( dev.mac() ); 124 searchServices( dev.mac() );
123} 125}
124QString Manager::toDevice( const QString& /*mac*/ ){ 126QString Manager::toDevice( const QString& /*mac*/ ){
125 return QString::null; 127 return QString::null;
126} 128}
127QString Manager::toMac( const QString &/*device*/ ){ 129QString Manager::toMac( const QString &/*device*/ ){
128 return QString::null; 130 return QString::null;
@@ -233,35 +235,35 @@ RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) {
233 * cause hcitool gets reparented 235 * cause hcitool gets reparented
234 */ 236 */
235void Manager::connectTo( const QString& mac) { 237void Manager::connectTo( const QString& mac) {
236 OProcess proc; 238 OProcess proc;
237 proc << "hcitool"; 239 proc << "hcitool";
238 proc << "cc"; 240 proc << "cc";
239 proc << mac; 241 proc << mac;
240 proc.start(OProcess::DontCare); // the lib does not care at this point 242 proc.start(OProcess::DontCare); // the lib does not care at this point
241} 243}
242 244
243 245
244void Manager::searchConnections() { 246void Manager::searchConnections() {
245 qWarning("searching connections?"); 247 qWarning("searching connections?");
246 OProcess* proc = new OProcess(); 248 OProcess* proc = new OProcess();
247 m_hcitoolCon = QString::null; 249 m_hcitoolCon = QString::null;
248 250
249 connect(proc, SIGNAL(processExited(OProcess*) ), 251 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
250 this, SLOT(slotConnectionExited( OProcess*) ) ); 252 this, SLOT(slotConnectionExited( OProcess*) ) );
251 connect(proc, SIGNAL(receivedStdout(OProcess*, char*, int) ), 253 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
252 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) ); 254 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) );
253 *proc << "hcitool"; 255 *proc << "hcitool";
254 *proc << "con"; 256 *proc << "con";
255 257
256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 258 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
257 ConnectionState::ValueList list; 259 ConnectionState::ValueList list;
258 emit connections( list ); 260 emit connections( list );
259 delete proc; 261 delete proc;
260 } 262 }
261} 263}
262void Manager::slotConnectionExited( OProcess* proc ) { 264void Manager::slotConnectionExited( OProcess* proc ) {
263 ConnectionState::ValueList list; 265 ConnectionState::ValueList list;
264 list = parseConnections( m_hcitoolCon ); 266 list = parseConnections( m_hcitoolCon );
265 emit connections(list ); 267 emit connections(list );
266 delete proc; 268 delete proc;
267} 269}
@@ -292,35 +294,35 @@ ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
292 ConnectionState con; 294 ConnectionState con;
293 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); 295 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming );
294 con.setConnectionMode( value[1] ); 296 con.setConnectionMode( value[1] );
295 con.setMac( value[2] ); 297 con.setMac( value[2] );
296 con.setHandle( value[4].toInt() ); 298 con.setHandle( value[4].toInt() );
297 con.setState( value[6].toInt() ); 299 con.setState( value[6].toInt() );
298 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client ); 300 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client );
299 list2.append( con ); 301 list2.append( con );
300 } 302 }
301 return list2; 303 return list2;
302} 304}
303 305
304void Manager::signalStrength( const QString &mac ) { 306void Manager::signalStrength( const QString &mac ) {
305 307
306 OProcess* sig_proc = new OProcess(); 308 OProcess* sig_proc = new OProcess();
307 309
308 connect(sig_proc, SIGNAL(processExited(OProcess*) ), 310 connect(sig_proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
309 this, SLOT(slotSignalStrengthExited( OProcess*) ) ); 311 this, SLOT(slotSignalStrengthExited( OProcess*) ) );
310 connect(sig_proc, SIGNAL(receivedStdout(OProcess*, char*, int) ), 312 connect(sig_proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
311 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) ); 313 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) );
312 *sig_proc << "hcitool"; 314 *sig_proc << "hcitool";
313 *sig_proc << "lq"; 315 *sig_proc << "lq";
314 *sig_proc << mac; 316 *sig_proc << mac;
315 317
316 sig_proc->setName( mac.latin1() ); 318 sig_proc->setName( mac.latin1() );
317 319
318 if (!sig_proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 320 if (!sig_proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
319 emit signalStrength( mac, "-1" ); 321 emit signalStrength( mac, "-1" );
320 delete sig_proc; 322 delete sig_proc;
321 } 323 }
322} 324}
323 325
324void Manager::slotSignalStrengthOutput(OProcess* proc, char* cha, int len) { 326void Manager::slotSignalStrengthOutput(OProcess* proc, char* cha, int len) {
325 QCString str(cha, len ); 327 QCString str(cha, len );
326 QString temp = QString(str).stripWhiteSpace(); 328 QString temp = QString(str).stripWhiteSpace();
diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h
index abc8ba1..9b1c714 100644
--- a/noncore/net/opietooth/lib/manager.h
+++ b/noncore/net/opietooth/lib/manager.h
@@ -1,30 +1,30 @@
1 1
2#ifndef OpieToothManager_H 2#ifndef OpieToothManager_H
3#define OpieToothManager_H 3#define OpieToothManager_H
4 4
5#include <qobject.h> 5#include <qobject.h>
6#include <qstring.h> 6#include <qstring.h>
7#include <qmap.h> 7#include <qmap.h>
8#include <qvaluelist.h> 8#include <qvaluelist.h>
9 9
10#include "connection.h" 10#include "connection.h"
11#include "remotedevice.h" 11#include "remotedevice.h"
12#include "services.h" 12#include "services.h"
13 13
14class OProcess; 14namespace Opie {namespace Core {class Opie::Core::OProcess;}}
15namespace OpieTooth { 15namespace OpieTooth {
16 class Device; 16 class Device;
17 /** Manager manages a blueZ device (hci0 for example) 17 /** Manager manages a blueZ device (hci0 for example)
18 * without Manager you can control the things you 18 * without Manager you can control the things you
19 * could do from command line in a OO and asynchronus 19 * could do from command line in a OO and asynchronus
20 * way. 20 * way.
21 */ 21 */
22 class Manager : public QObject { 22 class Manager : public QObject {
23 Q_OBJECT 23 Q_OBJECT
24 public: 24 public:
25 /** c'tor whichs create a new Manager 25 /** c'tor whichs create a new Manager
26 * @param device is the device to use. Either a mac or blueZ device name 26 * @param device is the device to use. Either a mac or blueZ device name
27 * 27 *
28 */ 28 */
29 Manager( const QString &device ); 29 Manager( const QString &device );
30 30
@@ -129,45 +129,45 @@ namespace OpieTooth {
129 /*static*/ QString toDevice( const QString& mac ); 129 /*static*/ QString toDevice( const QString& mac );
130 /*static*/ QString toMac( const QString &device ); 130 /*static*/ QString toMac( const QString &device );
131//// not implemented yet over 131//// not implemented yet over
132 132
133 signals: 133 signals:
134 // device either mac or dev name 134 // device either mac or dev name
135 // the first device is the device which you access 135 // the first device is the device which you access
136 void available( const QString& device, bool connected ); 136 void available( const QString& device, bool connected );
137 void addedService( const QString& service, bool added ); 137 void addedService( const QString& service, bool added );
138 void removedService( const QString& service, bool removed ); 138 void removedService( const QString& service, bool removed );
139 void foundServices( const QString& device, Services::ValueList ); 139 void foundServices( const QString& device, Services::ValueList );
140 void foundDevices( const QString& device, RemoteDevice::ValueList ); 140 void foundDevices( const QString& device, RemoteDevice::ValueList );
141 void connections( ConnectionState::ValueList ); 141 void connections( ConnectionState::ValueList );
142 void signalStrength( const QString& mac, const QString& strengh ); 142 void signalStrength( const QString& mac, const QString& strengh );
143 143
144private slots: 144private slots:
145 void slotProcessExited(OProcess* ); 145 void slotProcessExited(Opie::Core::OProcess* );
146 146
147 void slotSDPExited(OProcess*); 147 void slotSDPExited(Opie::Core::OProcess*);
148 void slotSDPOut(OProcess*, char*, int); 148 void slotSDPOut(Opie::Core::OProcess*, char*, int);
149 149
150 void slotHCIExited(OProcess* ); 150 void slotHCIExited(Opie::Core::OProcess* );
151 void slotHCIOut(OProcess*, char*, int ); 151 void slotHCIOut(Opie::Core::OProcess*, char*, int );
152 152
153 void slotConnectionExited(OProcess* ); 153 void slotConnectionExited(Opie::Core::OProcess* );
154 void slotConnectionOutput(OProcess*, char*, int ); 154 void slotConnectionOutput(Opie::Core::OProcess*, char*, int );
155 155
156 void slotSignalStrengthOutput( OProcess*, char*, int ); 156 void slotSignalStrengthOutput( Opie::Core::OProcess*, char*, int );
157 void slotSignalStrengthExited( OProcess* ); 157 void slotSignalStrengthExited( Opie::Core::OProcess* );
158 private: 158 private:
159 Services::ValueList parseSDPOutput( const QString& ); 159 Services::ValueList parseSDPOutput( const QString& );
160 RemoteDevice::ValueList parseHCIOutput( const QString& ); 160 RemoteDevice::ValueList parseHCIOutput( const QString& );
161 ConnectionState::ValueList parseConnections( const QString& ); 161 ConnectionState::ValueList parseConnections( const QString& );
162 OProcess *m_hcitool; 162 Opie::Core::OProcess *m_hcitool;
163 OProcess *m_sdp; // not only one 163 Opie::Core::OProcess *m_sdp; // not only one
164 QString m_device; 164 QString m_device;
165 QMap<QString, int> m_signalStrength; 165 QMap<QString, int> m_signalStrength;
166 QMap<QString, QString> m_out; 166 QMap<QString, QString> m_out;
167 QMap<QString, QString> m_devices; 167 QMap<QString, QString> m_devices;
168 QMap<OProcess*, QString> m_signalMac; 168 QMap<Opie::Core::OProcess*, QString> m_signalMac;
169 QString m_hcitoolCon; 169 QString m_hcitoolCon;
170 }; 170 };
171}; 171};
172 172
173#endif 173#endif
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index c3850eb..90ef04a 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -1,22 +1,24 @@
1 1
2#include "startdunconnection.h" 2#include "startdunconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core;
8using namespace Opie::Core;
7StartDunConnection::StartDunConnection() { 9StartDunConnection::StartDunConnection() {
8 m_dunConnect = 0l; 10 m_dunConnect = 0l;
9 setConnectionType(); 11 setConnectionType();
10} 12}
11 13
12StartDunConnection::~StartDunConnection() { 14StartDunConnection::~StartDunConnection() {
13 delete m_dunConnect; 15 delete m_dunConnect;
14} 16}
15 17
16StartDunConnection::StartDunConnection( QString mac ) { 18StartDunConnection::StartDunConnection( QString mac ) {
17 m_dunConnect = 0l; 19 m_dunConnect = 0l;
18 m_mac = mac; 20 m_mac = mac;
19 setConnectionType(); 21 setConnectionType();
20} 22}
21 23
22void StartDunConnection::setName( QString name ) { 24void StartDunConnection::setName( QString name ) {
@@ -26,35 +28,35 @@ void StartDunConnection::setName( QString name ) {
26QString StartDunConnection::name() { 28QString StartDunConnection::name() {
27 return m_name; 29 return m_name;
28} 30}
29 31
30void StartDunConnection::setConnectionType() { 32void StartDunConnection::setConnectionType() {
31 m_connectionType = Pan; 33 m_connectionType = Pan;
32} 34}
33 35
34StartConnection::ConnectionType StartDunConnection::type() { 36StartConnection::ConnectionType StartDunConnection::type() {
35 return m_connectionType; 37 return m_connectionType;
36} 38}
37 39
38void StartDunConnection::start() { 40void StartDunConnection::start() {
39 m_dunConnect = new OProcess(); 41 m_dunConnect = new OProcess();
40 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; 42 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac;
41 43
42 connect( m_dunConnect, SIGNAL( processExited(OProcess*) ) , 44 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
43 this, SLOT( slotExited(OProcess*) ) ); 45 this, SLOT( slotExited(OProcess*) ) );
44 connect( m_dunConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ), 46 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
45 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 47 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
46 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 48 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
47 qWarning( "could not start" ); 49 qWarning( "could not start" );
48 delete m_dunConnect; 50 delete m_dunConnect;
49 } 51 }
50} 52}
51 53
52 54
53void StartDunConnection::slotExited( OProcess* proc ) { 55void StartDunConnection::slotExited( OProcess* proc ) {
54 delete m_dunConnect; 56 delete m_dunConnect;
55} 57}
56 58
57void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) 59void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len)
58{} 60{}
59 61
60 62
diff --git a/noncore/net/opietooth/lib/startdunconnection.h b/noncore/net/opietooth/lib/startdunconnection.h
index 43a852a..f6107f6 100644
--- a/noncore/net/opietooth/lib/startdunconnection.h
+++ b/noncore/net/opietooth/lib/startdunconnection.h
@@ -1,40 +1,40 @@
1#ifndef startdunconnection_h 1#ifndef startdunconnection_h
2#define startdunconnection_h 2#define startdunconnection_h
3 3
4#include <qobject.h> 4#include <qobject.h>
5#include "connection.h" 5#include "connection.h"
6#include <opie/oprocess.h> 6#include <opie2/oprocess.h>
7 7
8namespace OpieTooth { 8namespace OpieTooth {
9 9
10 class StartDunConnection : StartConnection { 10 class StartDunConnection : StartConnection {
11 11
12 Q_OBJECT 12 Q_OBJECT
13 13
14 public: 14 public:
15 StartDunConnection(); 15 StartDunConnection();
16 StartDunConnection( QString mac ); 16 StartDunConnection( QString mac );
17 ~StartDunConnection(); 17 ~StartDunConnection();
18 18
19 QString name(); 19 QString name();
20 void setName( QString name ); 20 void setName( QString name );
21 StartConnection::ConnectionType type(); 21 StartConnection::ConnectionType type();
22 void setConnectionType( ); 22 void setConnectionType( );
23 void start(); 23 void start();
24 void stop(); 24 void stop();
25 25
26 private: 26 private:
27 QString m_name; 27 QString m_name;
28 QString m_mac; 28 QString m_mac;
29 ConnectionType m_connectionType; 29 ConnectionType m_connectionType;
30 OProcess* m_dunConnect; 30 Opie::Core::OProcess* m_dunConnect;
31 31
32 private slots: 32 private slots:
33 void slotExited( OProcess* proc ); 33 void slotExited( Opie::Core::OProcess* proc );
34 void slotStdOut( OProcess* proc, char* chars, int len ); 34 void slotStdOut( Opie::Core::OProcess* proc, char* chars, int len );
35 }; 35 };
36 36
37 37
38} 38}
39 39
40#endif 40#endif
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index a42b407..fef35d9 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -1,22 +1,24 @@
1 1
2#include "startpanconnection.h" 2#include "startpanconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core;
8using namespace Opie::Core;
7StartPanConnection::StartPanConnection() { 9StartPanConnection::StartPanConnection() {
8 m_panConnect = 0l; 10 m_panConnect = 0l;
9 setConnectionType(); 11 setConnectionType();
10} 12}
11 13
12StartPanConnection::~StartPanConnection() { 14StartPanConnection::~StartPanConnection() {
13 delete m_panConnect; 15 delete m_panConnect;
14} 16}
15 17
16StartPanConnection::StartPanConnection( QString mac ) { 18StartPanConnection::StartPanConnection( QString mac ) {
17 m_panConnect = 0l; 19 m_panConnect = 0l;
18 m_mac = mac; 20 m_mac = mac;
19 setConnectionType(); 21 setConnectionType();
20} 22}
21 23
22void StartPanConnection::setName( QString name ) { 24void StartPanConnection::setName( QString name ) {
@@ -27,56 +29,56 @@ QString StartPanConnection::name() {
27 return m_name; 29 return m_name;
28} 30}
29 31
30void StartPanConnection::setConnectionType() { 32void StartPanConnection::setConnectionType() {
31 m_connectionType = Pan; 33 m_connectionType = Pan;
32} 34}
33 35
34StartConnection::ConnectionType StartPanConnection::type() { 36StartConnection::ConnectionType StartPanConnection::type() {
35 return m_connectionType; 37 return m_connectionType;
36} 38}
37 39
38void StartPanConnection::start() { 40void StartPanConnection::start() {
39 m_panConnect = new OProcess(); 41 m_panConnect = new OProcess();
40 qDebug( "IM START " + m_mac ); 42 qDebug( "IM START " + m_mac );
41 *m_panConnect << "pand" << "--connect" << m_mac; 43 *m_panConnect << "pand" << "--connect" << m_mac;
42 44
43 connect( m_panConnect, SIGNAL( processExited(OProcess*) ) , 45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
44 this, SLOT( slotExited(OProcess*) ) ); 46 this, SLOT( slotExited(OProcess*) ) );
45 connect( m_panConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ), 47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
46 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 48 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
47 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
48 qWarning( "could not start" ); 50 qWarning( "could not start" );
49 delete m_panConnect; 51 delete m_panConnect;
50 } 52 }
51} 53}
52 54
53 55
54void StartPanConnection::slotExited( OProcess* proc ) { 56void StartPanConnection::slotExited( OProcess* proc ) {
55 delete m_panConnect; 57 delete m_panConnect;
56 m_panConnect = 0l; 58 m_panConnect = 0l;
57} 59}
58 60
59void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) 61void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
60{} 62{}
61 63
62 64
63void StartPanConnection::stop() { 65void StartPanConnection::stop() {
64 if ( m_panConnect ) { 66 if ( m_panConnect ) {
65 delete m_panConnect; 67 delete m_panConnect;
66 m_panConnect = 0l; 68 m_panConnect = 0l;
67 } 69 }
68 m_panConnect = new OProcess(); 70 m_panConnect = new OProcess();
69 qDebug("IM STOP " + m_mac); 71 qDebug("IM STOP " + m_mac);
70 72
71 *m_panConnect << "pand" << "--kill" << m_mac; 73 *m_panConnect << "pand" << "--kill" << m_mac;
72 74
73 connect( m_panConnect, SIGNAL( processExited(OProcess*) ) , 75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
74 this, SLOT( slotExited(OProcess*) ) ); 76 this, SLOT( slotExited(OProcess*) ) );
75 connect( m_panConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ), 77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
76 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 78 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
77 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
78 qWarning( "could not stop" ); 80 qWarning( "could not stop" );
79 delete m_panConnect; 81 delete m_panConnect;
80 } 82 }
81} 83}
82 84
diff --git a/noncore/net/opietooth/lib/startpanconnection.h b/noncore/net/opietooth/lib/startpanconnection.h
index 7e5bd95..e12dad0 100644
--- a/noncore/net/opietooth/lib/startpanconnection.h
+++ b/noncore/net/opietooth/lib/startpanconnection.h
@@ -1,40 +1,40 @@
1#ifndef startpanconnection_h 1#ifndef startpanconnection_h
2#define startpanconnection_h 2#define startpanconnection_h
3 3
4#include <qobject.h> 4#include <qobject.h>
5#include "connection.h" 5#include "connection.h"
6#include <opie/oprocess.h> 6#include <opie2/oprocess.h>
7 7
8namespace OpieTooth { 8namespace OpieTooth {
9 9
10 class StartPanConnection : StartConnection { 10 class StartPanConnection : StartConnection {
11 11
12 Q_OBJECT 12 Q_OBJECT
13 13
14 public: 14 public:
15 StartPanConnection(); 15 StartPanConnection();
16 StartPanConnection( QString mac ); 16 StartPanConnection( QString mac );
17 ~StartPanConnection(); 17 ~StartPanConnection();
18 18
19 QString name(); 19 QString name();
20 void setName( QString name ); 20 void setName( QString name );
21 StartConnection::ConnectionType type(); 21 StartConnection::ConnectionType type();
22 void setConnectionType( ); 22 void setConnectionType( );
23 void start(); 23 void start();
24 void stop(); 24 void stop();
25 25
26 private: 26 private:
27 QString m_name; 27 QString m_name;
28 QString m_mac; 28 QString m_mac;
29 ConnectionType m_connectionType; 29 ConnectionType m_connectionType;
30 OProcess* m_panConnect; 30 Opie::Core::OProcess* m_panConnect;
31 31
32 private slots: 32 private slots:
33 void slotExited( OProcess* proc ); 33 void slotExited( Opie::Core::OProcess* proc );
34 void slotStdOut( OProcess* proc, char* chars, int len ); 34 void slotStdOut( Opie::Core::OProcess* proc, char* chars, int len );
35 }; 35 };
36 36
37 37
38} 38}
39 39
40#endif 40#endif
diff --git a/noncore/net/opietooth/manager/main.cpp b/noncore/net/opietooth/manager/main.cpp
index 82aeebd..a96f128 100644
--- a/noncore/net/opietooth/manager/main.cpp
+++ b/noncore/net/opietooth/manager/main.cpp
@@ -1,25 +1,27 @@
1/* 1/*
2using namespace Opie::Core;
3using namespace Opie::Core;
2 * main.cpp 4 * main.cpp
3 * 5 *
4 * --------------------- 6 * ---------------------
5 * 7 *
6 * begin : Sun 10 17:20:00 CEST 2002 8 * begin : Sun 10 17:20:00 CEST 2002
7 * copyright : (c) 2002 by Maximilian Reiß 9 * copyright : (c) 2002 by Maximilian Reiß
8 * email : max.reiss@gmx.de 10 * email : max.reiss@gmx.de
9 * 11 *
10 */ 12 */
11/*************************************************************************** 13/***************************************************************************
12 * * 14 * *
13 * This program is free software; you can redistribute it and/or modify * 15 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 16 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 17 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 18 * (at your option) any later version. *
17 * * 19 * *
18 ***************************************************************************/ 20 ***************************************************************************/
19 21
20#include "bluebase.h" 22#include "bluebase.h"
21#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
22#include <opie/oapplicationfactory.h> 24#include <opie2/oapplicationfactory.h>
23 25
24OPIE_EXPORT_APP( OApplicationFactory<OpieTooth::BlueBase> ) 26OPIE_EXPORT_APP( OApplicationFactory<OpieTooth::BlueBase> )
25 27
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 46a0e3d..1ef862a 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -1,32 +1,35 @@
1 1
2#include "obexdialog.h" 2#include "obexdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qfileinfo.h> 8#include <qfileinfo.h>
9 9
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12#include <opie/oprocess.h> 12#include <opie2/oprocess.h>
13#include <opie/ofiledialog.h> 13#include <opie2/ofiledialog.h>
14 14
15using namespace OpieTooth; 15using namespace OpieTooth;
16 16
17using namespace Opie::Core;
18using namespace Opie::Ui;
19using namespace Opie::Core;
17ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 20ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
18 : QDialog( parent, name, modal, fl ) { 21 : QDialog( parent, name, modal, fl ) {
19 22
20 if ( !name ) 23 if ( !name )
21 setName( "ObexDialog" ); 24 setName( "ObexDialog" );
22 setCaption( tr( "beam files " ) ) ; 25 setCaption( tr( "beam files " ) ) ;
23 26
24 m_device = device; 27 m_device = device;
25 28
26 layout = new QVBoxLayout( this ); 29 layout = new QVBoxLayout( this );
27 30
28 QLabel* info = new QLabel( this ); 31 QLabel* info = new QLabel( this );
29 info->setText( tr("Which file should be beamed?") ); 32 info->setText( tr("Which file should be beamed?") );
30 33
31 cmdLine = new QLineEdit( this ); 34 cmdLine = new QLineEdit( this );
32 35
diff --git a/noncore/net/opietooth/manager/obexdialog.h b/noncore/net/opietooth/manager/obexdialog.h
index b3d5e6d..d5b5682 100644
--- a/noncore/net/opietooth/manager/obexdialog.h
+++ b/noncore/net/opietooth/manager/obexdialog.h
@@ -1,22 +1,22 @@
1#ifndef OBEXDIALOG_H 1#ifndef OBEXDIALOG_H
2#define OBEXDIALOG_H 2#define OBEXDIALOG_H
3 3
4 4
5#include <qdialog.h> 5#include <qdialog.h>
6#include <opie/oprocess.h> 6#include <opie2/oprocess.h>
7 7
8class QVBoxLayout; 8class QVBoxLayout;
9class QPushButton; 9class QPushButton;
10class QMultiLineEdit; 10class QMultiLineEdit;
11class QLineEdit; 11class QLineEdit;
12 12
13 13
14namespace OpieTooth { 14namespace OpieTooth {
15 15
16 class ObexDialog : public QDialog { 16 class ObexDialog : public QDialog {
17 17
18 Q_OBJECT 18 Q_OBJECT
19 19
20 public: 20 public:
21 ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0); 21 ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0);
22 ~ObexDialog(); 22 ~ObexDialog();
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 4e58552..870e7fd 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -1,27 +1,29 @@
1 1
2#include "pppdialog.h" 2#include "pppdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <opie/oprocess.h> 8#include <opie2/oprocess.h>
9 9
10using namespace OpieTooth; 10using namespace OpieTooth;
11 11
12using namespace Opie::Core;
13using namespace Opie::Core;
12PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 14PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
13 : QDialog( parent, name, modal, fl ) { 15 : QDialog( parent, name, modal, fl ) {
14 16
15 if ( !name ) 17 if ( !name )
16 setName( "PPPDialog" ); 18 setName( "PPPDialog" );
17 setCaption( tr( "ppp connection " ) ) ; 19 setCaption( tr( "ppp connection " ) ) ;
18 20
19 m_device = device; 21 m_device = device;
20 22
21 layout = new QVBoxLayout( this ); 23 layout = new QVBoxLayout( this );
22 24
23 QLabel* info = new QLabel( this ); 25 QLabel* info = new QLabel( this );
24 info->setText( tr("Enter an ppp script name:") ); 26 info->setText( tr("Enter an ppp script name:") );
25 27
26 cmdLine = new QLineEdit( this ); 28 cmdLine = new QLineEdit( this );
27 29
@@ -39,30 +41,30 @@ PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl,
39 layout->addWidget(outPut); 41 layout->addWidget(outPut);
40 layout->addWidget(connectButton); 42 layout->addWidget(connectButton);
41 43
42 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); 44 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
43 45
44} 46}
45 47
46PPPDialog::~PPPDialog() { 48PPPDialog::~PPPDialog() {
47} 49}
48 50
49void PPPDialog::connectToDevice() { 51void PPPDialog::connectToDevice() {
50 outPut->clear(); 52 outPut->clear();
51 // vom popupmenu beziehen 53 // vom popupmenu beziehen
52 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 54 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
53 OProcess* pppDial = new OProcess(); 55 OProcess* pppDial = new OProcess();
54 *pppDial << "pppd" << m_device << "call" << connectScript; 56 *pppDial << "pppd" << m_device << "call" << connectScript;
55 connect( pppDial, SIGNAL(receivedStdout(OProcess*,char*,int) ), 57 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
56 this, SLOT(fillOutPut(OProcess*,char*,int) ) ); 58 this, SLOT(fillOutPut(OProcess*,char*,int) ) );
57 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 59 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
58 qWarning("could not start"); 60 qWarning("could not start");
59 delete pppDial; 61 delete pppDial;
60 } 62 }
61} 63}
62 64
63void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 65void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
64 QCString str(cha, len ); 66 QCString str(cha, len );
65 outPut->insertLine( str ); 67 outPut->insertLine( str );
66 delete pppDial; 68 delete pppDial;
67} 69}
68 70
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
index bb8b734..05894e2 100644
--- a/noncore/net/opietooth/manager/pppdialog.h
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -1,37 +1,37 @@
1#ifndef PPPDIALOG_H 1#ifndef PPPDIALOG_H
2#define PPPDIALOG_H 2#define PPPDIALOG_H
3 3
4 4
5#include <qdialog.h> 5#include <qdialog.h>
6#include <opie/oprocess.h> 6#include <opie2/oprocess.h>
7 7
8class QVBoxLayout; 8class QVBoxLayout;
9class QPushButton; 9class QPushButton;
10class QMultiLineEdit; 10class QMultiLineEdit;
11class QLineEdit; 11class QLineEdit;
12 12
13 13
14namespace OpieTooth { 14namespace OpieTooth {
15 15
16 class PPPDialog : public QDialog { 16 class PPPDialog : public QDialog {
17 17
18 Q_OBJECT 18 Q_OBJECT
19 19
20 public: 20 public:
21 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0); 21 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0);
22 ~PPPDialog(); 22 ~PPPDialog();
23 23
24 private slots: 24 private slots:
25 void connectToDevice(); 25 void connectToDevice();
26 void fillOutPut( OProcess* pppDial, char* cha, int len ); 26 void fillOutPut( Opie::Core::OProcess* pppDial, char* cha, int len );
27 protected: 27 protected:
28 QVBoxLayout* layout; 28 QVBoxLayout* layout;
29 QLineEdit* cmdLine; 29 QLineEdit* cmdLine;
30 QPushButton* connectButton; 30 QPushButton* connectButton;
31 QMultiLineEdit* outPut; 31 QMultiLineEdit* outPut;
32 32
33 private: 33 private:
34 QString m_device; 34 QString m_device;
35 }; 35 };
36} 36}
37#endif 37#endif
diff --git a/noncore/net/ubrowser/main.cpp b/noncore/net/ubrowser/main.cpp
index 0488cfd..0736f1f 100644
--- a/noncore/net/ubrowser/main.cpp
+++ b/noncore/net/ubrowser/main.cpp
@@ -5,20 +5,22 @@ Copyright (C) 2002 Thomas Stephens
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18 18
19#include "mainview.h" 19#include "mainview.h"
20 20
21#include <opie/oapplicationfactory.h> 21#include <opie2/oapplicationfactory.h>
22 22
23
24using namespace Opie::Core;
23OPIE_EXPORT_APP( OApplicationFactory<MainView> ) 25OPIE_EXPORT_APP( OApplicationFactory<MainView> )
24 26
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 95b03d0..da39113 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -30,32 +30,38 @@ using namespace Opie;
30#include <qapplication.h> 30#include <qapplication.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qcombobox.h> 32#include <qcombobox.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qmap.h> 36#include <qmap.h>
37#include <qpushbutton.h> 37#include <qpushbutton.h>
38#include <qtabwidget.h> 38#include <qtabwidget.h>
39#include <qtoolbutton.h> 39#include <qtoolbutton.h>
40#include <qspinbox.h> 40#include <qspinbox.h>
41#include <qtextstream.h> 41#include <qtextstream.h>
42 42
43/* POSIX */ 43/* POSIX */
44#include <assert.h> 44#include <assert.h>
45 45
46using namespace Opie::Core;
47using namespace Opie::Net;
48using namespace Opie::Core;
49using namespace Opie::Net;
50using namespace Opie::Core;
51using namespace Opie::Net;
46WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 52WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
47 53
48WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 54WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
49 :WellenreiterConfigBase( parent, name, true, f ) 55 :WellenreiterConfigBase( parent, name, true, f )
50{ 56{
51 _devicetype[ "cisco" ] = DEVTYPE_CISCO; 57 _devicetype[ "cisco" ] = DEVTYPE_CISCO;
52 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; 58 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG;
53 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; 59 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP;
54 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; 60 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO;
55 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; 61 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL;
56 _devicetype[ "<file>" ] = DEVTYPE_FILE; 62 _devicetype[ "<file>" ] = DEVTYPE_FILE;
57 63
58 // gather possible interface names from ONetwork 64 // gather possible interface names from ONetwork
59 ONetwork* net = ONetwork::instance(); 65 ONetwork* net = ONetwork::instance();
60 ONetwork::InterfaceIterator it = net->iterator(); 66 ONetwork::InterfaceIterator it = net->iterator();
61 while ( it.current() ) 67 while ( it.current() )
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 7dcc583..6bbc39b 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -16,32 +16,35 @@
16#include "mainwindow.h" 16#include "mainwindow.h"
17#ifdef QWS 17#ifdef QWS
18#include <opie2/oapplication.h> 18#include <opie2/oapplication.h>
19#include <opie2/oprocess.h> 19#include <opie2/oprocess.h>
20#else 20#else
21#include <qapplication.h> 21#include <qapplication.h>
22#endif 22#endif
23 23
24#include <qmessagebox.h> 24#include <qmessagebox.h>
25#include <qstringlist.h> 25#include <qstringlist.h>
26 26
27#include <errno.h> 27#include <errno.h>
28#include <signal.h> 28#include <signal.h>
29#include <string.h> 29#include <string.h>
30#include <unistd.h> 30#include <unistd.h>
31 31
32using namespace Opie::Core;
33using namespace Opie::Core;
34using namespace Opie::Core;
32int main( int argc, char **argv ) 35int main( int argc, char **argv )
33{ 36{
34 #ifdef QWS 37 #ifdef QWS
35 OApplication a( argc, argv, "Wellenreiter II" ); 38 OApplication a( argc, argv, "Wellenreiter II" );
36 #else 39 #else
37 QApplication a( argc, argv ); 40 QApplication a( argc, argv );
38 #endif 41 #endif
39 WellenreiterMainWindow* w = new WellenreiterMainWindow(); 42 WellenreiterMainWindow* w = new WellenreiterMainWindow();
40 #ifdef QWS 43 #ifdef QWS
41 a.showMainWidget( w ); 44 a.showMainWidget( w );
42 #else 45 #else
43 a.setMainWidget( w ); 46 a.setMainWidget( w );
44 w->setCaption( "Wellenreiter II" ); 47 w->setCaption( "Wellenreiter II" );
45 w->show(); 48 w->show();
46 #endif 49 #endif
47 50
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 5cc0daf..7add6cd 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -38,32 +38,37 @@
38#include <qtextstream.h> 38#include <qtextstream.h>
39#include <qtoolbutton.h> 39#include <qtoolbutton.h>
40#include <qwhatsthis.h> 40#include <qwhatsthis.h>
41 41
42#ifdef QWS 42#ifdef QWS
43#include <qpe/resource.h> 43#include <qpe/resource.h>
44#include <opie2/ofiledialog.h> 44#include <opie2/ofiledialog.h>
45using namespace Opie; 45using namespace Opie;
46#else 46#else
47#include "resource.h" 47#include "resource.h"
48#include <qapplication.h> 48#include <qapplication.h>
49#include <qfiledialog.h> 49#include <qfiledialog.h>
50#endif 50#endif
51 51
52#include <unistd.h> 52#include <unistd.h>
53 53
54using namespace Opie::Ui;
55using namespace Opie::Net;
56using namespace Opie::Ui;
57using namespace Opie::Net;
58using namespace Opie::Net;
54WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) 59WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
55 :QMainWindow( parent, name, f ) 60 :QMainWindow( parent, name, f )
56{ 61{
57 cw = new WellenreiterConfigWindow( this ); 62 cw = new WellenreiterConfigWindow( this );
58 mw = new Wellenreiter( this ); 63 mw = new Wellenreiter( this );
59 mw->setConfigWindow( cw ); 64 mw->setConfigWindow( cw );
60 setCentralWidget( mw ); 65 setCentralWidget( mw );
61 66
62 // setup application icon 67 // setup application icon
63 68
64 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); 69 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
65 #ifndef QWS 70 #ifndef QWS
66 setIconText( "Wellenreiter/X11" ); 71 setIconText( "Wellenreiter/X11" );
67 #endif 72 #endif
68 73
69 // setup tool buttons 74 // setup tool buttons
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp
index ef5d020..8312e71 100644
--- a/noncore/net/wellenreiter/gui/packetview.cpp
+++ b/noncore/net/wellenreiter/gui/packetview.cpp
@@ -12,32 +12,35 @@
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "packetview.h" 16#include "packetview.h"
17 17
18/* OPIE */ 18/* OPIE */
19#include <opie2/opcap.h> 19#include <opie2/opcap.h>
20 20
21/* QT */ 21/* QT */
22#include <qtextview.h> 22#include <qtextview.h>
23#include <qspinbox.h> 23#include <qspinbox.h>
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qlist.h> 26#include <qlist.h>
27 27
28using namespace Opie::Net;
29using namespace Opie::Net;
30using namespace Opie::Net;
28PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) 31PacketView::PacketView( QWidget * parent, const char * name, WFlags f )
29 :QFrame( parent, name, f ) 32 :QFrame( parent, name, f )
30{ 33{
31 _number = new QSpinBox( this ); 34 _number = new QSpinBox( this );
32 _number->setPrefix( "Packet # " ); 35 _number->setPrefix( "Packet # " );
33 _label = new QLabel( this ); 36 _label = new QLabel( this );
34 _label->setText( "eth0 2004/03/08 - 00:00:21" ); 37 _label->setText( "eth0 2004/03/08 - 00:00:21" );
35 _list = new QLabel( this ); 38 _list = new QLabel( this );
36 _hex = new QTextView( this ); 39 _hex = new QTextView( this );
37 40
38 QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 ); 41 QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 );
39 QHBoxLayout* hb = new QHBoxLayout( vb, 2 ); 42 QHBoxLayout* hb = new QHBoxLayout( vb, 2 );
40 hb->addWidget( _label ); 43 hb->addWidget( _label );
41 hb->addWidget( _number ); 44 hb->addWidget( _number );
42 vb->addWidget( _list ); 45 vb->addWidget( _list );
43 vb->addWidget( _hex ); 46 vb->addWidget( _hex );
diff --git a/noncore/net/wellenreiter/gui/packetview.h b/noncore/net/wellenreiter/gui/packetview.h
index b5f2b26..1ac19bb 100644
--- a/noncore/net/wellenreiter/gui/packetview.h
+++ b/noncore/net/wellenreiter/gui/packetview.h
@@ -10,40 +10,40 @@
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef PACKETVIEW_H 16#ifndef PACKETVIEW_H
17#define PACKETVIEW_H 17#define PACKETVIEW_H
18 18
19#include <qlist.h> 19#include <qlist.h>
20#include <qframe.h> 20#include <qframe.h>
21 21
22class QString; 22class QString;
23class QSpinBox; 23class QSpinBox;
24class QLabel; 24class QLabel;
25class QTextView; 25class QTextView;
26class OPacket; 26namespace Opie {namespace Net {class Opie::Net::OPacket;}}
27 27
28class PacketView: public QFrame 28class PacketView: public QFrame
29{ 29{
30 30
31 public: 31 public:
32 PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); 32 PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 );
33 33
34 void add( OPacket* p ); 34 void add( Opie::Net::OPacket* p );
35 const QString getLog() const; 35 const QString getLog() const;
36 void clear(); 36 void clear();
37 37
38 protected: 38 protected:
39 39
40 QSpinBox* _number; 40 QSpinBox* _number;
41 QLabel* _label; 41 QLabel* _label;
42 QLabel* _list; 42 QLabel* _list;
43 QTextView* _hex; 43 QTextView* _hex;
44 QList<OPacket> _packets; 44 QList<Opie::Net::OPacket> _packets;
45 45
46}; 46};
47 47
48#endif 48#endif
49 49
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 6005818..3b7120a 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -33,32 +33,38 @@
33#include "resource.h" 33#include "resource.h"
34#endif 34#endif
35 35
36const int col_type = 0; 36const int col_type = 0;
37const int col_essid = 0; 37const int col_essid = 0;
38const int col_sig = 1; 38const int col_sig = 1;
39const int col_ap = 2; 39const int col_ap = 2;
40const int col_channel = 3; 40const int col_channel = 3;
41const int col_wep = 4; 41const int col_wep = 4;
42const int col_traffic = 5; 42const int col_traffic = 5;
43const int col_ip = 6; 43const int col_ip = 6;
44const int col_manuf = 7; 44const int col_manuf = 7;
45const int col_firstseen = 8; 45const int col_firstseen = 8;
46const int col_lastseen = 9; 46const int col_lastseen = 9;
47const int col_location = 10; 47const int col_location = 10;
48 48
49using namespace Opie::Net;
50using namespace Opie::Ui;
51using namespace Opie::Net;
52using namespace Opie::Ui;
53using namespace Opie::Ui;
54using namespace Opie::Net;
49MScanListView::MScanListView( QWidget* parent, const char* name ) 55MScanListView::MScanListView( QWidget* parent, const char* name )
50 :OListView( parent, name ) 56 :OListView( parent, name )
51{ 57{
52 setFrameShape( QListView::StyledPanel ); 58 setFrameShape( QListView::StyledPanel );
53 setFrameShadow( QListView::Sunken ); 59 setFrameShadow( QListView::Sunken );
54 60
55 addColumn( tr( "Net/Station" ) ); 61 addColumn( tr( "Net/Station" ) );
56 setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); 62 setColumnAlignment( col_essid, AlignLeft || AlignVCenter );
57 addColumn( tr( "#" ) ); 63 addColumn( tr( "#" ) );
58 setColumnAlignment( col_sig, AlignCenter ); 64 setColumnAlignment( col_sig, AlignCenter );
59 addColumn( tr( "MAC" ) ); 65 addColumn( tr( "MAC" ) );
60 setColumnAlignment( col_ap, AlignCenter ); 66 setColumnAlignment( col_ap, AlignCenter );
61 addColumn( tr( "Chn" ) ); 67 addColumn( tr( "Chn" ) );
62 setColumnAlignment( col_channel, AlignCenter ); 68 setColumnAlignment( col_channel, AlignCenter );
63 addColumn( tr( "W" ) ); 69 addColumn( tr( "W" ) );
64 setColumnAlignment( col_wep, AlignCenter ); 70 setColumnAlignment( col_wep, AlignCenter );
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h
index ab870c2..6a80f70 100644
--- a/noncore/net/wellenreiter/gui/scanlist.h
+++ b/noncore/net/wellenreiter/gui/scanlist.h
@@ -15,69 +15,69 @@
15 15
16#ifndef SCANLIST_H 16#ifndef SCANLIST_H
17#define SCANLIST_H 17#define SCANLIST_H
18 18
19#include "gps.h" 19#include "gps.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/olistview.h> 22#include <opie2/olistview.h>
23#include <opie2/onetutils.h> 23#include <opie2/onetutils.h>
24 24
25/* QT */ 25/* QT */
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28class QString; 28class QString;
29class MScanListItem; 29class MScanListItem;
30 30
31class MScanListView: public OListView 31class MScanListView: public Opie::Ui::OListView
32{ 32{
33 Q_OBJECT 33 Q_OBJECT
34 34
35 public: 35 public:
36 MScanListView( QWidget* parent = 0, const char* name = 0 ); 36 MScanListView( QWidget* parent = 0, const char* name = 0 );
37 virtual ~MScanListView(); 37 virtual ~MScanListView();
38 38
39 virtual OListViewItem* childFactory(); 39 virtual Opie::Ui::OListViewItem* childFactory();
40 virtual void serializeTo( QDataStream& s ) const; 40 virtual void serializeTo( QDataStream& s ) const;
41 virtual void serializeFrom( QDataStream& s ); 41 virtual void serializeFrom( QDataStream& s );
42 42
43 public slots: 43 public slots:
44 void addNewItem( const QString& type, const QString&, const OMacAddress&, bool, int, int, const GpsLocation&, bool = false ); 44 void addNewItem( const QString& type, const QString&, const Opie::Net::OMacAddress&, bool, int, int, const GpsLocation&, bool = false );
45 void addService( const QString& name, const OMacAddress& macaddr, const QString& ip ); 45 void addService( const QString& name, const Opie::Net::OMacAddress& macaddr, const QString& ip );
46 46
47 void fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 47 void fromDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
48 void toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 48 void toDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
49 void WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ); 49 void WDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& viaFrom, const Opie::Net::OMacAddress& viaTo );
50 void IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 50 void IBSStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
51 51
52 void identify( const OMacAddress&, const QString& ipaddr ); 52 void identify( const Opie::Net::OMacAddress&, const QString& ipaddr );
53 53
54 void contextMenuRequested( QListViewItem* item, const QPoint&, int ); 54 void contextMenuRequested( QListViewItem* item, const QPoint&, int );
55 55
56 signals: 56 signals:
57 void rightButtonClicked(QListViewItem*,const QPoint&,int); 57 void rightButtonClicked(QListViewItem*,const QPoint&,int);
58 void joinNetwork( const QString&, const QString&, int, const QString& ); 58 void joinNetwork( const QString&, const QString&, int, const QString& );
59 59
60 protected: 60 protected:
61 void addIfNotExisting( MScanListItem* parent, const OMacAddress& addr, const QString& type = "station" ); 61 void addIfNotExisting( MScanListItem* parent, const Opie::Net::OMacAddress& addr, const QString& type = "station" );
62 62
63}; 63};
64 64
65//****************************** MScanListItem **************************************************************** 65//****************************** MScanListItem ****************************************************************
66 66
67class MScanListItem: public OListViewItem 67class MScanListItem: public Opie::Ui::OListViewItem
68{ 68{
69 public: 69 public:
70 MScanListItem::MScanListItem( QListView* parent, 70 MScanListItem::MScanListItem( QListView* parent,
71 const QString& type = "unknown", 71 const QString& type = "unknown",
72 const QString& essid = "unknown", 72 const QString& essid = "unknown",
73 const QString& macaddr = "unknown", 73 const QString& macaddr = "unknown",
74 bool wep = false, 74 bool wep = false,
75 int channel = 0, 75 int channel = 0,
76 int signal = 0, 76 int signal = 0,
77 bool probed = false ); 77 bool probed = false );
78 78
79 MScanListItem::MScanListItem( QListViewItem* parent, 79 MScanListItem::MScanListItem( QListViewItem* parent,
80 const QString& type = "unknown", 80 const QString& type = "unknown",
81 const QString& essid = "unknown", 81 const QString& essid = "unknown",
82 const QString& macaddr = "unknown", 82 const QString& macaddr = "unknown",
83 bool wep = false, 83 bool wep = false,
@@ -93,48 +93,48 @@ class MScanListItem: public OListViewItem
93 93
94 public: 94 public:
95 //const QString& type() { return _type; }; 95 //const QString& type() { return _type; };
96 const QString& essid() const; 96 const QString& essid() const;
97 const QString& macaddr() { return _macaddr; }; 97 const QString& macaddr() { return _macaddr; };
98 bool wep() { return _wep; }; 98 bool wep() { return _wep; };
99 int channel() { return _channel; }; 99 int channel() { return _channel; };
100 int signal() { return _signal; }; 100 int signal() { return _signal; };
101 int beacons() { return _beacons; }; 101 int beacons() { return _beacons; };
102 102
103 void setSignal( int signal ) { /* TODO */ }; 103 void setSignal( int signal ) { /* TODO */ };
104 void receivedBeacon(); 104 void receivedBeacon();
105 105
106 void setManufacturer( const QString& manufacturer ); 106 void setManufacturer( const QString& manufacturer );
107 void setLocation( const QString& location ); 107 void setLocation( const QString& location );
108 108
109 virtual OListViewItem* childFactory(); 109 virtual Opie::Ui::OListViewItem* childFactory();
110 virtual void serializeTo( QDataStream& s ) const; 110 virtual void serializeTo( QDataStream& s ) const;
111 virtual void serializeFrom( QDataStream& s ); 111 virtual void serializeFrom( QDataStream& s );
112 112
113 private: 113 private:
114 QString _type; 114 QString _type;
115 QString _essid; 115 QString _essid;
116 QString _macaddr; 116 QString _macaddr;
117 bool _wep; 117 bool _wep;
118 int _channel; 118 int _channel;
119 int _signal; 119 int _signal;
120 int _beacons; 120 int _beacons;
121 121
122}; 122};
123 123
124//****************************** MScanListViewFactory **************************************************************** 124//****************************** MScanListViewFactory ****************************************************************
125 125
126/* 126/*
127 127
128class MScanListViewFactory : public OListViewFactory 128class MScanListViewFactory : public Opie::Ui::OListViewFactory
129{ 129{
130public: 130public:
131 virtual QListView* listViewFactory(); 131 virtual QListView* listViewFactory();
132 virtual QListViewItem* listViewItemFactory( QListView* lv ); 132 virtual QListViewItem* listViewItemFactory( QListView* lv );
133 virtual QListViewItem* listViewItemFactory( QListViewItem* lvi ); 133 virtual QListViewItem* listViewItemFactory( QListViewItem* lvi );
134 virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text ); 134 virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text );
135 virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text ); 135 virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text );
136} 136}
137*/ 137*/
138 138
139#endif 139#endif
140 140
diff --git a/noncore/net/wellenreiter/gui/statwindow.cpp b/noncore/net/wellenreiter/gui/statwindow.cpp
index 48e4847..e3c6bbe 100644
--- a/noncore/net/wellenreiter/gui/statwindow.cpp
+++ b/noncore/net/wellenreiter/gui/statwindow.cpp
@@ -3,32 +3,35 @@
3** 3**
4** This file is part of Wellenreiter II. 4** This file is part of Wellenreiter II.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "statwindow.h" 16#include "statwindow.h"
17#include <opie2/olistview.h> 17#include <opie2/olistview.h>
18 18
19using namespace Opie::Ui;
20using namespace Opie::Ui;
21using namespace Opie::Ui;
19MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) 22MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f )
20 :QVBox( parent, name, f ) 23 :QVBox( parent, name, f )
21{ 24{
22 table = new OListView( this ); 25 table = new OListView( this );
23 table->addColumn( tr( "Protocol" ) ); 26 table->addColumn( tr( "Protocol" ) );
24 table->addColumn( tr( "Count" ) ); 27 table->addColumn( tr( "Count" ) );
25 table->setItemMargin( 2 ); 28 table->setItemMargin( 2 );
26}; 29};
27 30
28 31
29void MStatWindow::updateCounter( const QString& protocol, int counter ) 32void MStatWindow::updateCounter( const QString& protocol, int counter )
30{ 33{
31 QListViewItemIterator it( table ); 34 QListViewItemIterator it( table );
32 for ( ; it.current(); ++it ) 35 for ( ; it.current(); ++it )
33 { 36 {
34 if ( it.current()->text( 0 ) == protocol ) 37 if ( it.current()->text( 0 ) == protocol )
diff --git a/noncore/net/wellenreiter/gui/statwindow.h b/noncore/net/wellenreiter/gui/statwindow.h
index b9057e7..e11247b 100644
--- a/noncore/net/wellenreiter/gui/statwindow.h
+++ b/noncore/net/wellenreiter/gui/statwindow.h
@@ -6,38 +6,38 @@
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef STATWINDOW_H 16#ifndef STATWINDOW_H
17#define STATWINDOW_H 17#define STATWINDOW_H
18 18
19#include <qvbox.h> 19#include <qvbox.h>
20 20
21class QString; 21class QString;
22class OListView; 22namespace Opie {namespace Ui {class Opie::Ui::OListView;}}
23 23
24class MStatWindow: public QVBox 24class MStatWindow: public QVBox
25{ 25{
26 Q_OBJECT 26 Q_OBJECT
27 27
28 public: 28 public:
29 MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 ); 29 MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 );
30 30
31 void log( QString text ); 31 void log( QString text );
32 const QString getLog() const; 32 const QString getLog() const;
33 void clear(); 33 void clear();
34 34
35 void updateCounter( const QString&, int ); 35 void updateCounter( const QString&, int );
36 36
37 protected: 37 protected:
38 OListView* table; 38 Opie::Ui::OListView* table;
39 39
40}; 40};
41 41
42#endif 42#endif
43 43
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index ce416e5..e8d9de7 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -48,32 +48,38 @@ using namespace Opie;
48#include <qobjectlist.h> 48#include <qobjectlist.h>
49#include <qregexp.h> 49#include <qregexp.h>
50#include <qspinbox.h> 50#include <qspinbox.h>
51#include <qtimer.h> 51#include <qtimer.h>
52#include <qtoolbutton.h> 52#include <qtoolbutton.h>
53#include <qmainwindow.h> 53#include <qmainwindow.h>
54 54
55// Standard 55// Standard
56 56
57#include <assert.h> 57#include <assert.h>
58#include <errno.h> 58#include <errno.h>
59#include <unistd.h> 59#include <unistd.h>
60#include <string.h> 60#include <string.h>
61#include <sys/types.h> 61#include <sys/types.h>
62#include <stdlib.h> 62#include <stdlib.h>
63 63
64using namespace Opie::Core;
65using namespace Opie::Net;
66using namespace Opie::Net;
67using namespace Opie::Core;
68using namespace Opie::Net;
69using namespace Opie::Core;
64Wellenreiter::Wellenreiter( QWidget* parent ) 70Wellenreiter::Wellenreiter( QWidget* parent )
65 : WellenreiterBase( parent, 0, 0 ), 71 : WellenreiterBase( parent, 0, 0 ),
66 sniffing( false ), iface( 0 ), configwindow( 0 ) 72 sniffing( false ), iface( 0 ), configwindow( 0 )
67{ 73{
68 74
69 logwindow->log( "(i) Wellenreiter has been started." ); 75 logwindow->log( "(i) Wellenreiter has been started." );
70 76
71 // 77 //
72 // detect operating system 78 // detect operating system
73 // 79 //
74 80
75 #ifdef QWS 81 #ifdef QWS
76 QString sys; 82 QString sys;
77 sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); 83 sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() );
78 _system = ODevice::inst()->system(); 84 _system = ODevice::inst()->system();
79 logwindow->log( sys ); 85 logwindow->log( sys );
@@ -433,33 +439,33 @@ void Wellenreiter::receivePacket( OPacket* p )
433 // check for a ip frame 439 // check for a ip frame
434 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); 440 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) );
435 if ( ip ) 441 if ( ip )
436 { 442 {
437 handleIPData( p, ip, source, dest ); 443 handleIPData( p, ip, source, dest );
438 } 444 }
439 445
440 //handleNotification( p ); 446 //handleNotification( p );
441 447
442} 448}
443 449
444 450
445void Wellenreiter::stopClicked() 451void Wellenreiter::stopClicked()
446{ 452{
447 if ( iface ) 453 if ( iface )
448 { 454 {
449 disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 455 disconnect( SIGNAL( receivedPacket(Opie::Net::OPacket*) ), this, SLOT( receivePacket(Opie::Net::OPacket*) ) );
450 disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); 456 disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
451 iface->setChannelHopping(); // stop hopping channels 457 iface->setChannelHopping(); // stop hopping channels
452 } 458 }
453 else 459 else
454 killTimers(); 460 killTimers();
455 461
456 pcap->close(); 462 pcap->close();
457 sniffing = false; 463 sniffing = false;
458 464
459 if ( iface ) 465 if ( iface )
460 { 466 {
461 // switch off monitor mode 467 // switch off monitor mode
462 iface->setMode( "managed" ); 468 iface->setMode( "managed" );
463 // switch off promisc flag 469 // switch off promisc flag
464 iface->setPromiscuousMode( false ); 470 iface->setPromiscuousMode( false );
465 471
@@ -598,33 +604,33 @@ void Wellenreiter::startClicked()
598 return; 604 return;
599 } 605 }
600 606
601 // set capturer to non-blocking mode 607 // set capturer to non-blocking mode
602 pcap->setBlocking( false ); 608 pcap->setBlocking( false );
603 609
604 // start channel hopper 610 // start channel hopper
605 if ( cardtype != DEVTYPE_FILE ) 611 if ( cardtype != DEVTYPE_FILE )
606 { 612 {
607 logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) ); 613 logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) );
608 iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window 614 iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window
609 } 615 }
610 616
611 if ( cardtype != DEVTYPE_FILE ) 617 if ( cardtype != DEVTYPE_FILE )
612 { 618 {
613 // connect socket notifier and start channel hopper 619 // connect socket notifier and start channel hopper
614 connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 620 connect( pcap, SIGNAL( receivedPacket(Opie::Net::OPacket*) ), this, SLOT( receivePacket(Opie::Net::OPacket*) ) );
615 connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); 621 connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
616 } 622 }
617 else 623 else
618 { 624 {
619 // start timer for reading packets 625 // start timer for reading packets
620 startTimer( 100 ); 626 startTimer( 100 );
621 } 627 }
622 628
623 logwindow->log( "(i) Started Scanning." ); 629 logwindow->log( "(i) Started Scanning." );
624 sniffing = true; 630 sniffing = true;
625 631
626 #ifdef QWS 632 #ifdef QWS
627 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) 633 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() )
628 { 634 {
629 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; 635 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
630 } 636 }
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index d02813b..83299c9 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -5,103 +5,103 @@
5** GNU General Public License version 2 as published by the Free Software 5** GNU General Public License version 2 as published by the Free Software
6** Foundation and appearing in the file LICENSE.GPL included in the 6** Foundation and appearing in the file LICENSE.GPL included in the
7** packaging of this file. 7** packaging of this file.
8** 8**
9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11** 11**
12**********************************************************************/ 12**********************************************************************/
13 13
14#ifndef WELLENREITER_H 14#ifndef WELLENREITER_H
15#define WELLENREITER_H 15#define WELLENREITER_H
16 16
17#include "wellenreiterbase.h" 17#include "wellenreiterbase.h"
18 18
19#ifdef QWS 19#ifdef QWS
20#include <opie2/odevice.h> 20#include <opie2/odevice.h>
21using namespace Opie;
22#endif 21#endif
23 22
24class QTimerEvent; 23class QTimerEvent;
25class QPixmap; 24class QPixmap;
26class OPacket; 25namespace Opie {namespace Net {class Opie::Net::OPacket;}}
27class OWaveLanManagementPacket; 26namespace Opie {namespace Net {class Opie::Net::OWaveLanManagementPacket;}}
28class OWaveLanControlPacket; 27namespace Opie {namespace Net {class Opie::Net::OWaveLanControlPacket;}}
29class OWaveLanDataPacket; 28namespace Opie {namespace Net {class Opie::Net::OWaveLanDataPacket;}}
30class OEthernetPacket; 29namespace Opie {namespace Net {class Opie::Net::OEthernetPacket;}}
31class OARPPacket; 30namespace Opie {namespace Net {class Opie::Net::OARPPacket;}}
32class OMacAddress; 31namespace Opie {namespace Net {class Opie::Net::OMacAddress;}}
33class OIPPacket; 32namespace Opie {namespace Net {class Opie::Net::OIPPacket;}}
34class OPacketCapturer; 33namespace Opie {namespace Net {class Opie::Net::OPacket;}}
35class OWirelessNetworkInterface; 34namespace Opie {namespace Net {class Opie::Net::OWirelessNetworkInterface;}}
35namespace Opie {namespace Net {class Opie::Net::OPacketCapturer;}}
36class PacketView; 36class PacketView;
37class WellenreiterConfigWindow; 37class WellenreiterConfigWindow;
38class MLogWindow; 38class MLogWindow;
39class GPS; 39class GPS;
40 40
41class Wellenreiter : public WellenreiterBase { 41class Wellenreiter : public WellenreiterBase {
42 Q_OBJECT 42 Q_OBJECT
43 43
44 public: 44 public:
45 Wellenreiter( QWidget* parent = 0 ); 45 Wellenreiter( QWidget* parent = 0 );
46 ~Wellenreiter(); 46 ~Wellenreiter();
47 47
48 void setConfigWindow( WellenreiterConfigWindow* cw ); 48 void setConfigWindow( WellenreiterConfigWindow* cw );
49 MScanListView* netView() const { return netview; }; 49 MScanListView* netView() const { return netview; };
50 MLogWindow* logWindow() const { return logwindow; }; 50 MLogWindow* logWindow() const { return logwindow; };
51 PacketView* hexWindow() const { return hexwindow; }; 51 PacketView* hexWindow() const { return hexwindow; };
52 bool isDaemonRunning() const { return sniffing; }; 52 bool isDaemonRunning() const { return sniffing; };
53 QString captureFileName() const { return dumpname; }; 53 QString captureFileName() const { return dumpname; };
54 54
55 public: 55 public:
56 bool sniffing; 56 bool sniffing;
57 57
58 protected: 58 protected:
59 virtual void timerEvent( QTimerEvent* ); 59 virtual void timerEvent( QTimerEvent* );
60 60
61 public slots: 61 public slots:
62 void initialTimer(); 62 void initialTimer();
63 63
64 void channelHopped(int); 64 void channelHopped(int);
65 void receivePacket(OPacket*); 65 void receivePacket(Opie::Net::OPacket*);
66 void startClicked(); 66 void startClicked();
67 void stopClicked(); 67 void stopClicked();
68 68
69 void joinNetwork(const QString&,const QString&,int,const QString&); 69 void joinNetwork(const QString&,const QString&,int,const QString&);
70 70
71 signals: 71 signals:
72 void startedSniffing(); 72 void startedSniffing();
73 void stoppedSniffing(); 73 void stoppedSniffing();
74 74
75 private: 75 private:
76 void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* ); 76 void handleManagementFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
77 void handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* ); 77 void handleManagementFrameBeacon( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
78 void handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* ); 78 void handleManagementFrameProbeRequest( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
79 void handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* ); 79 void handleManagementFrameProbeResponse( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
80 void handleControlFrame( OPacket* p, OWaveLanControlPacket* control ); 80 void handleControlFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanControlPacket* control );
81 void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); 81 void handleWlanData( Opie::Net::OPacket* p, Opie::Net::OWaveLanDataPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
82 void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ); 82 void handleEthernetData( Opie::Net::OPacket* p, Opie::Net::OEthernetPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
83 void handleARPData( OPacket* p, OARPPacket* arp, OMacAddress& from, OMacAddress& to ); 83 void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
84 void handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& from, OMacAddress& to ); 84 void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
85 void handleNotification( OPacket* p ); 85 void handleNotification( Opie::Net::OPacket* p );
86 void doAction( const QString& action, const QString& protocol, OPacket* p ); 86 void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p );
87 QObject* childIfToParse( OPacket* p, const QString& protocol ); 87 QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol );
88 bool checkDumpPacket( OPacket* p ); 88 bool checkDumpPacket( Opie::Net::OPacket* p );
89 89
90 private: 90 private:
91 #ifdef QWS 91 #ifdef QWS
92 OSystem _system; // Opie Operating System identifier 92 Opie::Core::OSystem _system; // Opie Operating System identifier
93 #endif 93 #endif
94 94
95 QString dumpname; 95 QString dumpname;
96 OWirelessNetworkInterface* iface; 96 Opie::Net::OWirelessNetworkInterface* iface;
97 OPacketCapturer* pcap; 97 Opie::Net::OPacketCapturer* pcap;
98 WellenreiterConfigWindow* configwindow; 98 WellenreiterConfigWindow* configwindow;
99 GPS* gps; 99 GPS* gps;
100 100
101 //void readConfig(); 101 //void readConfig();
102 //void writeConfig(); 102 //void writeConfig();
103}; 103};
104 104
105 105
106 106
107#endif 107#endif
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
index 3d0595d..f035e89 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
@@ -25,32 +25,35 @@
25#include "graphwindow.h" 25#include "graphwindow.h"
26 26
27#ifdef QWS 27#ifdef QWS
28#include <qpe/resource.h> 28#include <qpe/resource.h>
29#include <opie2/otabwidget.h> 29#include <opie2/otabwidget.h>
30using namespace Opie; 30using namespace Opie;
31#else 31#else
32#include "resource.h" 32#include "resource.h"
33#include <qtabwidget.h> 33#include <qtabwidget.h>
34#endif 34#endif
35 35
36 36
37/* 37/*
38 * Constructs a WellenreiterBase which is a child of 'parent', with the 38 * Constructs a WellenreiterBase which is a child of 'parent', with the
39 * name 'name' and widget flags set to 'f' 39 * name 'name' and widget flags set to 'f'
40 */ 40 */
41using namespace Opie::Ui;
42using namespace Opie::Ui;
43using namespace Opie::Ui;
41WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) 44WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl )
42 : QWidget( parent, name, fl ) 45 : QWidget( parent, name, fl )
43{ 46{
44 //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); 47 //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) );
45 //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); 48 //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) );
46 //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); 49 //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) );
47 //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); 50 //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) );
48 51
49 if ( !name ) 52 if ( !name )
50 setName( "WellenreiterBase" ); 53 setName( "WellenreiterBase" );
51 resize( 191, 294 ); 54 resize( 191, 294 );
52#ifdef QWS 55#ifdef QWS
53 setCaption( tr( "Wellenreiter/Opie" ) ); 56 setCaption( tr( "Wellenreiter/Opie" ) );
54#else 57#else
55 setCaption( tr( "Wellenreiter/X11" ) ); 58 setCaption( tr( "Wellenreiter/X11" ) );
56#endif 59#endif
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h
index 126aad2..e40b699 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.h
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h
@@ -33,33 +33,33 @@ class PacketView;
33#ifdef QWS 33#ifdef QWS
34#include <opie2/otabwidget.h> 34#include <opie2/otabwidget.h>
35using namespace Opie; 35using namespace Opie;
36#else 36#else
37class QTabWidget; 37class QTabWidget;
38#endif 38#endif
39 39
40class WellenreiterBase : public QWidget 40class WellenreiterBase : public QWidget
41{ 41{
42 Q_OBJECT 42 Q_OBJECT
43 43
44public: 44public:
45 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 45 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
46 ~WellenreiterBase(); 46 ~WellenreiterBase();
47 47
48#ifdef QWS 48#ifdef QWS
49 OTabWidget* TabWidget; 49 Opie::Ui::OTabWidget* TabWidget;
50#else 50#else
51 QTabWidget* TabWidget; 51 QTabWidget* TabWidget;
52#endif 52#endif
53 QWidget* ap; 53 QWidget* ap;
54 MScanListView* netview; 54 MScanListView* netview;
55 MLogWindow* logwindow; 55 MLogWindow* logwindow;
56 PacketView* hexwindow; 56 PacketView* hexwindow;
57 MStatWindow* statwindow; 57 MStatWindow* statwindow;
58 MGraphWindow* graphwindow; 58 MGraphWindow* graphwindow;
59 QWidget* about; 59 QWidget* about;
60 QLabel* PixmapLabel1_3_2; 60 QLabel* PixmapLabel1_3_2;
61 QLabel* TextLabel1_4_2; 61 QLabel* TextLabel1_4_2;
62 62
63protected: 63protected:
64 QVBoxLayout* WellenreiterBaseLayout; 64 QVBoxLayout* WellenreiterBaseLayout;
65 QVBoxLayout* apLayout; 65 QVBoxLayout* apLayout;