- Until we redesign the logic to avoid a bad re-entrancy caused by processEvents while searching

into file contents, try to not crash at least. (metaKeyRx could be already deleted)

BUG: 193560
BUG: 203325


svn path=/trunk/KDE/kdebase/apps/; revision=1030054
This commit is contained in:
Darío Andrés Rodríguez 2009-10-01 13:11:24 +00:00
parent d9643eb7dd
commit 50b98bff11
3 changed files with 10 additions and 10 deletions

View file

@ -99,7 +99,10 @@ KfindDlg::KfindDlg(const KUrl & url, QWidget *parent)
KfindDlg::~KfindDlg()
{
stopSearch();
stopSearch();
if (dirwatch)
delete dirwatch;
}
void KfindDlg::finishAndClose()

View file

@ -163,8 +163,8 @@ void KQuery::checkEntries()
m_insideCheckEntries=true;
metaKeyRx=new QRegExp(m_metainfokey);
metaKeyRx->setPatternSyntax( QRegExp::Wildcard );
metaKeyRx = QRegExp(m_metainfokey);
metaKeyRx.setPatternSyntax( QRegExp::Wildcard );
m_foundFilesList.clear();
@ -192,8 +192,6 @@ void KQuery::checkEntries()
if( m_foundFilesList.size() > 0 )
emit foundFileList( m_foundFilesList );
delete metaKeyRx;
if (job==0)
emit result(m_result);
@ -203,8 +201,8 @@ void KQuery::checkEntries()
/* List of files found using slocate */
void KQuery::slotListEntries( QStringList list )
{
metaKeyRx=new QRegExp(m_metainfokey);
metaKeyRx->setPatternSyntax( QRegExp::Wildcard );
metaKeyRx = QRegExp(m_metainfokey);
metaKeyRx.setPatternSyntax( QRegExp::Wildcard );
QStringList::const_iterator it = list.constBegin();
QStringList::const_iterator end = list.constEnd();
@ -216,7 +214,6 @@ void KQuery::slotListEntries( QStringList list )
if( m_foundFilesList.size() > 0 )
emit foundFileList( m_foundFilesList );
delete metaKeyRx;
}
/* Check if file meets the find's requirements*/
@ -328,7 +325,7 @@ void KQuery::processQuery( const KFileItem &file)
metakeys = metadatas.supportedKeys();
for (QStringList::const_iterator it = metakeys.constBegin(); it != metakeys.constEnd(); ++it )
{
if (!metaKeyRx->exactMatch(*it))
if (!metaKeyRx.exactMatch(*it))
continue;
strmetakeycontent=metadatas.item(*it).value().toString();
if(strmetakeycontent.indexOf(m_metainfo)!=-1)

View file

@ -116,7 +116,7 @@ class KQuery : public QObject
KIO::ListJob *job;
bool m_insideCheckEntries;
QQueue<KFileItem> m_fileItems;
QRegExp* metaKeyRx;
QRegExp metaKeyRx;
int m_result;
QStringList ignore_mimetypes;
QStringList ooo_mimetypes; // OpenOffice.org mimetypes