[Korganizer-devel] [Bug 282956] korganizer doesn't enable the "assign color" dialog field on focusing/marking a calendar element but only when you change the selection

joker777vs.666 at gmail.com joker777vs.666 at gmail.com
Sun Oct 2 20:56:45 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=282956


joker777vs.666 at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Kontact calendar has        |korganizer doesn't enable
                   |strange color behaviour     |the "assign color" dialog
                   |                            |field on focusing/marking a
                   |                            |calendar element but only
                   |                            |when you change the
                   |                            |selection




--- Comment #1 from  <joker777vs 666 gmail com>  2011-10-02 20:56:44 ---
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();                                                                 
}

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Korganizer-devel mailing list