Emit toolTipMainTextChanged if it changes in response to a title change

Summary:
The fallback for toolTipMainText is showing the applet title.

When the applet title changes, it may result in a change of
toolTipMainText.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3760
This commit is contained in:
David Edmundson 2016-12-20 12:09:52 +00:00
parent 63a889ea0d
commit 17f5a3073b

View File

@ -82,6 +82,13 @@ AppletInterface::AppletInterface(DeclarativeAppletScript *script, const QVariant
connect(applet(), &Plasma::Applet::titleChanged,
this, &AppletInterface::titleChanged);
connect(applet(), &Plasma::Applet::titleChanged,
this, [this]() {
if (m_toolTipMainText.isNull()) {
emit toolTipMainTextChanged();
}
});
connect(applet(), &Plasma::Applet::iconChanged,
this, &AppletInterface::iconChanged);