Summary: | korganizer doesn't enable the "assign color" dialog field on focusing/marking a calendar element but only when you change the selection | ||
---|---|---|---|
Product: | [Applications] korganizer | Reporter: | Johannes K. <joker777vs.666> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | smartins |
Priority: | NOR | ||
Version: | GIT (master) | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | how I tried to fix it |
Description
Johannes K.
2011-09-28 08:47:00 UTC
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 |