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

List:       kde-commits
Subject:    KDE/kdeedu/parley/src/vocabulary
From:       David Capel <wot.narg () gmail ! com>
Date:       2008-04-22 7:13:50
Message-ID: 1208848430.579362.29326.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 799738 by capel:

This changes the default load behavior so that it shows only the translation (main \
lists of words/translations) columns when there are no saved settings.



 M  +17 -6     vocabularyview.cpp  


--- trunk/KDE/kdeedu/parley/src/vocabulary/vocabularyview.cpp #799737:799738
@@ -400,22 +400,33 @@
 
         QListIterator<int> iter(ds.visibleColumns());
 
-        // if there are no saved settings, default to show everything
+        // if there are no saved settings, it defaults to showing no extra columns.
         if (ds.visibleColumns().size() == 0)
         {
+               KAction* column;
                for (int i = 0; i < m_columnActionMap.size(); ++i)
                {
-                    KAction* column = m_columnActionMap.key(i, (KAction*)0);
+                    column = m_columnActionMap.key(i, (KAction*)0);
                     if (column)
                     {
-                        column->setChecked(true);
-                        setColumnHidden(i, false);
+                        if (VocabularyModel::columnType(i) == \
VocabularyModel::Translation) +                        {
+                            // show the column
+                            column->setChecked(true);
+                            setColumnHidden(i, false);
+                        }
+                        else
+                        {
+                            // hide the column
+                            column->setChecked(false);
+                            setColumnHidden(i, true);
+                        }
                     }
-               }   
+               }
                resizeColumnsToContents();
                return;
         }
-        
+
         int j;
         KAction* column;
         for (int i = 0; iter.hasNext(); ++i)


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

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