summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-12-04 22:11:00 (UTC)
committer zautrix <zautrix>2004-12-04 22:11:00 (UTC)
commitac994c86c3037dbe2273e62c46115b942b09fdcc (patch) (side-by-side diff)
tree5c33da571f716ff91f300cf26ebf619d43a03fdc
parent9c7f3267a1d7db2dbc3bd6384e75cf8ffea1c3df (diff)
downloadkdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.zip
kdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.tar.gz
kdepimpi-ac994c86c3037dbe2273e62c46115b942b09fdcc.tar.bz2
ompi fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 4fff7e1..6be5222 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,413 +1,417 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 1.9.14 ************
Fixed some problems with the dialog sizes when switching
portrait/landscape mode on 640x480 PDA display.
Fixed some other small bugs.
Fixed an ugly bug in KOpieMail:
KOpieMail was not able to write files (mails) to MSDOS file system,
like on an usual preformatted SD card. That should work now.
To save your mail data on the Sd card do the following:
Create a dir on the SD card:
mkdir /mnt/card/localmail
Go to your home dir:
cd
Go to kopiemail data storage dir:
cd kdepim/apps/kopiemail
Create a symlink to the SD card:
ls -s /mnt/card/localmail
Now KOpieMail will store all mails on the SD card.
KO/Pi Monthview:
Now "Go to Today" selects the current month from day 1-end,
not the current date + some days.
I.e. "Go to Today" shows now always
the current month with first day of month in the first row.
+Added missing German translation.
+
+Fixed icons of executeable on Wintendo.
+
********** VERSION 1.9.13 ************
Fixed nasty PwM/Pi file reading bug, when
the used hash algo of file is different then the global
hash algo.
Added KA/Pi support for opie mailit mailapplication.
Fixed some bugs in OM/Pi.
Now character conversion tables are available for the Zaurus
to make OM/Pi working properly.
To get the character conversion in OM/Pi working, please download
at the sourceforge project site the package
sr-character-conversion_SharpROM_arm.ipk.zip
(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
from the section "general files for KDE/Pim"
Instructions how to install this package are in a ReadMe in this file.
Fixed the orientation change problem in KA/Pi when switching
portrait/landscape mode.
French translation available for KA/Pi and OM/Pi.
Fixed some problems with categories in KO/Pi in DTM sync.
Added selection dialog for export to phone in KA/Pi.
If in KO/Pi is an attendee selected to add to a meeting and this
attendee is already in the list of attendees, this person is not added
again.
Some menu cleanup in KA/Pi.
********** VERSION 1.9.12 ************
Fix for the bug in KO/Pi What's Next view of version 1.9.11.
Bugfix: Licence file is now shown again.
OM/Pi now supports Unicode (utf8 charset).
Fixed some bugs in OM/Pi.
KA/Pi has more German translation.
********** VERSION 1.9.11 ************
Fixed several problems in PWM/Pi, like
asking the user, if unsaved changed are pending
when closing the app.
And PwM/Pi handles now different texts for the
fields Description, Username, Password, configurable per category.
Fixed a crash in KO/Pi , when importing/loading vcs files
which have an entry with an attendee with state:
NEEDS ACTION
Fixed some problems in the German translation of OM/Pi,
which makes some dialogs not fitting on the screen
of the Z 5500.
Fixed Qtopia crash, when disabling/deinstalling
KO/Pi alarm applet.
Implemented direct KDE<->KA/Pi sync for KA/Pi running
on Linux desktop.
Added feature "remove sync info" to sync menu.
Tweaked the KO/Pi What's next view a bit, added
setting to hide events that are done.
Disabled "beam receive enabled" on startup to
avoid problems if Fastload is enabled.
Please set "beam receive enabled",
if you want to receive data via IR.
Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
on Linux desktop.
Made in KA/Pi scrolling possible, if details view is selected.
(The keyboard focus is set automatically to the search line)
Fixed a bug in DMT sync, that a new entry in DTM was added
on every sync to Kx/Pi.
Fixed missing writing of KA/Pi categories to DMT entries when syncing.
Fixed a bug in DMT sync with todos created in KO/Pi containing
non-latin1 characters.
Rearranged package contents of Sharp-ipks and made all
packages installable on SD again.
Fixed the writing of addressbook data in DTM sync.
Empty fields in KA/Pi were not removed.
Added better category handling in KA/Pi:
Added item
Edit Categories and
Manage new categories
to the settings menu.
Possible to configure a view to display categories.
Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
Fixed displaying of "free" days and time in KO Monthview and Agendaview.
... and many other bugfixes.
********** VERSION 1.9.10 ************
Many internal small bugfixes.
And fix of the "big" bug in KO/Pi,
that after Syncing the appointments had an offset by several hours.
That was a problem with the internal timezone setting,
introduced by the changed timezone configuration settings.
German translation for OM/Pi is now available.
********** VERSION 1.9.9 ************
KDE-Pim/Pi has a new Member!
It is called PWM/Pi (Passwordmanager/platform-independent)
and it is available for the Zaurus.
It is planned, that it will be available later for Windows.
(And for Linux, of course).
It is a port of the Passwordmanager of KDE.
It will need the MicroKDElibs to run.
Made loading of addressbooks in KA/Pi up to 7 times faster!
The bigger your addressbook file, the more starting speed
will you gain. (relatively)
The Qtopia addressbook connector is now platform independend
as well and should work on any platform for importing/exporting
Qtopia and Opie XML files.
Added a +30min feature to the timezone settings to make
KDE-Pim/Pi useable in Australia and other parts on the
world with strange timezones ;-)
German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
It is now possible to disable the
"receive data via infrared" feature, such that syncing with
Outlook is now possible again with Kx/Pi runing.
Please disable it, before syncing Sharp DTM with Outlook.
For your convenience, the "receive data via infrared" feature
is disabled automatically, if you sync Kx/Pi with DTM.
You have to enable it again manually after syncing.
Enabling this feature makes it impossible to start the
Sharp DTM apps. If this feature is enabled, you will only get the
alarm notification from KO/Pi and not from the Sharp calendar.
This is very useful if you sync KO/Pi with Sharp DTM,
because after syncing you usually would get notified about
an alarm by KO/Pi and the Sharp Calendar.
Together with the Linux desktop version of KO/Pi
it is now possible to sync KO/Pi on the Zaurus
with the complete KDE-desktop (3.3 or later)
calendar data easily.
That makes it possible to sync the Z with one
click of a mouse with the KDE-Desktop.
This feature it available for all Zaurus platforms KO/Pi
is running on.
The only thing needed is a running KO/Pi on Linux and
a compiled version of the small
KDE-Pim/Pi<->KDE-Desktop access command line program,
which is in the KDE-Pim/Pi sources available.
The "KDE-desktop" syncing feature for KA/Pi will follow
in the next releases.
Fixed the vcard export bug, which had the version 1.9.8.
Added missing GERMAN translation to KO/Pi.
Hi PsionX, could you add the missing french translation?Thx!
Translation files for KA/Pi are available as well.
GERMAN translation will be available in the next release.
PsionX ( yres, you again ;-) ), could you start translating
KA/Pi? Thx!
You can download the version 1.9.9 at
http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
Note:
To run the mail program OM/Pi you need libopenssl.
A link to a download loaction is available at
ZSI at www.killefiz.de
********** VERSION 1.9.8 ************
Fixed character decoding in OM/Pi.
(e.g. German "Umlaute" were not displayed properly.)
Made is possible to reparent todos in KO/Pi.
Use contextmenu or keys (look at Help-Keys + Colors) for that.
Added the missing Sync-Howto and WhatsNew to the packages.
KO/Pi on Linux desktop can now sync with KDE desktop.
That means: When using KO/Pi on Linux desktop for syncing with
KDE desktop and the Zaurus, the Zaurus can be synced now
with all KDE-Calendar resources, not only with one local file.
(That makes it possible to sync the Zaurus with the
calendar data on a Kolab server)
KA/Pi syncing with KDE desktop will be available in the next version.
********** VERSION 1.9.7 ************
KO/Pi - KA/Pi on Windows:
Now a directory can be defined by the user, where the
application/config data should be saved.
Define your desired path in the evironment variable
MICROKDEHOME
before starting KO/Pi or KA/Pi.
An easy Kx/Pi to Kx/Pi syncing is now possible
(it is called Pi-Sync) via network.
Please look at the Sync Howto.
Exporting of calendar data and contacts to mobile phones is now possible.
The SyncHowto is updated with information howto
access/sync mobile phones.
Please look at the Sync Howto.
Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
Please disable Fastload for the original contact/calendar applications
and close them.
KO/Pi and KA/Pi must be running in order to receive the data.
(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
In the KA/Pi details view are now the preferred tel. numbers displayed on top
of the other data ( emails/tel.numbers/addresses)
Fixed some syncing problems in KA/Pi.
Added font settings for the KA/Pi details view.
Added fields "children's name" and "gender" to KA/Pi.
Made searching in KA/Pi better:
Now the first item in a view is selected after a search automatically and
the views can be scrolled up/down when the search input field has the keyboard focus.
And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
********** VERSION 1.9.6 ************
Changes in the external application communication on the Zaurus
in order to use less RAM when the apps are running.
First syncing of addressbooks (KA/Pi) is possible.
********** VERSION 1.9.5a ************
Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
Fixed some small bugs.
KA/Pi shows now the birthday in summary view.
Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
for displaying dates.
********** VERSION 1.9.5 ************
There is still no Addressbook syncing!
New in 1.9.5:
Many bugfixes.
Better searching in KA/Pi.
You can configure in KA/Pi if you want to search only after
<return> key pressed.
Better mail downloading in OM/Pi.
First experimental alpha version of sync of KO/Pi with mobile phones.
See gammu documentation for supported phones.
You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp.
Quick hint how to use:
NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
Create syncprofile - mobile device
Remove entry for model. (Leave empty ).
Enable infrared on Zaurus and your Phone.
Sync.
To get a more detailed log, start kopi from konsole.
********** VERSION 1.9.4 ************
This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
WARNING:
PLEASE BACKUP ALL YOUR DATA!
We have changed a lot and maybe there are some unknown problems.
SYNC HANDLING HAS CHANGED!
Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well.
As programs are available:
KO/Pi (korganizer ipk) - a calendar program.
KA/Pi (kaddressbook ipk ) - an addressbook
OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
All the applications are installed in a "Pim" TAB.
If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk
All the application are integrated.
Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail.
HINT:
If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
What's new?
SYNC HANDLING HAS CHANGED!
Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
New in OM/Pi:
When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails.
New in KO/Pi:
French is now available for KO/Pi.
Choose menu:Actions - Configure:TAB locale
Syncing has changed.
Phone sync available soon.
Not much changes, I cannot remember them ...
New in KA/Pi:
Beaming possible.
Sharp DTM readonly access possible( create a new DTM resource );
Better searching possible.
Search is performed only after pressing the return key.
Use wildcard * to specify parts of a name.
Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * .
A big improvement is the new management of the contact access.
In version 1.9.3, every application was using their own addressbook access data.
That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
That was wasting of memory, if you had several hundreds of contacts.
Now only KA/Pi accesses the addressbook.
If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them.
If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
New in the KO/Pi alarm applet:
Configure your own timer popup menu!
(Text and minutes for timer countdown)
Just edit the file
(yourhomedir)/.kopialarmtimerrc
and start/stop a timer to get a new menu with the data of this file.
********** VERSION 1.9.3 ************
1)
Now KO/Pi on Windows imports directly the calendar data of
an installed Outlook. Should work with OL version >= 2000.
********** VERSION 1.9.2 ************
1)
KDE-Pim/Pi has got a new member:
KmicroMail (KM/Pi) is a mail program,
which can handle IMAP and POP mail access.
It is based on Opie-Mail v3.
All dependencies to the Opie libraries ar removed,
such that no additional Opie lib is needed.
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index da7065f..b890725 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -1,433 +1,435 @@
// CHANGED 2004-09-31 Lutz Rogowski
#include <stdlib.h>
#include <libetpan/libetpan.h>
#include <qpe/global.h>
#include <qapplication.h>
#include "imapwrapper.h"
#include "mailtypes.h"
#include "logindialog.h"
#include <qprogressbar.h>
#include "genericwrapper.h"
#include <kglobal.h>
using namespace Opie::Core;
int IMAPwrapper::mMax = 0;
int IMAPwrapper::mCurrent = 0;
IMAPwrapper::IMAPwrapper( IMAPaccount *a )
: AbstractMail()
{
account = a;
m_imap = 0;
m_Lastmbox = "";
mCurrent = 0;
mMax = 0;
}
IMAPwrapper::~IMAPwrapper()
{
logout();
}
/* to avoid to often select statements in loops etc.
we trust that we are logged in and connection is established!*/
int IMAPwrapper::selectMbox(const QString&mbox)
{
if (mbox == m_Lastmbox) {
return MAILIMAP_NO_ERROR;
}
int err = mailimap_select( m_imap, (char*)mbox.latin1());
if ( err != MAILIMAP_NO_ERROR ) {
m_Lastmbox = "";
return err;
}
m_Lastmbox = mbox;
return err;
}
void IMAPwrapper::imap_progress( size_t current, size_t maximum )
{
+ qApp->processEvents();
+ return;
//qDebug("imap progress %d of %d ",current,maximum );
//Global::statusMessage(i18n("Downloading message %1 of %2").arg( current).arg(maximum));
//qApp->processEvents()
static unsigned int last = 0;
if ( last != current )
IMAPwrapper::progress();
last = current;
}
void IMAPwrapper::progress( QString m )
{
static QString mProgrMess;
if ( m != QString::null ) {
mProgrMess = m;
mCurrent = 1;
return;
}
QString mess;
//qDebug("progress ");
if ( mMax ) mess = mProgrMess +i18n(" message %1 of %2").arg( mCurrent++).arg(mMax);
else mess = mProgrMess +i18n(" message %1").arg( mCurrent++);
Global::statusMessage(mess);
//qDebug("Progress %s %s", mess.latin1(), m.latin1());
qApp->processEvents();
}
bool IMAPwrapper::start_tls(bool force_tls)
{
int err;
bool try_tls = force_tls;
mailimap_capability_data * cap_data = 0;
err = mailimap_capability(m_imap,&cap_data);
if (err != MAILIMAP_NO_ERROR) {
Global::statusMessage("error getting capabilities!");
return false;
}
clistiter * cur;
for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) {
struct mailimap_capability * cap;
cap = (struct mailimap_capability *)clist_content(cur);
if (cap->cap_type == MAILIMAP_CAPABILITY_NAME) {
if (strcasecmp(cap->cap_data.cap_name, "STARTTLS") == 0) {
try_tls = true;
break;
}
}
}
if (cap_data) {
mailimap_capability_data_free(cap_data);
}
if (try_tls) {
err = mailimap_starttls(m_imap);
if (err != MAILIMAP_NO_ERROR && force_tls) {
Global::statusMessage(i18n("Server has no TLS support!"));
try_tls = false;
} else {
mailstream_low * low;
mailstream_low * new_low;
low = mailstream_get_low(m_imap->imap_stream);
if (!low) {
try_tls = false;
} else {
int fd = mailstream_low_get_fd(low);
if (fd > -1 && (new_low = mailstream_low_ssl_open(fd))!=0) {
mailstream_low_free(low);
mailstream_set_low(m_imap->imap_stream, new_low);
} else {
try_tls = false;
}
}
}
}
return try_tls;
}
void IMAPwrapper::login()
{
QString server, user, pass;
uint16_t port;
int err = MAILIMAP_NO_ERROR;
if (account->getOffline()) return;
/* we are connected this moment */
/* TODO: setup a timer holding the line or if connection closed - delete the value */
if (m_imap) {
err = mailimap_noop(m_imap);
if (err!=MAILIMAP_NO_ERROR) {
logout();
} else {
mailstream_flush(m_imap->imap_stream);
return;
}
}
server = account->getServer();
port = account->getPort().toUInt();
if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) {
LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true );
login.show();
if ( QDialog::Accepted == login.exec() ) {
// ok
user = login.getUser();
pass = login.getPassword();
} else {
// cancel
return;
}
} else {
user = account->getUser();
pass = account->getPassword();
}
m_imap = mailimap_new( 20, &imap_progress );
/* connect */
bool ssl = false;
bool try_tls = false;
bool force_tls = false;
if ( account->ConnectionType() == 2 ) {
ssl = true;
}
if (account->ConnectionType()==1) {
force_tls = true;
}
if ( ssl ) {
qDebug("using ssl ");
err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port );
qDebug("back ");
} else {
err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port );
}
if ( err != MAILIMAP_NO_ERROR &&
err != MAILIMAP_NO_ERROR_AUTHENTICATED &&
err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) {
QString failure = "";
if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) {
failure="Connection refused";
} else {
failure="Unknown failure";
}
Global::statusMessage(i18n("error connecting imap server: %1").arg(failure));
mailimap_free( m_imap );
m_imap = 0;
return;
}
if (!ssl) {
try_tls = start_tls(force_tls);
}
bool ok = true;
if (force_tls && !try_tls) {
Global::statusMessage(i18n("Server has no TLS support!"));
ok = false;
}
/* login */
if (ok) {
err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() );
if ( err != MAILIMAP_NO_ERROR ) {
Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response));
ok = false;
}
}
if (!ok) {
err = mailimap_close( m_imap );
mailimap_free( m_imap );
m_imap = 0;
}
}
void IMAPwrapper::logout()
{
int err = MAILIMAP_NO_ERROR;
if (!m_imap) return;
err = mailimap_logout( m_imap );
err = mailimap_close( m_imap );
mailimap_free( m_imap );
m_imap = 0;
m_Lastmbox = "";
}
void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb)
{
int tryAgain = 1;
while ( tryAgain >= 0 ) {
int err = MAILIMAP_NO_ERROR;
clist *result = 0;
clistcell *current;
mailimap_fetch_type *fetchType = 0;
mailimap_set *set = 0;
login();
if (!m_imap) {
return;
}
/* select mailbox READONLY for operations */
err = selectMbox(mailbox);
if ( err != MAILIMAP_NO_ERROR ) {
return;
}
int last = m_imap->imap_selection_info->sel_exists;
if (last == 0) {
Global::statusMessage(i18n("Mailbox has no mails"));
return;
} else {
}
progress( i18n("Fetch "));
mMax = last;
//qDebug("last %d ", last);
Global::statusMessage(i18n("Fetching header list"));
qApp->processEvents();
/* the range has to start at 1!!! not with 0!!!! */
//LR the access to web.de imap server is no working with value 1
//qDebug("interval %d - %d ", tryAgain, last-1+tryAgain );
set = mailimap_set_new_interval( tryAgain, last );
fetchType = mailimap_fetch_type_new_fetch_att_list_empty();
mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_envelope());
mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_flags());
mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_internaldate());
mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size());
err = mailimap_fetch( m_imap, set, fetchType, &result );
mailimap_set_free( set );
mailimap_fetch_type_free( fetchType );
QString date,subject,from;
if ( err == MAILIMAP_NO_ERROR ) {
tryAgain = -1;
mailimap_msg_att * msg_att;
int i = 0;
for (current = clist_begin(result); current != 0; current=clist_next(current)) {
++i;
//qDebug("iii %d ",i);
msg_att = (mailimap_msg_att*)current->data;
RecMail*m = parse_list_result(msg_att);
if (m) {
if ( maxSizeInKb == 0 || m->Msgsize()<=(unsigned int ) maxSizeInKb*1024 ) {
m->setNumber(i);
m->setMbox(mailbox);
m->setWrapper(this);
target.append(m);
}
}
}
Global::statusMessage(i18n("Mailbox has %1 mails").arg(target.count()));
} else {
--tryAgain;
--tryAgain;//disabled tryagain by adding this line
if ( tryAgain < 0 )
Global::statusMessage(i18n("Error fetching headers: %1").arg(m_imap->imap_response));
else
qDebug("try again... ");
}
if (result) mailimap_fetch_list_free(result);
}
}
QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
{
const char *path, *mask;
int err = MAILIMAP_NO_ERROR;
clist *result = 0;
clistcell *current = 0;
clistcell*cur_flag = 0;
mailimap_mbx_list_flags*bflags = 0;
QValueList<FolderP>* folders = new QValueList<FolderP>();
login();
if (!m_imap) {
return folders;
}
/*
* First we have to check for INBOX 'cause it sometimes it's not inside the path.
* We must not forget to filter them out in next loop!
* it seems like ugly code. and yes - it is ugly code. but the best way.
*/
Global::statusMessage(i18n("Fetching folder list"));
qApp->processEvents();
QString temp;
mask = "INBOX" ;
mailimap_mailbox_list *list;
err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
QString del;
bool selectable = true;
bool no_inferiors = false;
if ( err == MAILIMAP_NO_ERROR ) {
current = result->first;
for ( int i = result->count; i > 0; i-- ) {
list = (mailimap_mailbox_list *) current->data;
// it is better use the deep copy mechanism of qt itself
// instead of using strdup!
temp = list->mb_name;
del = list->mb_delimiter;
current = current->next;
if ( (bflags = list->mb_flag) ) {
selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) {
if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) {
no_inferiors = true;
}
}
}
folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
}
} else {
qDebug("error fetching folders: ");
}
mailimap_list_result_free( result );
/*
* second stage - get the other then inbox folders
*/
mask = "*" ;
path = account->getPrefix().latin1();
if (!path) path = "";
err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
if ( err == MAILIMAP_NO_ERROR ) {
current = result->first;
for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
no_inferiors = false;
list = (mailimap_mailbox_list *) current->data;
// it is better use the deep copy mechanism of qt itself
// instead of using strdup!
temp = list->mb_name;
if (temp.lower()=="inbox")
continue;
if (temp.lower()==account->getPrefix().lower())
continue;
if ( (bflags = list->mb_flag) ) {
selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
for(cur_flag=clist_begin(bflags->mbf_oflags);cur_flag;cur_flag=clist_next(cur_flag)) {
if ( ((mailimap_mbx_list_oflag*)cur_flag->data)->of_type==MAILIMAP_MBX_LIST_OFLAG_NOINFERIORS) {
no_inferiors = true;
}
}
}
del = list->mb_delimiter;
folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
}
} else {
qDebug("error fetching folders ");
}
if (result) mailimap_list_result_free( result );
return folders;
}
RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
{
RecMail * m = 0;
mailimap_msg_att_item *item=0;
clistcell *current,*c,*cf;
mailimap_msg_att_dynamic*flist;
mailimap_flag_fetch*cflag;
int size = 0;
QBitArray mFlags(7);
QStringList addresslist;
if (!m_att) {
return m;
}
m = new RecMail();
for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
current = c;
size = 0;
item = (mailimap_msg_att_item*)current->data;
if ( !item )
continue;
if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) {
flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn;