rem: KMPopFilterCnfrmDlg::KMPopFilterCnfrmDlg(QList<KMPopHeaders> *aHeaders, const QString &aAccount, bool aShowLaterMsgs, QWidget *aParent, const char *aName) : KDialogBase(aParent, aName, TRUE, i18n("KMail POP Filter"), Ok | Help, Ok, FALSE) { unsigned int rulesetCount = 0; mHeaders = aHeaders; mShowLaterMsgs = aShowLaterMsgs; mLowerBoxVisible = false;  QWidget *w = new QWidget(this); setMainWidget(w);  QVBoxLayout *vbl = new QVBoxLayout(w, 0, spacingHint());  QLabel *l = new QLabel(QString(i18n("Messages to filter found on POP Account: <b>%1</b><p>" "The messages shown exceed the maximum size limit you defined for this account.<br>You can select " "what you want to do with them by checking the apropriate button.")).arg(aAccount), w); vbl->addWidget(l);  QVGroupBox *upperBox = new QVGroupBox(i18n("Messages exceeding size"), w); upperBox->hide(); KMPopHeadersView *lv = new KMPopHeadersView(upperBox); vbl->addWidget(upperBox);  QVGroupBox *lowerBox = new QVGroupBox(i18n("Ruleset Filtered Messages: none"), w); QString checkBoxText((aShowLaterMsgs)? i18n("Show messages matched by a ruleset and tagged 'Download' or 'Delete'"): i18n("Show messages matched by a filter ruleset")); QCheckBox* cb = new QCheckBox(checkBoxText, lowerBox); cb->setEnabled(false); mFilteredHeaders = new KMPopHeadersView(lowerBox); mFilteredHeaders->hide(); vbl->addWidget(lowerBox);    KMPopHeaders *headers; for(headers = aHeaders->first(); headers; headers = aHeaders->next()) { KMPopHeadersViewItem *lvi = 0;  if(headers->ruleMatched()) { if(aShowLaterMsgs && headers->action() == Later) {  lvi = new KMPopHeadersViewItem(mFilteredHeaders, headers->action()); mFilteredHeaders->show(); mLowerBoxVisible = true; } else if(aShowLaterMsgs) {   mDDLList.append(headers); cb->setEnabled(true); } else if(!aShowLaterMsgs) {   lvi = new KMPopHeadersViewItem(mFilteredHeaders, headers->action()); cb->setEnabled(true); } rulesetCount++; } else {   lvi = new KMPopHeadersViewItem(lv, headers->action()); upperBox->show(); }  if(lvi) {  mItemMap[lvi] = headers; KMMessage *msg = headers->header();  QString tmp = msg->subject(); if(tmp.isEmpty()) tmp = i18n("no subject"); lvi->setText(3, tmp);  tmp = msg->fromStrip(); if(tmp.isEmpty()) tmp = i18n("unknown"); lvi->setText(4, msg->fromStrip());  lvi->setText(5, KMHeaders::fancyDate(msg->date()));  lvi->setText(6, QString("%1").arg(headers->header()->msgLength())); } }  if(rulesetCount) lowerBox->setTitle(QString("Ruleset Filtered Messages: %1").arg(rulesetCount));   connect(lv, SIGNAL(pressed(QListViewItem*, const QPoint&, int)), this, SLOT(slotPressed(QListViewItem*, const QPoint&, int))); connect(mFilteredHeaders, SIGNAL(pressed(QListViewItem*, const QPoint&, int)), this, SLOT(slotPressed(QListViewItem*, const QPoint&, int))); connect(cb, SIGNAL(toggled(bool)), this, SLOT(slotToggled(bool)));  w->setMinimumSize(w->sizeHint()); adjustSize(); }
add: KMPopFilterCnfrmDlg() { };
context: KMPopFilterCnfrmDlg::KMPopFilterCnfrmDlg(QList<KMPopHeaders> *aHeaders, const QString &aAccount, bool aShowLaterMsgs, QWidget *aParent, const char *aName)      : KDialogBase(aParent, aName, TRUE, i18n("KMail POP Filter"), Ok | Help, Ok, FALSE){  unsigned int rulesetCount = 0;  mHeaders = aHeaders;  mShowLaterMsgs = aShowLaterMsgs;  mLowerBoxVisible = false;  QWidget *w = new QWidget(this);  setMainWidget(w);  QVBoxLayout *vbl = new QVBoxLayout(w, 0, spacingHint());  QLabel *l = new QLabel(QString(i18n("Messages to filter found on POP Account: <b>%1</b><p>"      "The messages shown exceed the maximum size limit you defined for this account.<br>You can select "      "what you want to do with them by checking the apropriate button.")).arg(aAccount), w);  vbl->addWidget(l);  QVGroupBox *upperBox = new QVGroupBox(i18n("Messages exceeding size"), w);  upperBox->hide();  KMPopHeadersView *lv = new KMPopHeadersView(upperBox);  vbl->addWidget(upperBox);  QVGroupBox *lowerBox = new QVGroupBox(i18n("Ruleset Filtered Messages: none"), w);  QString checkBoxText((aShowLaterMsgs)?      i18n("Show messages matched by a ruleset and tagged 'Download' or 'Delete'"):      i18n("Show messages matched by a filter ruleset"));  QCheckBox* cb = new QCheckBox(checkBoxText, lowerBox);  cb->setEnabled(false);  mFilteredHeaders = new KMPopHeadersView(lowerBox);  mFilteredHeaders->hide();  vbl->addWidget(lowerBox);  // fill the listviews with data from the headers  KMPopHeaders *headers;  for(headers = aHeaders->first(); headers; headers = aHeaders->next())  {    KMPopHeadersViewItem *lvi = 0;    if(headers->ruleMatched())    {      if(aShowLaterMsgs && headers->action() == Later)      {        // insert messages tagged 'later' only        lvi = new KMPopHeadersViewItem(mFilteredHeaders, headers->action());        mFilteredHeaders->show();        mLowerBoxVisible = true;      }      else if(aShowLaterMsgs)      {        // enable checkbox to show 'delete' and 'download' msgs        // but don't insert them into the listview yet        mDDLList.append(headers);        cb->setEnabled(true);      }      else if(!aShowLaterMsgs)      {        // insert all messaged tagged by a ruleset, enable        // the checkbox, but don't show the listview yet        lvi = new KMPopHeadersViewItem(mFilteredHeaders, headers->action());        cb->setEnabled(true);      }      rulesetCount++;    }    else    {      // insert all messages not tagged by a ruleset      // into the upper listview      lvi = new KMPopHeadersViewItem(lv, headers->action());      upperBox->show();    }    if(lvi)    {      // todo: extrect the whole listitem thing into a method      mItemMap[lvi] = headers;      KMMessage *msg = headers->header();      // set the subject      QString tmp = msg->subject();      if(tmp.isEmpty())        tmp = i18n("no subject");      lvi->setText(3, tmp);      // set the sender      tmp = msg->fromStrip();      if(tmp.isEmpty())        tmp = i18n("unknown");      lvi->setText(4, msg->fromStrip());      // set the date      lvi->setText(5, KMHeaders::fancyDate(msg->date()));      // set the size      lvi->setText(6, QString("%1").arg(headers->header()->msgLength()));    }  }  if(rulesetCount)      lowerBox->setTitle(QString("Ruleset Filtered Messages: %1").arg(rulesetCount));  // connect signals and slots  connect(lv, SIGNAL(pressed(QListViewItem*, const QPoint&, int)),      this, SLOT(slotPressed(QListViewItem*, const QPoint&, int)));  connect(mFilteredHeaders, SIGNAL(pressed(QListViewItem*, const QPoint&, int)),      this, SLOT(slotPressed(QListViewItem*, const QPoint&, int)));  connect(cb, SIGNAL(toggled(bool)),      this, SLOT(slotToggled(bool)));  w->setMinimumSize(w->sizeHint());  adjustSize();}