mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Return nullptr if there are no tray icons
This commit is contained in:
parent
51dc7fceb0
commit
86b6ddb625
@ -390,7 +390,8 @@ QSystemTrayIcon* Utils::GetTrayIcon() {
|
|||||||
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
|
QMainWindow* main = (QMainWindow*)obs_frontend_get_main_window();
|
||||||
if (!main) return nullptr;
|
if (!main) return nullptr;
|
||||||
|
|
||||||
return main->findChildren<QSystemTrayIcon*>().first();
|
QList<QSystemTrayIcon*> trays = main->findChildren<QSystemTrayIcon*>();
|
||||||
|
return trays.isEmpty() ? nullptr : trays.first();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utils::SysTrayNotify(QString text,
|
void Utils::SysTrayNotify(QString text,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user