VirtualBox

Changeset 99436 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 18, 2023 7:29:08 AM (21 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10407. An addendum to r156894.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp

    r99435 r99436  
    174174}
    175175
    176 bool X11CheckDBusConnection(const QDBusConnection &connection)
     176bool checkDBusConnection(const QDBusConnection &connection)
    177177{
    178178    if (!connection.isConnected())
     
    192192}
    193193
    194 QStringList X11FindDBusScreenSaverServices(const QDBusConnection &connection)
     194QStringList findDBusScreenSaverServices(const QDBusConnection &connection)
    195195{
    196196    QStringList serviceNames;
     
    220220{
    221221    QDBusConnection connection = QDBusConnection::sessionBus();
    222     if (!X11CheckDBusConnection(connection))
     222    if (!checkDBusConnection(connection))
    223223        return false;
    224224
     
    241241}
    242242
    243 void X11IntrospectInterfaceNode(const QDomElement &interface,
     243void introspectDBusInterfaceNode(const QDomElement &interface,
    244244                                const QString &strServiceName,
    245                                 QVector<X11ScreenSaverInhibitMethod*> &methods)
     245                                QVector<DBusScreenSaverInhibitMethod*> &methods)
    246246{
    247247    QDomElement child = interface.firstChildElement();
     
    250250        if (child.tagName() == "method" && child.attribute("name") == "Inhibit")
    251251        {
    252             X11ScreenSaverInhibitMethod *newMethod = new X11ScreenSaverInhibitMethod;
     252            DBusScreenSaverInhibitMethod *newMethod = new DBusScreenSaverInhibitMethod;
    253253            newMethod->m_iCookie = 0;
    254254            newMethod->m_strServiceName = strServiceName;
     
    266266                           const QString &strService,
    267267                           const QString &strPath,
    268                            QVector<X11ScreenSaverInhibitMethod*> &methods)
     268                           QVector<DBusScreenSaverInhibitMethod*> &methods)
    269269{
    270270    QDBusMessage call = QDBusMessage::createMethodCall(strService, strPath.isEmpty() ? QLatin1String("/") : strPath,
     
    288288        }
    289289        else if (child.tagName() == QLatin1String("interface"))
    290             X11IntrospectInterfaceNode(child, strService, methods);
     290            introspectDBusInterfaceNode(child, strService, methods);
    291291        child = child.nextSiblingElement();
    292292    }
    293293}
    294294
    295 QVector<X11ScreenSaverInhibitMethod*> NativeWindowSubsystem::findDBusScrenSaverInhibitMethods()
    296 {
    297     QVector<X11ScreenSaverInhibitMethod*> methods;
     295QVector<DBusScreenSaverInhibitMethod*> NativeWindowSubsystem::findDBusScrenSaverInhibitMethods()
     296{
     297    QVector<DBusScreenSaverInhibitMethod*> methods;
    298298
    299299    QDBusConnection connection = QDBusConnection::sessionBus();
    300     if (!X11CheckDBusConnection(connection))
     300    if (!checkDBusConnection(connection))
    301301        return methods;
    302302
    303     QStringList services = X11FindDBusScreenSaverServices(connection);
     303    QStringList services = findDBusScreenSaverServices(connection);
    304304    foreach(const QString &strServiceName, services)
    305305        introspectDBusServices(connection, strServiceName, "", methods);
     
    308308}
    309309
    310 void NativeWindowSubsystem::toggleHostScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods)
     310void NativeWindowSubsystem::toggleHostScrenSaver(bool fInhibit, QVector<DBusScreenSaverInhibitMethod*> &inOutInhibitMethods)
    311311{
    312312    QDBusConnection connection = QDBusConnection::sessionBus();
    313     if (!X11CheckDBusConnection(connection))
     313    if (!checkDBusConnection(connection))
    314314        return;
    315315    for (int i = 0; i < inOutInhibitMethods.size(); ++i)
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h

    r99435 r99436  
    6464
    6565/** X11: Screen-saver inhibit methods. */
    66 struct SHARED_LIBRARY_STUFF X11ScreenSaverInhibitMethod
     66struct SHARED_LIBRARY_STUFF DBusScreenSaverInhibitMethod
    6767{
    6868    QString  m_strServiceName;
     
    128128    bool checkDBusScreenSaverServices();
    129129    /** DBus: Returns the list of Inhibit methods found by introspecting DBus services. */
    130     SHARED_LIBRARY_STUFF QVector<X11ScreenSaverInhibitMethod*> findDBusScrenSaverInhibitMethods();
     130    SHARED_LIBRARY_STUFF QVector<DBusScreenSaverInhibitMethod*> findDBusScrenSaverInhibitMethods();
    131131    /** DBus: Disables/enables Screen Saver through QDBus. */
    132     SHARED_LIBRARY_STUFF void toggleHostScrenSaver(bool fInhibit, QVector<X11ScreenSaverInhibitMethod*> &inOutInhibitMethods);
     132    SHARED_LIBRARY_STUFF void toggleHostScrenSaver(bool fInhibit, QVector<DBusScreenSaverInhibitMethod*> &inOutInhibitMethods);
    133133
    134134    /** Wrapper function for X11ActivateWindow or WaylandActivateWindow. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r99134 r99436  
    5353class CVirtualBoxErrorInfo;
    5454#if defined(VBOX_WS_X11)
    55  struct X11ScreenSaverInhibitMethod;
     55 struct DBusScreenSaverInhibitMethod;
    5656#endif
    5757
     
    406406    QMap<QString, uint> m_screenSaverInhibitionCookies;
    407407#if defined(VBOX_WS_X11)
    408     QVector<X11ScreenSaverInhibitMethod*> m_methods;
     408    QVector<DBusScreenSaverInhibitMethod*> m_methods;
    409409#endif
    410410};
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette