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

List:       kde-commits
Subject:    [calligra] krita/ui: Moved the favorites to the end of the blending
From:       Silvio Heinrich <plassy () web ! de>
Date:       2011-09-15 12:11:48
Message-ID: 20110915121148.A2F76A607A () git ! kde ! org
[Download RAW message or body]

Git commit 5d22eba0f65a96f73a2517211ed80f44ee863f46 by Silvio Heinrich.
Committed on 15/09/2011 at 14:10.
Pushed by heinrich into branch 'master'.

Moved the favorites to the end of the blending modes list.

M  +5    -2    krita/ui/kis_categorized_list_model.h
M  +3    -3    krita/ui/kis_composite_ops_model.cc

http://commits.kde.org/calligra/5d22eba0f65a96f73a2517211ed80f44ee863f46

diff --git a/krita/ui/kis_categorized_list_model.h b/krita/ui/kis_categorized_list_model.h
index fbd15c8..82ca6c6 100644
--- a/krita/ui/kis_categorized_list_model.h
+++ b/krita/ui/kis_categorized_list_model.h
@@ -95,8 +95,11 @@ public:
 	}
 	
 	QModelIndex lastIndex() const {
-		int end = getCategoryBegin(m_categories.size()-1) + m_categories.last().entries.size() - 1;
-		return QAbstractListModel::index(end);
+        if(!m_categories.empty()) {
+            int end = getCategoryBegin(m_categories.size()-1) + m_categories.last().entries.size() - 1;
+            return QAbstractListModel::index(end);
+        }
+        return QAbstractListModel::index(0);
 	}
 	
 	void expandCategory(const TCategory& category, bool expand) {
diff --git a/krita/ui/kis_composite_ops_model.cc b/krita/ui/kis_composite_ops_model.cc
index 6e9aba5..2c0226b 100644
--- a/krita/ui/kis_composite_ops_model.cc
+++ b/krita/ui/kis_composite_ops_model.cc
@@ -25,11 +25,11 @@
 struct CompositeOpModelInitializer
 {
     CompositeOpModelInitializer() {
-        model.addCategory(KoID("favorites", i18n("Favorites")));
         model.addEntries(KoCompositeOpRegistry::instance().getCompositeOps(), false, true);
-		model.readFavriteCompositeOpsFromConfig();
 		model.expandAllCategories(false);
-		model.expandCategory(KoID("favorites"), true);
+        model.addCategory(KoID("favorites", i18n("Favorites")));
+        model.readFavriteCompositeOpsFromConfig();
+        model.expandCategory(KoID("favorites"), true);
     }
     
     KisCompositeOpListModel model;

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

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