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

List:       kde-commits
Subject:    kdevelop/parts/outputviews
From:       Alexander Neundorf <neundorf () kde ! org>
Date:       2004-10-28 22:36:26
Message-ID: 20041028223626.3967E16D0C () office ! kde ! org
[Download RAW message or body]

CVS commit by neundorf: 

-optimization: seems to reduce parsing time from 24 to 22 sec on my 2 GHz
box for a lot of "undefined references" by getting rid of one QString
variable and the associated malloc()s and a stripWhiteSpace()
-changes the behaviour slightly: 
 -if a continuation is found there might be
    still some white space at the beginning of the appended string
 -if not there might be some whitespace at the beginning and the end of the
   appended string
 if this isn't ok feel free to revert

Alex


  M +16 -15    commandcontinuationfilter.cpp   1.4


--- kdevelop/parts/outputviews/commandcontinuationfilter.cpp  #1.3:1.4
@@ -21,19 +21,20 @@ CommandContinuationFilter::CommandContin
 void CommandContinuationFilter::processLine( const QString& line )
 {
-  bool foundLineCont = false;
-  QString s = line.stripWhiteSpace();
-  if (s.endsWith("\\"))
+   int index=line.length()-1;
+   while (index>=0)
   {
-    m_text += s.left(s.length() - 1);
-    foundLineCont = true;
-  } else
+      if (line[index]=='\\')
   {
-    m_text += line;
+         m_text += line.left(index);
+         return;
   }
 
-        if ( !foundLineCont )
-        {
+      if (!line[index].isSpace())
+         break;
+      index--;
+   }
+
+   m_text+=line;
                 OutputFilter::processLine( m_text );
                 m_text = "";
-        }
 }


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

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