From 3d98c3f9540200f66b256c943f791ab24876231e Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Wed, 14 May 2003 22:02:35 +0000 Subject: [PATCH] Patch by Sven to allow icons in the infowidget. The kmail part does not yet emit folder icons on normal folders, tho svn path=/trunk/kdepim/; revision=225909 --- kmail_part.cpp | 12 ++++++++++++ kmail_part.h | 1 + 2 files changed, 13 insertions(+) diff --git a/kmail_part.cpp b/kmail_part.cpp index b250f1b0f..e36c0c88a 100644 --- a/kmail_part.cpp +++ b/kmail_part.cpp @@ -140,6 +140,8 @@ KMailPart::KMailPart(QWidget *parentWidget, const char *widgetName, KParts::InfoExtension *ie = new KParts::InfoExtension( this, "KMailInfo" ); connect( mainWidget->folderTree(), SIGNAL(folderSelected(KMFolder*)), this, SLOT(exportFolder(KMFolder*)) ); connect( this, SIGNAL(textChanged(const QString&)), ie, SIGNAL(textChanged(const QString&)) ); + connect( this, SIGNAL(iconChanged(const QPixmap&)), ie, SIGNAL(iconChanged(const QPixmap&)) ); + #endif KGlobal::iconLoader()->addAppDir( "kmail" ); setXMLFile( "kmmainwin.rc" ); @@ -178,8 +180,18 @@ bool KMailPart::openFile() void KMailPart::exportFolder( KMFolder *folder ) { + KMFolderTreeItem* fti = static_cast< KMFolderTreeItem* >( mainWidget->folderTree()->currentItem() ); + if ( folder != 0 ) emit textChanged( folder->label() ); + + QPixmap pix; + if ( fti->normalIcon() != 0 ) + pix = *fti->normalIcon(); + else + pix = QPixmap(); + + emit iconChanged( pix ); } void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e) diff --git a/kmail_part.h b/kmail_part.h index fb6d1f844..9209acf97 100644 --- a/kmail_part.h +++ b/kmail_part.h @@ -67,6 +67,7 @@ class KMailPart: public KParts::ReadOnlyPart, virtual public KMailPartIface signals: void textChanged( const QString& ); + void iconChanged( const QPixmap& ); protected: virtual bool openFile();