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 934ce6e2 authored by Laurent Montel's avatar Laurent Montel 😁

Update title when we switch folder.

Bug found by david
parent dcbaa5a5
......@@ -99,6 +99,7 @@ KMailPart::KMailPart(QWidget *parentWidget, QObject *parent, const QVariantList
setXMLFile(QStringLiteral("kmail_part.rc"), true);
KSettings::Dispatcher::registerComponent(QStringLiteral("kmail2"), mKMailKernel, "slotConfigChanged");
connect(mainWidget, &KMMainWidget::captionChangeRequest, this, &KMailPart::setWindowCaption);
}
KMailPart::~KMailPart()
......@@ -133,6 +134,13 @@ void KMailPart::guiActivateEvent(KParts::GUIActivateEvent *e)
mainWidget->updateVacationScriptStatus();
mainWidget->populateMessageListStatusFilterCombo();
mainWidget->initializePluginActions();
/*
FIXME it doesn't work when we switch component.
const QString title = mainWidget->fullCollectionPath();
if (!title.isEmpty()) {
Q_EMIT setWindowCaption(title);
}
*/
}
void KMailPart::exit()
......
......@@ -469,10 +469,18 @@ void KMMainWidget::slotCollectionFetched(int collectionId)
}
// We call this for any collection, it could be one of our parents...
if (mCurrentCollection.isValid()) {
Q_EMIT captionChangeRequest(MailCommon::Util::fullCollectionPath(mCurrentCollection));
Q_EMIT captionChangeRequest(fullCollectionPath());
}
}
QString KMMainWidget::fullCollectionPath() const
{
if (mCurrentCollection.isValid()) {
return MailCommon::Util::fullCollectionPath(mCurrentCollection);
}
return {};
}
void KMMainWidget::slotFolderChanged(const Akonadi::Collection &collection)
{
folderSelected(collection);
......
......@@ -202,6 +202,7 @@ public:
Akonadi::Item::List currentSelection() const;
QString fullCollectionPath() const;
public Q_SLOTS:
// Moving messages around
/**
......
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