[pim/kontact] src: mainwindow.cpp - fix the window caption when changing parts
Allen Winter <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit d8f6cf8f9c4c811a1947320fff408a6b59d2c160 by Allen Winter.
Committed on 26/07/2026 at 14:49.
Pushed by winterz into branch 'master'.
mainwindow.cpp - fix the window caption when changing parts
Somewhere along the way windowTitle() changed so that it can
return an empty string for unknown reasons.
This might be related to BUG 523380
M +2 -1 src/mainwindow.cpp
https://invent.kde.org/pim/kontact/-/commit/d8f6cf8f9c4c811a1947320fff408a6b59d2c160
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index bb1be5af..6e3701af 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -712,7 +712,8 @@ void MainWindow::selectPlugin(KontactInterface::Plugin *plugin)
// Only some parts (like kmail) set a caption in guiActivateEvent when being activated.
// For others, this is the default caption:
- if (windowTitle() == oldWindowTitle) {
+ const QString newWindowTitle = windowTitle();
+ if (newWindowTitle.isEmpty() || newWindowTitle == oldWindowTitle) {
setCaption(i18nc("@title:window Plugin dependent window title", "%1 - Kontact", plugin->title()));
}