diff --git a/foldertreeview.cpp b/foldertreeview.cpp index a33e07d9c..e2e0b4687 100644 --- a/foldertreeview.cpp +++ b/foldertreeview.cpp @@ -106,7 +106,8 @@ void FolderTreeView::slotHeaderContextMenuRequested( const QPoint&pnt ) KMenu menu; QAction *act; menu.addTitle( i18n("View Columns") ); - for ( int i = 1; i count(); ++i ) + const int nbColumn = header()->count(); + for ( int i = 1; i 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(); + const Akonadi::Collection collection = current.model()->data( current, Akonadi::EntityTreeModel::CollectionRole ).value(); return collection; } return Akonadi::Collection(); diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 85b62054f..f33a37726 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -3832,7 +3832,7 @@ void KMMainWidget::updateFolderMenu() QList< QAction* > actionlist; if ( mCurrentFolder && mCurrentFolder->collection().id() == kmkernel->outboxCollectionFolder().id() && kmkernel->outboxCollectionFolder().statistics().count() > 0 ) { - kDebug() << "Enablign send queued"; + kDebug() << "Enabling send queued"; actionlist << mSendQueued; } if( mCurrentFolder && mCurrentFolder->collection().id() != kmkernel->trashCollectionFolder().id() ) { diff --git a/readablecollectionproxymodel.cpp b/readablecollectionproxymodel.cpp index d22741de9..677b012b4 100644 --- a/readablecollectionproxymodel.cpp +++ b/readablecollectionproxymodel.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2009 Laurent Montel + Copyright (c) 2009, 2010 Laurent Montel This library is free software; you can redistribute it and/or modify it @@ -34,7 +34,9 @@ class ReadableCollectionProxyModel::Private { public: Private() - : enableCheck( false ), hideVirtualFolder( false ), hideSpecificFolder( false ) + : enableCheck( false ), + hideVirtualFolder( false ), + hideSpecificFolder( false ) { } bool enableCheck; @@ -60,7 +62,7 @@ Qt::ItemFlags ReadableCollectionProxyModel::flags( const QModelIndex & index ) c if ( d->enableCheck ) { const QModelIndex sourceIndex = mapToSource( index.sibling( index.row(), 0 ) ); - Akonadi::Collection collection = sourceModel()->data( sourceIndex, Akonadi::EntityTreeModel::CollectionRole ).value(); + const Akonadi::Collection collection = sourceModel()->data( sourceIndex, Akonadi::EntityTreeModel::CollectionRole ).value(); if ( ! ( collection.rights() & Akonadi::Collection::CanCreateItem ) ) { return Future::KRecursiveFilterProxyModel::flags( index ) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);