2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Log global menu usage

This commit is contained in:
Ilya Fedin
2020-03-28 07:34:13 +04:00
committed by John Preston
parent aa4968faaa
commit 86b9927965

View File

@@ -291,6 +291,14 @@ std::unique_ptr<QTemporaryFile> TrayIconFile(
return ret;
}
bool UseUnityCounter() {
static const auto UnityCounter = QDBusInterface(
"com.canonical.Unity",
"/").isValid();
return UnityCounter;
}
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
bool IsSNIAvailable() {
@@ -319,18 +327,6 @@ bool IsSNIAvailable() {
return false;
}
bool UseUnityCounter() {
#ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION
static const auto UnityCounter = false;
#else // TDESKTOP_DISABLE_DBUS_INTEGRATION
static const auto UnityCounter = QDBusInterface(
"com.canonical.Unity",
"/").isValid();
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
return UnityCounter;
}
quint32 djbStringHash(QString string) {
quint32 hash = 5381;
QByteArray chars = string.toLatin1();
@@ -438,13 +434,19 @@ void MainWindow::initHook() {
&QWindow::visibleChanged,
this,
&MainWindow::onVisibleChanged);
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
if (AppMenuSupported()) {
LOG(("Using D-Bus global menu."));
} else {
LOG(("Not using D-Bus global menu."));
}
if (UseUnityCounter()) {
LOG(("Using Unity launcher counter."));
} else {
LOG(("Not using Unity launcher counter."));
}
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
}
bool MainWindow::hasTrayIcon() const {