From d48a858e05959cd9f6a5b4fc3721e56b49fa7a25 Mon Sep 17 00:00:00 2001 From: Don Sanders Date: Sun, 1 Oct 2000 22:15:18 +0000 Subject: [PATCH] In my opinion this thing really needs a destructive c1ose //----------------------------------------------------------------------------- KMFldSearch::KMFldSearch(KMMainWin* w, const char* name, QString curFolder, bool modal, WFlags f): - KMFldSearchInherited(NULL, name, modal, f) + KMFldSearchInherited(NULL, name, modal, f | Qt::WDestructiveClose) { KButtonBox* bbox; : ---------------------------------------------------------------------- svn path=/trunk/kdenetwork/kmail/; revision=66069 --- kmfldsearch.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/kmfldsearch.cpp b/kmfldsearch.cpp index 05ab9bdf6..ee24c2e23 100644 --- a/kmfldsearch.cpp +++ b/kmfldsearch.cpp @@ -28,9 +28,9 @@ #include //----------------------------------------------------------------------------- -KMFldSearch::KMFldSearch(KMMainWin* w, const char* name, - QString curFolder, bool modal, WFlags f): - KMFldSearchInherited(NULL, name, modal, f) +KMFldSearch::KMFldSearch(KMMainWin* w, const char* name, + QString curFolder, bool modal, WFlags f): + KMFldSearchInherited(NULL, name, modal, f | Qt::WDestructiveClose) { KButtonBox* bbox; QLabel* lbl; @@ -143,10 +143,10 @@ QComboBox* KMFldSearch::createFolderCombo(const QString curFolder) QValueList > folders; QComboBox* cbx = new QComboBox(false, this); QStringList str; - + kernel->folderMgr()->createI18nFolderList( &str, &folders ); cbx->setFixedHeight(cbx->sizeHint().height()); - + cbx->insertItem(i18n("")); QStringList::Iterator st; int i = 1; @@ -158,7 +158,7 @@ QComboBox* KMFldSearch::createFolderCombo(const QString curFolder) } } - return cbx; + return cbx; } @@ -187,7 +187,7 @@ void KMFldSearch::keyPressEvent(QKeyEvent *evt) if(!evt) return; - + switch (evt->key()) { case Key_Return: KMFldSearchInherited::keyPressEvent(evt); @@ -212,7 +212,7 @@ bool KMFldSearch::searchInMessage(KMMessage* aMsg) mCount++; updStatus(); for(i=0; matches && imatches(aMsg)) + if (!mRules[i]->matches(aMsg)) matches = false; return matches; @@ -227,7 +227,7 @@ void KMFldSearch::searchInFolder(QGuardedPtr aFld, int fldNum) QString str; assert(!aFld.isNull()); - + mBtnSearch->setText("Stop"); if (aFld->isSystemFolder()) mSearchFolder = i18n(aFld->name()); else mSearchFolder = aFld->name(); @@ -245,7 +245,7 @@ void KMFldSearch::searchInFolder(QGuardedPtr aFld, int fldNum) if (msg && searchInMessage(msg)) { (void)new QListViewItem(mLbxMatches, - msg->subject(), + msg->subject(), msg->from(), msg->dateIsoStr(), mSearchFolder, @@ -302,13 +302,13 @@ void KMFldSearch::slotSearch() int i; mLastFocus = focusWidget(); mBtnSearch->setFocus(); // set focus so we don't miss key event - + if (mSearching) { mSearching = false; return; } - + mCount = 0; mStopped = false; mNumMatches = 0; @@ -321,8 +321,8 @@ void KMFldSearch::slotSearch() for (i=0; iprepare(); - - if (mCbxFolders->currentItem() <= 0) + + if (mCbxFolders->currentItem() <= 0) searchInAllFolders(); else { QValueList > folders; @@ -339,7 +339,7 @@ void KMFldSearch::slotSearch() mBtnSearch->setCaption(i18n("Search")); enableGUI(); - if( mLastFocus ) + if( mLastFocus ) mLastFocus->setFocus(); } @@ -369,14 +369,14 @@ void KMFldSearch::slotShowMsg(QListViewItem *item) if (folders.at(idx) == folders.end()) return; fld = *folders.at(idx); - if (!fld) + if (!fld) return; // This could goto the wrong folder if the folder list has been modified kdDebug() << "fld " << endl; mMainWin->slotSelectFolder(fld); msg = fld->getMsg(item->text(MSGID_COLUMN).toInt()); - if (!msg) + if (!msg) return; mMainWin->slotSelectMessage(msg); @@ -394,7 +394,7 @@ void KMFldSearch::enableGUI() { //============================================================================= -KMFldSearchRule::KMFldSearchRule(QWidget* aParent, QGridLayout* aGrid, +KMFldSearchRule::KMFldSearchRule(QWidget* aParent, QGridLayout* aGrid, int aRow, int aCol) { assert(aParent!=NULL); @@ -466,7 +466,7 @@ bool KMFldSearchRule::matches(const KMMessage* aMsg) const // also see KMFilterRule::matches() for a similar function: switch(mFunc) { - case Equal: + case Equal: return (stricmp(value, mValue) == 0); case NotEqual: return (stricmp(value, mValue) != 0);