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

List:       kde-commits
Subject:    extragear/office/tellico/src
From:       Robby Stephenson <robby () periapsis ! org>
Date:       2010-10-15 4:56:19
Message-ID: 20101015045619.B8D1FAC895 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1186045 by rstephenson:

hide columns by default when new fields are added

 M  +9 -0      detailedlistview.cpp  
 M  +1 -0      detailedlistview.h  
 M  +1 -2      document.cpp  


--- trunk/extragear/office/tellico/src/detailedlistview.cpp #1186044:1186045
@@ -102,6 +102,7 @@
   ModelManager::self()->setEntryModel(sortModel);
 
   connect(model(), SIGNAL(headerDataChanged(Qt::Orientation, int, int)), \
SLOT(updateHeaderMenu())); +  connect(model(), SIGNAL(columnsInserted(const \
QModelIndex&, int, int)), SLOT(hideNewColumn(const QModelIndex&, int, int)));  \
connect(header(), SIGNAL(sectionCountChanged(int, int)), SLOT(updateHeaderMenu()));  \
}  
@@ -600,6 +601,14 @@
   }
 }
 
+void DetailedListView::hideNewColumn(const QModelIndex& index_, int start_, int \
end_) { +  Q_UNUSED(index_);
+  for(int ncol = start_; ncol <= end_; ++ncol) {
+    hideColumn(ncol);
+  }
+  updateHeaderMenu(); // make sure to update checkable actions
+}
+
 void DetailedListView::checkHeader() {
   // the header disappears if all columns are hidden, so if the user hides all
   // columns, we turn around and show the title
--- trunk/extragear/office/tellico/src/detailedlistview.h #1186044:1186045
@@ -151,6 +151,7 @@
   void showAllColumns();
   void hideAllColumns();
   void resizeColumnsToContents();
+  void hideNewColumn(const QModelIndex& index, int start, int end);
 //  void slotCacheColumnWidth(int section, int oldSize, int newSize);
 
 private:
--- trunk/extragear/office/tellico/src/document.cpp #1186044:1186045
@@ -648,8 +648,7 @@
     return false;
   }
   bool ret = true;
-  FieldList fields = e1->collection()->fields();
-  foreach(FieldPtr field, fields) {
+  foreach(FieldPtr field, e1->collection()->fields()) {
     if(e2->field(field).isEmpty()) {
       continue;
     }


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

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