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

List:       kwrite-devel
Subject:    Patch for "attributes appear backwards in list"
From:       Mirko Stocker <me () misto ! ch>
Date:       2007-06-23 23:46:23
Message-ID: 200706240146.28550.me () misto ! ch
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


My first patch :-)

This fixes the problem with the backwards sorted attributes.

Regards

Mirko

["attributes_backwards.patch" (text/x-diff)]

Index: kate/utils/kateschema.cpp
===================================================================
--- kate/utils/kateschema.cpp	(revision 678565)
+++ kate/utils/kateschema.cpp	(working copy)
@@ -497,8 +497,7 @@
   p.setColor( QPalette::Text, _c );
   m_defaultStyles->viewport()->setPalette( p );
 
-  // insert the default styles backwards to get them in the right order
-  for ( int i = KateHlManager::self()->defaultStyles() - 1; i >= 0; i-- )
+  for ( int i = 0; i < KateHlManager::self()->defaultStyles(); i++ )
   {
     m_defaultStyles->addItem( KateHlManager::self()->defaultStyleName(i, true), l->at( i ) );
   }
@@ -627,10 +626,9 @@
   m_styles->viewport()->setPalette( p );
 
   QHash<QString, QTreeWidgetItem*> prefixes;
-  QList<KateExtendedAttribute::Ptr>::ConstIterator it = m_hlDict[m_schema][m_hl].end();
-  while (it != m_hlDict[m_schema][m_hl].begin())
+  QList<KateExtendedAttribute::Ptr>::ConstIterator it = m_hlDict[m_schema][m_hl].begin();
+  while (it != m_hlDict[m_schema][m_hl].end())
   {
-    --it;
     KateExtendedAttribute::Ptr itemData = *it;
     Q_ASSERT(itemData);
 
@@ -654,6 +652,7 @@
     } else {
       m_styles->addItem( itemData->name(), l->at(itemData->defaultStyleIndex()), itemData );
     }
+    ++it;
   }
 
   m_styles->resizeColumns();

["signature.asc" (application/pgp-signature)]

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


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

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