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

List:       kde-commits
Subject:    playground/base/plasma/plasmate
From:       Marco Martin <notmart () gmail ! com>
Date:       2010-10-28 18:35:10
Message-ID: 20101028183510.24AE2AC899 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1190734 by mart:

don't put expander on the leaves


 M  +11 -3     packagemodel.cpp  


--- trunk/playground/base/plasma/plasmate/packagemodel.cpp #1190733:1190734
@@ -151,7 +151,7 @@
         break;
         case Qt::DecorationRole: {
             if (index.row() == 0)
-                return KIcon("file-new");
+                return KIcon("document-new");
         }
         break;
         }
@@ -231,8 +231,16 @@
 {
     if (parent.isValid()) {
         if (parent.row() < m_topEntries.count()) {
-            const char *key = m_topEntries.at(parent.row());
-            //kDebug() << "looking for" << key << m_files[key].count();
+            //const char *key = m_topEntries.at(parent.row());
+            const char *key = static_cast<const char *>(parent.internalPointer());
+            if (!key) {
+                key = m_topEntries.at(parent.row());
+            //It is a leaf
+            } else if (m_namedFiles.contains(key)) {
+                return 0;
+            }
+            //kDebug() << "looking for" << key << m_files[key].count() << \
m_namedFiles[key]<<key<<parent.parent(); +            
             return m_files.contains(key) ? m_files[key].count() + \
m_namedFiles[key].count() + 1 : 0;  } else {
             return 0;


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

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