QSystemTrayIconPrivate: replace inline _qpa_ stubs with direct calls
Change-Id: If82381199ed9fadc2dfacc84e63d5e3b05ae336c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
e8892c7e7a
commit
efe6efe627
|
|
@ -699,39 +699,6 @@ void QSystemTrayIconPrivate::remove_sys_qpa()
|
|||
qpa_sys->cleanup();
|
||||
}
|
||||
|
||||
QRect QSystemTrayIconPrivate::geometry_sys_qpa() const
|
||||
{
|
||||
return qpa_sys->geometry();
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateIcon_sys_qpa()
|
||||
{
|
||||
qpa_sys->updateIcon(icon);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateMenu_sys_qpa()
|
||||
{
|
||||
if (menu) {
|
||||
addPlatformMenu(menu);
|
||||
qpa_sys->updateMenu(menu->platformMenu());
|
||||
}
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateToolTip_sys_qpa()
|
||||
{
|
||||
qpa_sys->updateToolTip(toolTip);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::showMessage_sys_qpa(const QString &title,
|
||||
const QString &message,
|
||||
const QIcon &icon,
|
||||
QSystemTrayIcon::MessageIcon msgIcon,
|
||||
int msecs)
|
||||
{
|
||||
qpa_sys->showMessage(title, message, icon,
|
||||
static_cast<QPlatformSystemTrayIcon::MessageIcon>(msgIcon), msecs);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
||||
{
|
||||
if (menu->platformMenu())
|
||||
|
|
|
|||
|
|
@ -102,12 +102,7 @@ public:
|
|||
private:
|
||||
void install_sys_qpa();
|
||||
void remove_sys_qpa();
|
||||
void updateIcon_sys_qpa();
|
||||
void updateToolTip_sys_qpa();
|
||||
void updateMenu_sys_qpa();
|
||||
QRect geometry_sys_qpa() const;
|
||||
void showMessage_sys_qpa(const QString &title, const QString &msg, const QIcon &icon,
|
||||
QSystemTrayIcon::MessageIcon msgIcon, int msecs);
|
||||
|
||||
void addPlatformMenu(QMenu *menu) const;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ void QSystemTrayIconPrivate::remove_sys()
|
|||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
||||
{
|
||||
if (qpa_sys)
|
||||
return geometry_sys_qpa();
|
||||
return qpa_sys->geometry();
|
||||
else
|
||||
return QRect();
|
||||
}
|
||||
|
|
@ -84,19 +84,21 @@ QRect QSystemTrayIconPrivate::geometry_sys() const
|
|||
void QSystemTrayIconPrivate::updateIcon_sys()
|
||||
{
|
||||
if (qpa_sys)
|
||||
updateIcon_sys_qpa();
|
||||
qpa_sys->updateIcon(icon);
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||
{
|
||||
if (qpa_sys)
|
||||
updateMenu_sys_qpa();
|
||||
if (qpa_sys && menu) {
|
||||
addPlatformMenu(menu);
|
||||
qpa_sys->updateMenu(menu->platformMenu());
|
||||
}
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||
{
|
||||
if (qpa_sys)
|
||||
updateToolTip_sys_qpa();
|
||||
qpa_sys->updateToolTip(toolTip);
|
||||
}
|
||||
|
||||
bool QSystemTrayIconPrivate::isSystemTrayAvailable_sys()
|
||||
|
|
@ -121,7 +123,8 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString
|
|||
const QIcon &icon, QSystemTrayIcon::MessageIcon msgIcon, int msecs)
|
||||
{
|
||||
if (qpa_sys)
|
||||
showMessage_sys_qpa(title, message, icon, msgIcon, msecs);
|
||||
qpa_sys->showMessage(title, message, icon,
|
||||
static_cast<QPlatformSystemTrayIcon::MessageIcon>(msgIcon), msecs);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ void QSystemTrayIconPrivate::install_sys()
|
|||
QRect QSystemTrayIconPrivate::geometry_sys() const
|
||||
{
|
||||
if (qpa_sys)
|
||||
return geometry_sys_qpa();
|
||||
return qpa_sys->geometry();
|
||||
if (!sys)
|
||||
return QRect();
|
||||
return sys->globalGeometry();
|
||||
|
|
@ -307,7 +307,7 @@ void QSystemTrayIconPrivate::remove_sys()
|
|||
void QSystemTrayIconPrivate::updateIcon_sys()
|
||||
{
|
||||
if (qpa_sys) {
|
||||
updateIcon_sys_qpa();
|
||||
qpa_sys->updateIcon(icon);
|
||||
return;
|
||||
}
|
||||
if (sys)
|
||||
|
|
@ -316,14 +316,16 @@ void QSystemTrayIconPrivate::updateIcon_sys()
|
|||
|
||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||
{
|
||||
if (qpa_sys)
|
||||
updateMenu_sys_qpa();
|
||||
if (qpa_sys && menu) {
|
||||
addPlatformMenu(menu);
|
||||
qpa_sys->updateMenu(menu->platformMenu());
|
||||
}
|
||||
}
|
||||
|
||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||
{
|
||||
if (qpa_sys) {
|
||||
updateToolTip_sys_qpa();
|
||||
qpa_sys->updateToolTip(toolTip);
|
||||
return;
|
||||
}
|
||||
if (!sys)
|
||||
|
|
@ -360,7 +362,8 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString
|
|||
const QIcon &icon, QSystemTrayIcon::MessageIcon msgIcon, int msecs)
|
||||
{
|
||||
if (qpa_sys) {
|
||||
showMessage_sys_qpa(title, message, icon, msgIcon, msecs);
|
||||
qpa_sys->showMessage(title, message, icon,
|
||||
static_cast<QPlatformSystemTrayIcon::MessageIcon>(msgIcon), msecs);
|
||||
return;
|
||||
}
|
||||
if (!sys)
|
||||
|
|
|
|||
Loading…
Reference in New Issue