|
|
|
|
@ -106,7 +106,8 @@ void FolderTreeView::slotHeaderContextMenuRequested( const QPoint&pnt ) |
|
|
|
|
KMenu menu; |
|
|
|
|
QAction *act; |
|
|
|
|
menu.addTitle( i18n("View Columns") ); |
|
|
|
|
for ( int i = 1; i <header()->count(); ++i ) |
|
|
|
|
const int nbColumn = header()->count(); |
|
|
|
|
for ( int i = 1; i <nbColumn; ++i ) |
|
|
|
|
{ |
|
|
|
|
act = menu.addAction( model()->headerData( i, Qt::Horizontal ).toString() ); |
|
|
|
|
act->setCheckable( true ); |
|
|
|
|
@ -253,7 +254,7 @@ void FolderTreeView::slotHeaderContextMenuChangeToolTipDisplayPolicy( bool ) |
|
|
|
|
QVariant data = act->data(); |
|
|
|
|
|
|
|
|
|
bool ok; |
|
|
|
|
int id = data.toInt( &ok ); |
|
|
|
|
const int id = data.toInt( &ok ); |
|
|
|
|
if ( !ok ) |
|
|
|
|
return; |
|
|
|
|
emit changeTooltipsPolicy( ( FolderTreeWidget::ToolTipDisplayPolicy )id ); |
|
|
|
|
@ -268,7 +269,7 @@ void FolderTreeView::slotHeaderContextMenuChangeHeader( bool ) |
|
|
|
|
QVariant data = act->data(); |
|
|
|
|
|
|
|
|
|
bool ok; |
|
|
|
|
int id = data.toInt( &ok ); |
|
|
|
|
const int id = data.toInt( &ok ); |
|
|
|
|
if ( !ok ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
@ -290,7 +291,7 @@ void FolderTreeView::slotHeaderContextMenuChangeIconSize( bool ) |
|
|
|
|
QVariant data = act->data(); |
|
|
|
|
|
|
|
|
|
bool ok; |
|
|
|
|
int size = data.toInt( &ok ); |
|
|
|
|
const int size = data.toInt( &ok ); |
|
|
|
|
if ( !ok ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
@ -309,13 +310,14 @@ void FolderTreeView::selectModelIndex( const QModelIndex & index ) |
|
|
|
|
|
|
|
|
|
void FolderTreeView::slotSelectFocusFolder() |
|
|
|
|
{ |
|
|
|
|
if( currentIndex().isValid() ) |
|
|
|
|
setCurrentIndex( currentIndex() ); |
|
|
|
|
const QModelIndex index = currentIndex(); |
|
|
|
|
if( index.isValid() ) |
|
|
|
|
setCurrentIndex( index ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FolderTreeView::slotFocusNextFolder() |
|
|
|
|
{ |
|
|
|
|
QModelIndex nextFolder = selectNextFolder( currentIndex() ); |
|
|
|
|
const QModelIndex nextFolder = selectNextFolder( currentIndex() ); |
|
|
|
|
|
|
|
|
|
if ( nextFolder.isValid() ) { |
|
|
|
|
expand( nextFolder ); |
|
|
|
|
@ -342,7 +344,7 @@ QModelIndex FolderTreeView::selectNextFolder( const QModelIndex & current ) |
|
|
|
|
|
|
|
|
|
void FolderTreeView::slotFocusPrevFolder() |
|
|
|
|
{ |
|
|
|
|
QModelIndex current = currentIndex(); |
|
|
|
|
const QModelIndex current = currentIndex(); |
|
|
|
|
if ( current.isValid() ) { |
|
|
|
|
QModelIndex above = indexAbove( current ); |
|
|
|
|
selectModelIndex( above ); |
|
|
|
|
@ -439,9 +441,9 @@ void FolderTreeView::selectPrevUnreadFolder( bool confirm ) |
|
|
|
|
|
|
|
|
|
Akonadi::Collection FolderTreeView::currentFolder() const |
|
|
|
|
{ |
|
|
|
|
QModelIndex current = currentIndex(); |
|
|
|
|
const QModelIndex current = currentIndex(); |
|
|
|
|
if ( current.isValid() ) { |
|
|
|
|
Akonadi::Collection collection = current.model()->data( current, Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>(); |
|
|
|
|
const Akonadi::Collection collection = current.model()->data( current, Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>(); |
|
|
|
|
return collection; |
|
|
|
|
} |
|
|
|
|
return Akonadi::Collection(); |
|
|
|
|
|