D17049: Remove option to hide application name from titlebar

Glenn Coombs glenn.coombs at gmail.com
Tue Nov 27 01:24:30 GMT 2018


I made a change locally to the updateWindowCaption() function in
MainWindow.cpp:

void MainWindow::updateWindowCaption()
{
    if (_pluggedController.isNull()) {
        return;
    }

    const QString &title = _pluggedController->title();
    const QString &userTitle = _pluggedController->userTitle();

    // use tab title as caption by default
    QString caption = title;

    // use window title as caption when this setting is enabled
    // if the userTitle is empty, use a blank space (using an empty string
    // removes the dash — before the application name; leaving the dash
    // looks better)
    if (KonsoleSettings::showWindowTitleOnTitleBar()) {
        !userTitle.isEmpty() ? caption = userTitle : caption =
QStringLiteral(" ");
    }

    if (KonsoleSettings::showAppNameOnTitleBar()) {
        QApplication::setApplicationDisplayName("Konsole");
        setCaption(caption);
    } else {
        QApplication::setApplicationDisplayName("");
        setPlainCaption(caption);
    }
}

which seems to work for me.  I have to restart Konsole after changing the
showWindowOnTitleBar setting but it does correctly hide/show the " -
Konsole" string.

On Sun, 25 Nov 2018 at 20:17, Andrew Smith <noreply at phabricator.kde.org>
wrote:

> EspadaV8 added a comment. View Revision
> <https://phabricator.kde.org/D17049>
>
> @glenncoombs <https://phabricator.kde.org/p/glenncoombs/> I just had a
> look at doing that and it doesn't work out well. You can remove it but to
> do it I needed to remove the details from the KAboutData section (first
> and second lines below). Replacing konsole on the first line and Konsole
> for the @title does remove the suffix, but the about screen then loses
> the information. Calling app->setApplicationDisplayName(QString(""));
> after that (or before) doesn't do anything.
>
> main.cpp:113
>
> KAboutData about(QStringLiteral("konsole"),
>                  i18nc("@title", "Konsole"),
>                  QStringLiteral(KONSOLE_VERSION),
>                  i18nc("@title", "Terminal emulator"),
>                  KAboutLicense::GPL_V2,
>                  i18nc("@info:credit", "(c) 1997-2017, The Konsole Developers"),
>                  QString(),
>                  QStringLiteral("https://konsole.kde.org/"));
>
>
> *REPOSITORY*
> R319 Konsole
>
> *REVISION DETAIL*
> https://phabricator.kde.org/D17049
>
> *To: *EspadaV8, Konsole, konsole-devel, hindenburg
> *Cc: *glenncoombs, konsole-devel, ngraham, maximilianocuria, hindenburg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20181127/153afa84/attachment.html>


More information about the konsole-devel mailing list