-rw-r--r-- | kmicromail/accountitem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 59c8abb..12d047a 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -450,97 +450,97 @@ void IMAPviewItem::refresh(QValueList<RecMailP>&) | |||
450 | { | 450 | { |
451 | refreshFolders(false); | 451 | refreshFolders(false); |
452 | } | 452 | } |
453 | 453 | ||
454 | const QStringList&IMAPviewItem::subFolders() | 454 | const QStringList&IMAPviewItem::subFolders() |
455 | { | 455 | { |
456 | return currentFolders; | 456 | return currentFolders; |
457 | } | 457 | } |
458 | 458 | ||
459 | void IMAPviewItem::refreshFolders(bool force) | 459 | void IMAPviewItem::refreshFolders(bool force) |
460 | { | 460 | { |
461 | if (childCount()>0 && force==false) return; | 461 | if (childCount()>0 && force==false) return; |
462 | if (account->getOffline()) return; | 462 | if (account->getOffline()) return; |
463 | 463 | ||
464 | removeChilds(); | 464 | removeChilds(); |
465 | currentFolders.clear(); | 465 | currentFolders.clear(); |
466 | QValueList<FolderP> * folders = wrapper->listFolders(); | 466 | QValueList<FolderP> * folders = wrapper->listFolders(); |
467 | 467 | ||
468 | QValueList<FolderP>::Iterator it; | 468 | QValueList<FolderP>::Iterator it; |
469 | QListViewItem*item = 0; | 469 | QListViewItem*item = 0; |
470 | QListViewItem*titem = 0; | 470 | QListViewItem*titem = 0; |
471 | QString fname,del,search; | 471 | QString fname,del,search; |
472 | int pos; | 472 | int pos; |
473 | 473 | ||
474 | for ( it = folders->begin(); it!=folders->end(); ++it) | 474 | for ( it = folders->begin(); it!=folders->end(); ++it) |
475 | { | 475 | { |
476 | if ((*it)->getDisplayName().lower()=="inbox") | 476 | if ((*it)->getDisplayName().lower()=="inbox") |
477 | { | 477 | { |
478 | item = new IMAPfolderItem( (*it), this , item ); | 478 | item = new IMAPfolderItem( (*it), this , item ); |
479 | folders->remove(it); | 479 | folders->remove(it); |
480 | break; | 480 | break; |
481 | } | 481 | } |
482 | } | 482 | } |
483 | for ( it = folders->begin(); it!=folders->end(); ++it) | 483 | for ( it = folders->begin(); it!=folders->end(); ++it) |
484 | { | 484 | { |
485 | fname = (*it)->getDisplayName(); | 485 | fname = (*it)->getDisplayName(); |
486 | currentFolders.append((*it)->getName()); | 486 | currentFolders.append((*it)->getName()); |
487 | pos = fname.findRev((*it)->Separator()); | 487 | pos = fname.findRev((*it)->Separator()); |
488 | if (pos != -1) | 488 | if (pos != -1) |
489 | { | 489 | { |
490 | fname = fname.left(pos); | 490 | fname = fname.left(pos); |
491 | } | 491 | } |
492 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); | 492 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); |
493 | if (pitem) | 493 | if (pitem) |
494 | { | 494 | { |
495 | titem = item; | 495 | titem = item; |
496 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); | 496 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); |
497 | /* setup the short name */ | 497 | /* setup the short name */ |
498 | item->setText(0,(*it)->getDisplayName().right((*it)->getDisplayName().length()-pos-1)); | 498 | item->setText(0,(*it)->getDisplayName().mid(pos+1)); |
499 | item = titem; | 499 | item = titem; |
500 | } | 500 | } |
501 | else | 501 | else |
502 | { | 502 | { |
503 | item = new IMAPfolderItem( (*it), this , item ); | 503 | item = new IMAPfolderItem( (*it), this , item ); |
504 | } | 504 | } |
505 | } | 505 | } |
506 | delete folders; | 506 | delete folders; |
507 | } | 507 | } |
508 | 508 | ||
509 | QPopupMenu * IMAPviewItem::getContextMenu() | 509 | QPopupMenu * IMAPviewItem::getContextMenu() |
510 | { | 510 | { |
511 | QPopupMenu *m = new QPopupMenu(0); | 511 | QPopupMenu *m = new QPopupMenu(0); |
512 | if (m) | 512 | if (m) |
513 | { | 513 | { |
514 | if (!account->getOffline()) | 514 | if (!account->getOffline()) |
515 | { | 515 | { |
516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
517 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 517 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
518 | m->insertSeparator(); | 518 | m->insertSeparator(); |
519 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 519 | m->insertItem(QObject::tr("Disconnect",contextName),2); |
520 | m->insertItem(QObject::tr("Set offline",contextName),3); | 520 | m->insertItem(QObject::tr("Set offline",contextName),3); |
521 | m->insertSeparator(); | 521 | m->insertSeparator(); |
522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
523 | } | 523 | } |
524 | else | 524 | else |
525 | { | 525 | { |
526 | m->insertItem(QObject::tr("Set online",contextName),3); | 526 | m->insertItem(QObject::tr("Set online",contextName),3); |
527 | m->insertSeparator(); | 527 | m->insertSeparator(); |
528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); | 528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
529 | } | 529 | } |
530 | } | 530 | } |
531 | return m; | 531 | return m; |
532 | } | 532 | } |
533 | 533 | ||
534 | void IMAPviewItem::createNewFolder() | 534 | void IMAPviewItem::createNewFolder() |
535 | { | 535 | { |
536 | Newmdirdlg ndirdlg; | 536 | Newmdirdlg ndirdlg; |
537 | 537 | ||
538 | ndirdlg.showMaximized(); | 538 | ndirdlg.showMaximized(); |
539 | if ( ndirdlg.exec() ) | 539 | if ( ndirdlg.exec() ) |
540 | { | 540 | { |
541 | QString ndir = ndirdlg.Newdir(); | 541 | QString ndir = ndirdlg.Newdir(); |
542 | bool makesubs = ndirdlg.subpossible(); | 542 | bool makesubs = ndirdlg.subpossible(); |
543 | QString delemiter = "/"; | 543 | QString delemiter = "/"; |
544 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); | 544 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); |
545 | if (item) | 545 | if (item) |
546 | { | 546 | { |