~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to kmail/messagelistview/core/view.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-08-28 23:32:45 UTC
  • mto: This revision was merged to the branch mainline in revision 136.
  • Revision ID: james.westby@ubuntu.com-20090828233245-i7jr2n3f31iqll33
Tags: upstream-4.3.1
ImportĀ upstreamĀ versionĀ 4.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <QToolTip>
39
39
#include <QHeaderView>
40
40
#include <QTimer>
 
41
#include <QTextDocument>
41
42
 
42
43
#include <KMenu>
43
44
#include <KLocale>
101
102
  connect( selectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection & ) ),
102
103
           this, SLOT( slotSelectionChanged( const QItemSelection &, const QItemSelection & ) ) );
103
104
 
104
 
 
 
105
  // as in KDE3, when a root-item of a message thread is expanded, expand all children
 
106
  connect( this, SIGNAL( expanded ( const QModelIndex & ) ), this, SLOT( expandFullThread( const QModelIndex & ) ) );
105
107
}
106
108
 
107
109
View::~View()
865
867
  }
866
868
}
867
869
 
 
870
void View::expandFullThread( const QModelIndex & index )
 
871
{
 
872
  if ( ! index.isValid() )
 
873
    return;
 
874
 
 
875
  Item * item = static_cast< Item * >( index.internalPointer() );
 
876
  if ( item->type() != Item::Message )
 
877
    return;
 
878
 
 
879
  if ( ! static_cast< MessageItem * >( item )->parent() ||
 
880
       ( static_cast< MessageItem * >( item )->parent()->type() != Item::Message ) )
 
881
    setChildrenExpanded( item, true );
 
882
}
 
883
 
868
884
void View::setCurrentThreadExpanded( bool expand )
869
885
{
870
886
  MessageItem * message = currentMessageItem();
2157
2173
                "</div>" \
2158
2174
              "</td>" \
2159
2175
            "</tr>"
2160
 
        ).arg( txtColorName ).arg( bckColorName ).arg( mi->subject() );
 
2176
        ).arg( txtColorName ).arg( bckColorName ).arg( Qt::escape( mi->subject() ) );
2161
2177
 
2162
2178
      tip += QString::fromLatin1(
2163
2179
           "<tr>" \