Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 543243f8 authored by Laurent Montel's avatar Laurent Montel 😁

Minor

parent e79476cb
......@@ -421,7 +421,9 @@ bool ViewerPrivate::deleteAttachment(KMime::Content * node, bool showWarning)
return false; //cancelled
}
//don't confuse the model
#ifndef QT_NO_TREEVIEW
mMimePartTree->clearModel();
#endif
QString filename;
QString name;
QByteArray mimetype;
......@@ -456,7 +458,9 @@ bool ViewerPrivate::deleteAttachment(KMime::Content * node, bool showWarning)
parent->assemble();
KMime::Message* modifiedMessage = mNodeHelper->messageWithExtraContent( mMessage.get() );
#ifndef QT_NO_TREEVIEW
mMimePartTree->mimePartModel()->setRoot( modifiedMessage );
#endif
mMessageItem.setPayloadFromData( modifiedMessage->encodedContent() );
Akonadi::ItemModifyJob *job = new Akonadi::ItemModifyJob( mMessageItem );
job->disableRevisionCheck();
......@@ -831,7 +835,9 @@ void ViewerPrivate::displayMessage()
}
parseContent( mMessage.get() );
#ifndef QT_NO_TREEVIEW
mMimePartTree->setRoot( mNodeHelper->messageWithExtraContent( mMessage.get() ) );
#endif
mColorBar->update();
htmlWriter()->queue(QLatin1String("</body></html>"));
......@@ -1269,7 +1275,9 @@ void ViewerPrivate::resetStateForNewMessage()
mMessage.reset();
mNodeHelper->clear();
mMessagePartNode = 0;
#ifndef QT_NO_TREEVIEW
mMimePartTree->clearModel();
#endif
mSavedRelativePosition = 0;
setShowSignatureDetails( false );
mShowRawToltecMail = !GlobalSettings::self()->showToltecReplacementText();
......@@ -1300,9 +1308,10 @@ void ViewerPrivate::setMessageInternal( const KMime::Message::Ptr message,
if ( message ) {
mNodeHelper->setOverrideCodec( mMessage.get(), overrideCodec() );
}
#ifndef QT_NO_TREEVIEW
mMimePartTree->setRoot( mNodeHelper->messageWithExtraContent( message.get() ) );
update( updateMode );
#endif
}
void ViewerPrivate::setMessageItem( const Akonadi::Item &item, Viewer::UpdateMode updateMode )
......@@ -1373,7 +1382,7 @@ void ViewerPrivate::setMessagePart( KMime::Content * node )
void ViewerPrivate::showHideMimeTree( )
{
#ifndef QT_NO_TREEVIEW
if (mMimePartTree->model()->rowCount() == 0) {
if (mimePartTreeIsEmpty() && !mMimePartTree->isHidden()) {
mMimePartTree->hide();
return;
}
......@@ -2283,12 +2292,14 @@ void ViewerPrivate::updateReaderWin()
void ViewerPrivate::slotMimePartSelected( const QModelIndex &index )
{
#ifndef QT_NO_TREEVIEW
KMime::Content *content = static_cast<KMime::Content*>( index.internalPointer() );
if ( !mMimePartTree->mimePartModel()->parent( index ).isValid() && index.row() == 0 ) {
update( Viewer::Force );
} else {
setMessagePart( content );
}
#endif
}
void ViewerPrivate::slotBriefHeaders()
......@@ -2533,7 +2544,11 @@ void ViewerPrivate::showOpenAttachmentFolderWidget(const KUrl &url)
bool ViewerPrivate::mimePartTreeIsEmpty() const
{
#ifndef QT_NO_TREEVIEW
return (mMimePartTree->model()->rowCount() == 0);
#else
return false;
#endif
}
void ViewerPrivate::slotAttachmentSaveAs()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment