author | zautrix <zautrix> | 2005-01-24 18:27:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-24 18:27:06 (UTC) |
commit | bb33b559609356149ae51cb50c081b3e82aecafb (patch) (unidiff) | |
tree | 4878aa5887bf1c539845ce9c4e5470eea94d41cc | |
parent | 77f93c632b66b5c8d92e4c63330362272ca1fc40 (diff) | |
download | kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.zip kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.tar.gz kdepimpi-bb33b559609356149ae51cb50c081b3e82aecafb.tar.bz2 |
pixmap update fix
-rw-r--r-- | kmicromail/mailistviewitem.cpp | 5 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 4 | ||||
-rw-r--r-- | kmicromail/viewmail.h | 4 | ||||
-rw-r--r-- | kmicromail/viewmailbase.cpp | 12 |
4 files changed, 13 insertions, 12 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index 137c482..5119744 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp | |||
@@ -2,38 +2,41 @@ | |||
2 | #include "mailistviewitem.h" | 2 | #include "mailistviewitem.h" |
3 | #include <libmailwrapper/abstractmail.h> | 3 | #include <libmailwrapper/abstractmail.h> |
4 | #include <qtextstream.h> | 4 | #include <qtextstream.h> |
5 | #include <kiconloader.h> | 5 | #include <kiconloader.h> |
6 | #include "koprefs.h" | 6 | #include "koprefs.h" |
7 | //#include <qpe/resource.h> | 7 | //#include <qpe/resource.h> |
8 | 8 | ||
9 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 9 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
10 | :QListViewItem(parent,item),mail_data() | 10 | :QListViewItem(parent,item),mail_data() |
11 | { | 11 | { |
12 | } | 12 | } |
13 | 13 | ||
14 | void MailListViewItem::showEntry() | 14 | void MailListViewItem::showEntry() |
15 | { | 15 | { |
16 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { | 16 | if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { |
17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); | 17 | setPixmap( 0, SmallIcon ( "kmmsgreplied") ); |
18 | mKeyMap.insert(0, "r" ); | ||
18 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 19 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
19 | /* I think it looks nicer if there are not such a log of icons but only on mails | 20 | /* I think it looks nicer if there are not such a log of icons but only on mails |
20 | replied or new - Alwin*/ | 21 | replied or new - Alwin*/ |
21 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); | 22 | //setPixmap( 0,SmallIcon ("kmmsgunseen") ); |
23 | mKeyMap.insert(0, "s" ); | ||
22 | } else { | 24 | } else { |
23 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); | 25 | setPixmap( 0,SmallIcon ( "kmmsgnew") ); |
26 | mKeyMap.insert(0, "u" ); | ||
24 | } | 27 | } |
25 | QString fsize = mail_data->MsgsizeString(); | 28 | QString fsize = mail_data->MsgsizeString(); |
26 | // 1.23 | 29 | // 1.23 |
27 | // 11.23 | 30 | // 11.23 |
28 | // 111.23 | 31 | // 111.23 |
29 | // 999.23 maxlen | 32 | // 999.23 maxlen |
30 | QString fsort; | 33 | QString fsort; |
31 | switch(fsize.length() ) { | 34 | switch(fsize.length() ) { |
32 | case 6: | 35 | case 6: |
33 | fsort = "00" + fsize ; | 36 | fsort = "00" + fsize ; |
34 | break; | 37 | break; |
35 | case 7: | 38 | case 7: |
36 | fsort = "0" + fsize ; | 39 | fsort = "0" + fsize ; |
37 | break; | 40 | break; |
38 | default: | 41 | default: |
39 | fsort = fsize ; | 42 | fsort = fsize ; |
@@ -54,33 +57,33 @@ void MailListViewItem::showEntry() | |||
54 | setText(4,mail_data->getDate()); | 57 | setText(4,mail_data->getDate()); |
55 | if ( KOPrefs::instance()->mShowToField ) | 58 | if ( KOPrefs::instance()->mShowToField ) |
56 | setText(5,mail_data->To()[0]); | 59 | setText(5,mail_data->To()[0]); |
57 | } | 60 | } |
58 | 61 | ||
59 | void MailListViewItem::storeData(const RecMailP&data) | 62 | void MailListViewItem::storeData(const RecMailP&data) |
60 | { | 63 | { |
61 | mail_data = data; | 64 | mail_data = data; |
62 | } | 65 | } |
63 | void MailListViewItem::setSortKey(int column,const QString &key) | 66 | void MailListViewItem::setSortKey(int column,const QString &key) |
64 | { | 67 | { |
65 | mKeyMap.insert(column,key); | 68 | mKeyMap.insert(column,key); |
66 | } | 69 | } |
67 | QString MailListViewItem::key(int column, bool) const | 70 | QString MailListViewItem::key(int column, bool) const |
68 | { | 71 | { |
69 | // to make is fast, we use here special cases | 72 | // to make is fast, we use here special cases |
70 | if ( column == 3 || column == 4 ) { | 73 | if ( column == 3 || column == 4 || column == 0) { |
71 | return *mKeyMap.find(column); | 74 | return *mKeyMap.find(column); |
72 | } | 75 | } |
73 | if ( column == 1 ) { | 76 | if ( column == 1 ) { |
74 | if ( text(1).left(4).lower() == "re: " ) | 77 | if ( text(1).left(4).lower() == "re: " ) |
75 | return text(1).mid(4); | 78 | return text(1).mid(4); |
76 | 79 | ||
77 | } | 80 | } |
78 | return text(column); | 81 | return text(column); |
79 | /* | 82 | /* |
80 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); | 83 | QMap<int,QString>::ConstIterator it = mKeyMap.find(column); |
81 | if (it == mKeyMap.end()) return text(column); | 84 | if (it == mKeyMap.end()) return text(column); |
82 | else return *it; | 85 | else return *it; |
83 | */ | 86 | */ |
84 | } | 87 | } |
85 | 88 | ||
86 | const RecMailP& MailListViewItem::data()const | 89 | const RecMailP& MailListViewItem::data()const |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 760e3b0..68f0eb3 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -402,33 +402,35 @@ void OpieMail::displayMail() | |||
402 | readMail.showMaximized(); | 402 | readMail.showMaximized(); |
403 | #else | 403 | #else |
404 | readMail.resize( 640, 480); | 404 | readMail.resize( 640, 480); |
405 | #endif | 405 | #endif |
406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | 408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); |
409 | 409 | ||
410 | readMail.exec(); | 410 | readMail.exec(); |
411 | 411 | ||
412 | if ( readMail.deleted ) | 412 | if ( readMail.deleted ) |
413 | { | 413 | { |
414 | folderView->refreshCurrent(); | 414 | folderView->refreshCurrent(); |
415 | } | 415 | } |
416 | else | 416 | else |
417 | { | 417 | { |
418 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 418 | QListViewItem*item = mailView->currentItem(); |
419 | if (item) | ||
420 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | ||
419 | } | 421 | } |
420 | } | 422 | } |
421 | void OpieMail::slotGetAllMail() | 423 | void OpieMail::slotGetAllMail() |
422 | { | 424 | { |
423 | QListViewItem * item = folderView->firstChild(); | 425 | QListViewItem * item = folderView->firstChild(); |
424 | while ( item ){ | 426 | while ( item ){ |
425 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 427 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
426 | item = item->nextSibling (); | 428 | item = item->nextSibling (); |
427 | } | 429 | } |
428 | } | 430 | } |
429 | void OpieMail::slotGetMail() | 431 | void OpieMail::slotGetMail() |
430 | { | 432 | { |
431 | QListViewItem * item = folderView->currentItem(); | 433 | QListViewItem * item = folderView->currentItem(); |
432 | if ( ! item ) return; | 434 | if ( ! item ) return; |
433 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 435 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
434 | } | 436 | } |
diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h index 561989e..fc5edcf 100644 --- a/kmicromail/viewmail.h +++ b/kmicromail/viewmail.h | |||
@@ -1,26 +1,28 @@ | |||
1 | #ifndef VIEWMAIL_H | 1 | #ifndef VIEWMAIL_H |
2 | #define VIEWMAIL_H | 2 | #define VIEWMAIL_H |
3 | 3 | ||
4 | #include "viewmailbase.h" | 4 | #include "viewmailbase.h" |
5 | #include <libmailwrapper/mailtypes.h> | 5 | #include <libmailwrapper/mailtypes.h> |
6 | 6 | ||
7 | #include <qdialog.h> | 7 | #include <qdialog.h> |
8 | #include <qapplication.h> | ||
8 | 9 | ||
9 | #include <qlistview.h> | 10 | #include <qlistview.h> |
10 | #include <qmap.h> | 11 | #include <qmap.h> |
12 | #include <klocale.h> | ||
11 | #include <qstringlist.h> | 13 | #include <qstringlist.h> |
12 | #include <qvaluelist.h> | 14 | #include <qvaluelist.h> |
13 | 15 | ||
14 | //namespace Opie { namespace MM { class OImageScrollView; } } | 16 | //namespace Opie { namespace MM { class OImageScrollView; } } |
15 | 17 | ||
16 | class AttachItem : public QListViewItem | 18 | class AttachItem : public QListViewItem |
17 | { | 19 | { |
18 | public: | 20 | public: |
19 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 21 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
20 | const QString&fsize,int num,const QValueList<int>&path); | 22 | const QString&fsize,int num,const QValueList<int>&path); |
21 | AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 23 | AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
22 | const QString&fsize,int num,const QValueList<int>&path); | 24 | const QString&fsize,int num,const QValueList<int>&path); |
23 | int Partnumber() { return _partNum; } | 25 | int Partnumber() { return _partNum; } |
24 | bool isParentof(const QValueList<int>&path); | 26 | bool isParentof(const QValueList<int>&path); |
25 | 27 | ||
26 | private: | 28 | private: |
@@ -39,33 +41,33 @@ public: | |||
39 | 41 | ||
40 | void hide(); | 42 | void hide(); |
41 | void exec(); | 43 | void exec(); |
42 | void setMail(const RecMailP&mail ); | 44 | void setMail(const RecMailP&mail ); |
43 | void setBody(const RecBodyP&body); | 45 | void setBody(const RecBodyP&body); |
44 | bool deleted; | 46 | bool deleted; |
45 | signals: | 47 | signals: |
46 | void showNextMail(ViewMail*); | 48 | void showNextMail(ViewMail*); |
47 | void deleteAndDisplayNextMail(ViewMail *); | 49 | void deleteAndDisplayNextMail(ViewMail *); |
48 | void signalDownloadMail(); | 50 | void signalDownloadMail(); |
49 | protected: | 51 | protected: |
50 | QString deHtml(const QString &string); | 52 | QString deHtml(const QString &string); |
51 | AttachItem* searchParent(const QValueList<int>&path); | 53 | AttachItem* searchParent(const QValueList<int>&path); |
52 | AttachItem* lastChild(AttachItem*parent); | 54 | AttachItem* lastChild(AttachItem*parent); |
53 | 55 | ||
54 | protected slots: | 56 | protected slots: |
55 | void slotNextMail() { emit showNextMail(this); }; | 57 | void slotNextMail() { setCaption(i18n("Displaying next mail...please wait!")); qApp->processEvents();emit showNextMail(this); }; |
56 | void slotReply(); | 58 | void slotReply(); |
57 | void slotForward(); | 59 | void slotForward(); |
58 | void setText(); | 60 | void setText(); |
59 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); | 61 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); |
60 | void slotDeleteMail( ); | 62 | void slotDeleteMail( ); |
61 | void slotShowHtml( bool ); | 63 | void slotShowHtml( bool ); |
62 | void slotViewSource(); | 64 | void slotViewSource(); |
63 | 65 | ||
64 | private: | 66 | private: |
65 | void readConfig(); | 67 | void readConfig(); |
66 | bool sourceOn;; | 68 | bool sourceOn;; |
67 | bool _inLoop; | 69 | bool _inLoop; |
68 | QString m_mailHtml; | 70 | QString m_mailHtml; |
69 | bool m_gotBody; | 71 | bool m_gotBody; |
70 | RecBodyP m_body; | 72 | RecBodyP m_body; |
71 | RecMailP m_recMail; | 73 | RecMailP m_recMail; |
diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 9365c23..3a41ba0 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp | |||
@@ -36,51 +36,45 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | |||
36 | downloadMail->addTo(mailmenu); | 36 | downloadMail->addTo(mailmenu); |
37 | 37 | ||
38 | 38 | ||
39 | reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); | 39 | reply = new QAction(i18n("Reply"),SmallIcon("reply"), 0, 0, this); |
40 | reply->addTo(toolbar); | 40 | reply->addTo(toolbar); |
41 | reply->addTo(mailmenu); | 41 | reply->addTo(mailmenu); |
42 | 42 | ||
43 | forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this); | 43 | forward = new QAction(i18n("Forward"),SmallIcon("forward"), 0, 0, this); |
44 | forward->addTo(toolbar); | 44 | forward->addTo(toolbar); |
45 | forward->addTo(mailmenu); | 45 | forward->addTo(mailmenu); |
46 | 46 | ||
47 | attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true); | 47 | attachbutton = new QAction(i18n("Attachments"),SmallIcon("attach"), 0, 0, this, 0, true); |
48 | attachbutton->addTo(toolbar); | 48 | attachbutton->addTo(toolbar); |
49 | attachbutton->addTo(mailmenu); | 49 | attachbutton->addTo(mailmenu); |
50 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); | 50 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); |
51 | 51 | ||
52 | 52 | showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); | |
53 | showHtml = new QAction( i18n( "Show Html" ), SmallIcon( "html" ), 0, 0, this, 0, true ); | 53 | showHtml->addTo( toolbar ); |
54 | showHtml->addTo( toolbar ); | 54 | showHtml->addTo( mailmenu ); |
55 | showHtml->addTo( mailmenu ); | ||
56 | 55 | ||
57 | deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this); | 56 | deleteMail = new QAction(i18n("Delete Mail"),SmallIcon("trash"), 0, 0, this); |
58 | deleteMail->addTo(toolbar); | 57 | deleteMail->addTo(toolbar); |
59 | deleteMail->addTo(mailmenu); | 58 | deleteMail->addTo(mailmenu); |
60 | 59 | ||
61 | |||
62 | |||
63 | nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this); | 60 | nextMail = new QAction(i18n("Show next mail"),SmallIcon("enter"), 0, 0, this); |
64 | QLabel *spacer = new QLabel(toolbar); | 61 | QLabel *spacer = new QLabel(toolbar); |
65 | nextMail->addTo(toolbar); | 62 | nextMail->addTo(toolbar); |
66 | nextMail->addTo(mailmenu); | 63 | nextMail->addTo(mailmenu); |
67 | 64 | ||
68 | |||
69 | |||
70 | |||
71 | closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 65 | closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
72 | //QLabel *spacer = new QLabel(toolbar); | 66 | //QLabel *spacer = new QLabel(toolbar); |
73 | spacer->setBackgroundMode(QWidget::PaletteButton); | 67 | spacer->setBackgroundMode(QWidget::PaletteButton); |
74 | toolbar->setStretchableWidget(spacer); | 68 | toolbar->setStretchableWidget(spacer); |
75 | closeMail->addTo(toolbar); | 69 | closeMail->addTo(toolbar); |
76 | closeMail->addTo(mailmenu); | 70 | closeMail->addTo(mailmenu); |
77 | QVBox *view = new QVBox(this); | 71 | QVBox *view = new QVBox(this); |
78 | setCentralWidget(view); | 72 | setCentralWidget(view); |
79 | 73 | ||
80 | attachments = new QListView(view); | 74 | attachments = new QListView(view); |
81 | attachments->setMinimumHeight(90); | 75 | attachments->setMinimumHeight(90); |
82 | attachments->setMaximumHeight(90); | 76 | attachments->setMaximumHeight(90); |
83 | attachments->setAllColumnsShowFocus(true); | 77 | attachments->setAllColumnsShowFocus(true); |
84 | attachments->addColumn("Mime Type", 60); | 78 | attachments->addColumn("Mime Type", 60); |
85 | attachments->addColumn(i18n("Description"), 100); | 79 | attachments->addColumn(i18n("Description"), 100); |
86 | attachments->addColumn(i18n("Filename"), 80); | 80 | attachments->addColumn(i18n("Filename"), 80); |