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

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/io
From:       David Faure <faure () kde ! org>
Date:       2010-12-07 13:38:32
Message-ID: 20101207133832.43547AC8A7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1204474 by dfaure:

Fix assert when dynamicArea is used before numbered area, in the case where there's no mainComponentData.
Still need to unittest this better, but let's commit the fix first to reduce complaints ;)


 M  +5 -1      kdebug.cpp  


--- trunk/KDE/kdelibs/kdecore/io/kdebug.cpp #1204473:1204474
@@ -391,18 +391,22 @@
 
     Cache::Iterator areaData(QtMsgType type, unsigned int num, bool enableByDefault = true)
     {
-        if (!configObject() || (cache.isEmpty() && !KGlobal::hasMainComponent())) {
+        if (!configObject() || !KGlobal::hasMainComponent()) {
             // we don't have a config and we can't create one...
             // or we don't have a main component (yet?)
             Area &area = cache[0]; // create a dummy entry
+            if (area.name.isEmpty()) {
             if (KGlobal::hasMainComponent())
                 area.name = KGlobal::mainComponent().componentName().toUtf8();
             else
                 area.name = qApp ? qAppName().toUtf8() : QByteArray("unnamed app");
+            }
+            //qDebug() << "Created dummy entry for area 0 with name" << area.name;
             return cache.find(0);
         }
 
         if (!cache.contains(0) || (cache.count() == 1 && KGlobal::hasMainComponent())) {
+            //qDebug() << "cache size=" << cache.count() << "loading area names";
             loadAreaNames(); // fills 'cache'
         }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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