[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kfind
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2005-02-05 22:28:10
Message-ID: 20050205222810.7F19C1D02A () office ! kde ! org
[Download RAW message or body]

CVS commit by neundorf: 

-tiny optimization: don't create and fill the QStringLists for the OOo and
koffice mimetypes again for every file

Alex


  M +14 -18    kquery.cpp   1.38
  M +4 -0      kquery.h   1.18


--- kdebase/kfind/kquery.cpp  #1.37:1.38
@@ -25,4 +25,18 @@ KQuery::KQuery(QObject *parent, const ch
   connect(processLocate,SIGNAL(receivedStderr(KProcess*, char*, \
int)),this,SLOT(slotreceivedSdterr(KProcess*,char*,int)));  \
connect(processLocate,SIGNAL(processExited(KProcess*)),this,SLOT(slotendProcessLocate(KProcess*)));
 +
+  // Files with these mime types can be ignored, even if
+  // findFormatByFileContent() in some cases may claim that
+  // these are text files:
+  ignore_mimetypes.append("application/pdf");
+  ignore_mimetypes.append("application/postscript");
+  // PLEASE update the documentation when you add another
+  // file type here:
+  ooo_mimetypes.append("application/vnd.sun.xml.writer");
+  ooo_mimetypes.append("application/vnd.sun.xml.calc");
+  ooo_mimetypes.append("application/vnd.sun.xml.impress");
+  koffice_mimetypes.append("application/x-kword");
+  koffice_mimetypes.append("application/x-kspread");
+  koffice_mimetypes.append("application/x-kpresenter");
 }
 
@@ -243,11 +257,4 @@ void KQuery::processQuery( KFileItem* fi
     {
 
-       // Files with these mime types can be ignored, even if
-       // findFormatByFileContent() in some cases may claim that
-       // these are text files:
-       QStringList ignore_mimetypes;
-       ignore_mimetypes.append("application/pdf");
-       ignore_mimetypes.append("application/postscript");
-
        if( !m_search_binary && ignore_mimetypes.findIndex(file->mimetype()) != -1 ) \
                {
          kdDebug() << "ignoring, mime type is in exclusion list: " << file->url() << \
endl; @@ -255,15 +262,4 @@ void KQuery::processQuery( KFileItem* fi
        }
 
-       // PLEASE update the documentation when you add another
-       // file type here:
-       QStringList ooo_mimetypes;     // OpenOffice.org mimetypes
-       ooo_mimetypes.append("application/vnd.sun.xml.writer");
-       ooo_mimetypes.append("application/vnd.sun.xml.calc");
-       ooo_mimetypes.append("application/vnd.sun.xml.impress");
-       QStringList koffice_mimetypes;
-       koffice_mimetypes.append("application/x-kword");
-       koffice_mimetypes.append("application/x-kspread");
-       koffice_mimetypes.append("application/x-kpresenter");
-
        bool found = false;
        bool isZippedOfficeDocument=false;

--- kdebase/kfind/kquery.h  #1.17:1.18
@@ -8,4 +8,5 @@
 #include <qptrqueue.h>
 #include <qdir.h>
+#include <qstringlist.h>
 
 #include <kio/job.h>
@@ -93,4 +94,7 @@ class KQuery : public QObject
   QRegExp* metaKeyRx;
   int m_result;
+  QStringList ignore_mimetypes;
+  QStringList ooo_mimetypes;     // OpenOffice.org mimetypes
+  QStringList koffice_mimetypes;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic