Version: GIT (master) (using Devel) OS: Linux Hi Yesterday I added google calendars to akonadi and set their colors. Today...after reboot their colors were totally mixed up and changed. Than I wanted to test if it also happens with other akonadi calendar resources and added an "akonadi_gcal_resource" and and standard calender with file access. After a restart of Kontact the colors were still there...the same after a reboot. But now I can't assign a color anymore to any of the resources. "Assign Color ..." is just greyed out... Reproducible: Sometimes Steps to Reproduce: added google calendars to akonadi and set their colors. Today...after reboot their colors were totally mixed up and changed. Than I wanted to test if it also happens with other akonadi calendar resources and added an "akonadi_gcal_resource" and and standard calender with file access. After a restart of Kontact the colors were still there...the same after a reboot. But now I can't assign a color anymore to any of the resources. "Assign Color ..." is just greyed out... Expected Results: being able to add colors to calendars and they should stay even after reboot
I've tried to investigate the source of the bug myself and found out that the assign color field in the dialog of an calendar resource only gets highlighted when the selection of a calendar has been changed because there is only a connect between the Signal selectionChanged(QItemSelection,QItemSelection) of the class QItemSelectionModel (lives in mSelectionProxyModel->selectionModel()). This connection is created in the setter function setCollectionSelectionProxyModel in korganizer/akonadicollectionview.cpp. I tried to add another connect for the signals "currentChanged" and "currentRowChanged" of the class QItemSelectionModel but these Signals just don't get triggerd, when I change the focus to a different calendar element. I checked it via cgdb... I'm not so experienced in c++ and qt programming and really would like to understand, why these signals are not called. Please help me :-) Here is the code I added: void AkonadiCollectionView::setCollectionSelectionProxyModel( KCheckableProxyModel* m ) { if ( mSelectionProxyModel == m ) return; mSelectionProxyModel = m; if ( !mSelectionProxyModel ) return; mBaseModel->setSourceModel( mSelectionProxyModel ); connect( mSelectionProxyModel->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged()) ); connect( mSelectionProxyModel->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), this, SLOT(currentRowChanged()) ); connect( mSelectionProxyModel->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(selectionChanged()) ); } void AkonadiCollectionView::selectionChanged() { updateMenu(); updateView(); } void AkonadiCollectionView::currentRowChanged() { updateMenu(); } void AkonadiCollectionView::currentChanged() { updateMenu(); }
Created attachment 64180 [details] how I tried to fix it The patch shows how I tried to fix this bug. Both signals somehow don't get called when change the focus to a different calendar.
Add a breakpoint on updateMenu(), and select a calendar with the mouse, does the breakpoint get hit ?
Git commit 4e8cbf49d8c230e1959a064eb4e2ec08e47a6b53 by Sergio Martins. Committed on 02/11/2011 at 19:25. Pushed by smartins into branch 'master'. Fix "Use default calendar" and "Assign color" being disabled. We were listening to the wrong selection model. BUG: 282956 BUG: 246573 M +4 -8 korganizer/akonadicollectionview.cpp M +1 -4 korganizer/akonadicollectionview.h http://commits.kde.org/kdepim/4e8cbf49d8c230e1959a064eb4e2ec08e47a6b53
Git commit 617ee9629e90caa037e0ac47dfecc87cf20fa8da by Sergio Martins. Committed on 02/11/2011 at 19:25. Pushed by smartins into branch 'KDE/4.7'. Fix "Use default calendar" and "Assign color" being disabled. We were listening to the wrong selection model. BUG: 282956 BUG: 246573 Conflicts: korganizer/akonadicollectionview.cpp M +7 -7 korganizer/akonadicollectionview.cpp M +1 -4 korganizer/akonadicollectionview.h http://commits.kde.org/kdepim/617ee9629e90caa037e0ac47dfecc87cf20fa8da