svn path=/trunk/KDE/kdepim/kmail/; revision=1138776
wilder-work
Laurent Montel 16 years ago
parent 6133dab88a
commit e821588e04
  1. 22
      foldertreeview.cpp
  2. 2
      kmmainwidget.cpp
  3. 8
      readablecollectionproxymodel.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 <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();

@ -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() ) {

@ -1,5 +1,5 @@
/*
Copyright (c) 2009 Laurent Montel <montel@kde.org>
Copyright (c) 2009, 2010 Laurent Montel <montel@kde.org>
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<Akonadi::Collection>();
const Akonadi::Collection collection = sourceModel()->data( sourceIndex, Akonadi::EntityTreeModel::CollectionRole ).value<Akonadi::Collection>();
if ( ! ( collection.rights() & Akonadi::Collection::CanCreateItem ) ) {
return Future::KRecursiveFilterProxyModel::flags( index ) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

Loading…
Cancel
Save