summaryrefslogtreecommitdiffabout
path: root/kmicromail/accountitem.cpp
authorzautrix <zautrix>2004-09-11 08:56:57 (UTC)
committer zautrix <zautrix>2004-09-11 08:56:57 (UTC)
commit0f45c977d7530b6ca827b7a7c7da7469f01800ca (patch) (unidiff)
tree0368bbd4865a0b21bb197cfd0a190fd0c2cd9242 /kmicromail/accountitem.cpp
parent1b41a0e3bf63364940daf132446939e3570c57ad (diff)
downloadkdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.zip
kdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.tar.gz
kdepimpi-0f45c977d7530b6ca827b7a7c7da7469f01800ca.tar.bz2
More config changes
Diffstat (limited to 'kmicromail/accountitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/accountitem.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp
index d0321ef..1698b40 100644
--- a/kmicromail/accountitem.cpp
+++ b/kmicromail/accountitem.cpp
@@ -79,32 +79,33 @@ void POP3viewItem::refresh()
79 79
80RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) 80RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
81{ 81{
82 82
83 return wrapper->fetchBody( mail ); 83 return wrapper->fetchBody( mail );
84} 84}
85 85
86QPopupMenu * POP3viewItem::getContextMenu() 86QPopupMenu * POP3viewItem::getContextMenu()
87{ 87{
88 QPopupMenu *m = new QPopupMenu(0); 88 QPopupMenu *m = new QPopupMenu(0);
89 if (m) 89 if (m)
90 { 90 {
91 if (!account->getOffline()) 91 if (!account->getOffline())
92 { 92 {
93 m->insertItem(QObject::tr("Disconnect",contextName),0); 93 m->insertItem(QObject::tr("Disconnect",contextName),0);
94 m->insertItem(QObject::tr("Set offline",contextName),1); 94 m->insertItem(QObject::tr("Set offline",contextName),1);
95 m->insertItem(QObject::tr("Download messages",contextName),2);
95 } 96 }
96 else 97 else
97 { 98 {
98 m->insertItem(QObject::tr("Set online",contextName),1); 99 m->insertItem(QObject::tr("Set online",contextName),1);
99 } 100 }
100 } 101 }
101 return m; 102 return m;
102} 103}
103 104
104void POP3viewItem::disconnect() 105void POP3viewItem::disconnect()
105{ 106{
106 QListViewItem *child = firstChild(); 107 QListViewItem *child = firstChild();
107 while ( child ) 108 while ( child )
108 { 109 {
109 QListViewItem *tmp = child; 110 QListViewItem *tmp = child;
110 child = child->nextSibling(); 111 child = child->nextSibling();
@@ -122,32 +123,41 @@ void POP3viewItem::setOnOffline()
122 account->setOffline(!account->getOffline()); 123 account->setOffline(!account->getOffline());
123 account->save(); 124 account->save();
124 SETPIX(PIXMAP_POP3FOLDER); 125 SETPIX(PIXMAP_POP3FOLDER);
125 refresh(); 126 refresh();
126} 127}
127 128
128void POP3viewItem::contextMenuSelected(int which) 129void POP3viewItem::contextMenuSelected(int which)
129{ 130{
130 switch (which) 131 switch (which)
131 { 132 {
132 case 0: 133 case 0:
133 disconnect(); 134 disconnect();
134 break; 135 break;
135 case 1: 136 case 1:
136 setOnOffline(); 137 setOnOffline();
137 break; 138 break;
139 case 2: // daunlood
140 AccountView*bl = accountView();
141 if (!bl) return;
142 AccountViewItem* in = findSubItem( "inbox" , 0);
143 if ( ! in )
144 return;
145 bl->downloadMailsInbox(in->getFolder() ,getWrapper());
146 setOnOffline();
147 break;
138 } 148 }
139} 149}
140 150
141POP3folderItem::~POP3folderItem() 151POP3folderItem::~POP3folderItem()
142{} 152{}
143 153
144POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) 154POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after )
145 : AccountViewItem(folderInit,parent,after ) 155 : AccountViewItem(folderInit,parent,after )
146{ 156{
147 pop3 = parent; 157 pop3 = parent;
148 if (folder->getDisplayName().lower()!="inbox") 158 if (folder->getDisplayName().lower()!="inbox")
149 { 159 {
150 setPixmap( 0, PIXMAP_POP3FOLDER ); 160 setPixmap( 0, PIXMAP_POP3FOLDER );
151 } 161 }
152 else 162 else
153 { 163 {
@@ -1092,33 +1102,33 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder)
1092} 1102}
1093 1103
1094void AccountViewItem::removeChilds() 1104void AccountViewItem::removeChilds()
1095{ 1105{
1096 QListViewItem *child = firstChild(); 1106 QListViewItem *child = firstChild();
1097 while ( child ) 1107 while ( child )
1098 { 1108 {
1099 QListViewItem *tmp = child; 1109 QListViewItem *tmp = child;
1100 child = child->nextSibling(); 1110 child = child->nextSibling();
1101 delete tmp; 1111 delete tmp;
1102 } 1112 }
1103} 1113}
1104 1114
1105bool AccountViewItem::matchName(const QString&name)const 1115bool AccountViewItem::matchName(const QString&name)const
1106{ 1116{
1107 if (!folder) return false; 1117 if (!folder) return false;
1108 return folder->getDisplayName()==name; 1118 return folder->getDisplayName().lower()==name.lower();
1109} 1119}
1110 1120
1111 1121
1112AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start) 1122AccountViewItem*AccountViewItem::findSubItem(const QString&path,AccountViewItem*start)
1113{ 1123{
1114 AccountViewItem*pitem,*sitem; 1124 AccountViewItem*pitem,*sitem;
1115 if (!start) pitem = (AccountViewItem*)firstChild(); 1125 if (!start) pitem = (AccountViewItem*)firstChild();
1116 else pitem = (AccountViewItem*)start->firstChild(); 1126 else pitem = (AccountViewItem*)start->firstChild();
1117 while (pitem) 1127 while (pitem)
1118 { 1128 {
1119 if (pitem->matchName(path)) 1129 if (pitem->matchName(path))
1120 { 1130 {
1121 break; 1131 break;
1122 } 1132 }
1123 if (pitem->childCount()>0) 1133 if (pitem->childCount()>0)
1124 { 1134 {