mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Operate with QString instead of QDBusObjectPath
This commit is contained in:
parent
e594b75f4c
commit
e247be7e33
2 changed files with 8 additions and 9 deletions
|
@ -48,6 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include <QtDBus/QDBusMessage>
|
||||
#include <QtDBus/QDBusReply>
|
||||
#include <QtDBus/QDBusError>
|
||||
#include <QtDBus/QDBusObjectPath>
|
||||
#include <QtDBus/QDBusMetaType>
|
||||
|
||||
#include <statusnotifieritem.h>
|
||||
|
@ -451,7 +452,7 @@ bool IsAppMenuSupported() {
|
|||
return interface->isServiceRegistered(kAppMenuService.utf16());
|
||||
}
|
||||
|
||||
void RegisterAppMenu(uint winId, const QDBusObjectPath &menuPath) {
|
||||
void RegisterAppMenu(uint winId, const QString &menuPath) {
|
||||
auto message = QDBusMessage::createMethodCall(
|
||||
kAppMenuService.utf16(),
|
||||
kAppMenuObjectPath.utf16(),
|
||||
|
@ -460,7 +461,7 @@ void RegisterAppMenu(uint winId, const QDBusObjectPath &menuPath) {
|
|||
|
||||
message.setArguments({
|
||||
winId,
|
||||
QVariant::fromValue(menuPath)
|
||||
QVariant::fromValue(QDBusObjectPath(menuPath))
|
||||
});
|
||||
|
||||
QDBusConnection::sessionBus().send(message);
|
||||
|
@ -759,7 +760,7 @@ void MainWindow::handleAppMenuOwnerChanged(
|
|||
LOG(("Not using D-Bus global menu."));
|
||||
}
|
||||
|
||||
if (_appMenuSupported && !_mainMenuPath.path().isEmpty()) {
|
||||
if (_appMenuSupported && !_mainMenuPath.isEmpty()) {
|
||||
RegisterAppMenu(winId(), _mainMenuPath);
|
||||
} else {
|
||||
UnregisterAppMenu(winId());
|
||||
|
@ -1075,10 +1076,10 @@ void MainWindow::createGlobalMenu() {
|
|||
|
||||
about->setMenuRole(QAction::AboutQtRole);
|
||||
|
||||
_mainMenuPath.setPath(qsl("/MenuBar"));
|
||||
_mainMenuPath = qsl("/MenuBar");
|
||||
|
||||
_mainMenuExporter = new DBusMenuExporter(
|
||||
_mainMenuPath.path(),
|
||||
_mainMenuPath,
|
||||
psMainMenu);
|
||||
|
||||
if (_appMenuSupported) {
|
||||
|
@ -1214,7 +1215,7 @@ void MainWindow::handleVisibleChangedHook(bool visible) {
|
|||
}
|
||||
|
||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
if (_appMenuSupported && !_mainMenuPath.path().isEmpty()) {
|
||||
if (_appMenuSupported && !_mainMenuPath.isEmpty()) {
|
||||
if (visible) {
|
||||
RegisterAppMenu(winId(), _mainMenuPath);
|
||||
} else {
|
||||
|
|
|
@ -14,8 +14,6 @@ class PopupMenu;
|
|||
} // namespace Ui
|
||||
|
||||
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
#include <QtDBus/QDBusObjectPath>
|
||||
|
||||
class QTemporaryFile;
|
||||
class DBusMenuExporter;
|
||||
class StatusNotifierItem;
|
||||
|
@ -94,7 +92,7 @@ private:
|
|||
|
||||
bool _appMenuSupported = false;
|
||||
DBusMenuExporter *_mainMenuExporter = nullptr;
|
||||
QDBusObjectPath _mainMenuPath;
|
||||
QString _mainMenuPath;
|
||||
|
||||
std::unique_ptr<internal::GSDMediaKeys> _gsdMediaKeys;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue