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

List:       kde-commits
Subject:    kdenox/konq-embed/src
From:       Eva Brucherseifer <eva () kde ! org>
Date:       2006-12-07 12:44:23
Message-ID: 1165495463.966348.1077.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 611254 by eva:

decreased default history size to 50 as the URL sorting algorithms is
 probably O(n^2)
added a config option for the history size ("HistorySize")



 M  +6 -3      urlcombo.cpp  


--- trunk/kdenox/konq-embed/src/urlcombo.cpp #611253:611254
@@ -40,6 +40,7 @@
 #include <kstandarddirs.h>
 #include <kdebug.h>
 #include <kurl.h>
+#include <kconfig.h>
 
 
 class TrailingListItem : public QListBoxText
@@ -267,7 +268,7 @@
 
 
 namespace{
-        static const uint g_maxElementsInHistoryBuffer = 100;
+        static const uint g_maxElementsInHistoryBuffer = 50;
 }
 
 URLHistoryBuffer URLHistoryBuffer::instance;
@@ -281,6 +282,8 @@
 URLHistoryBuffer::URLHistoryBuffer()
         : QObject( NULL, NULL ), m_maxElementsInBuffer( g_maxElementsInHistoryBuffer )
 {
+        m_maxElementsInBuffer = KGlobal::config()->readNumEntry( "HistorySize",
+                     g_maxElementsInHistoryBuffer);
 }
 
 
@@ -326,7 +329,7 @@
         kdDebug() << "URLHistoryBuffer::addURL() " << _url << endl;
         QString url = _url;
         // This should never happen.. Just to be sure..
-        if ( m_content.count() > g_maxElementsInHistoryBuffer )
+        if ( m_content.count() > m_maxElementsInBuffer )
                 m_content.clear();
 
          KURL kurl = url;
@@ -380,7 +383,7 @@
         }
 
         // Handle maximum size of list
-        if ( m_content.count() == g_maxElementsInHistoryBuffer )
+        if ( m_content.count() == m_maxElementsInBuffer )
                 m_content.remove( m_content.last() );
 
         //qDebug( "URLHistoryBuffer: append string on top" );
[prev in list] [next in list] [prev in thread] [next in thread] 

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