Changeset 99436 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 18, 2023 7:29:08 AM (21 months ago)
- 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 174 174 } 175 175 176 bool X11CheckDBusConnection(const QDBusConnection &connection)176 bool checkDBusConnection(const QDBusConnection &connection) 177 177 { 178 178 if (!connection.isConnected()) … … 192 192 } 193 193 194 QStringList X11FindDBusScreenSaverServices(const QDBusConnection &connection)194 QStringList findDBusScreenSaverServices(const QDBusConnection &connection) 195 195 { 196 196 QStringList serviceNames; … … 220 220 { 221 221 QDBusConnection connection = QDBusConnection::sessionBus(); 222 if (! X11CheckDBusConnection(connection))222 if (!checkDBusConnection(connection)) 223 223 return false; 224 224 … … 241 241 } 242 242 243 void X11IntrospectInterfaceNode(const QDomElement &interface,243 void introspectDBusInterfaceNode(const QDomElement &interface, 244 244 const QString &strServiceName, 245 QVector< X11ScreenSaverInhibitMethod*> &methods)245 QVector<DBusScreenSaverInhibitMethod*> &methods) 246 246 { 247 247 QDomElement child = interface.firstChildElement(); … … 250 250 if (child.tagName() == "method" && child.attribute("name") == "Inhibit") 251 251 { 252 X11ScreenSaverInhibitMethod *newMethod = new X11ScreenSaverInhibitMethod;252 DBusScreenSaverInhibitMethod *newMethod = new DBusScreenSaverInhibitMethod; 253 253 newMethod->m_iCookie = 0; 254 254 newMethod->m_strServiceName = strServiceName; … … 266 266 const QString &strService, 267 267 const QString &strPath, 268 QVector< X11ScreenSaverInhibitMethod*> &methods)268 QVector<DBusScreenSaverInhibitMethod*> &methods) 269 269 { 270 270 QDBusMessage call = QDBusMessage::createMethodCall(strService, strPath.isEmpty() ? QLatin1String("/") : strPath, … … 288 288 } 289 289 else if (child.tagName() == QLatin1String("interface")) 290 X11IntrospectInterfaceNode(child, strService, methods);290 introspectDBusInterfaceNode(child, strService, methods); 291 291 child = child.nextSiblingElement(); 292 292 } 293 293 } 294 294 295 QVector< X11ScreenSaverInhibitMethod*> NativeWindowSubsystem::findDBusScrenSaverInhibitMethods()296 { 297 QVector< X11ScreenSaverInhibitMethod*> methods;295 QVector<DBusScreenSaverInhibitMethod*> NativeWindowSubsystem::findDBusScrenSaverInhibitMethods() 296 { 297 QVector<DBusScreenSaverInhibitMethod*> methods; 298 298 299 299 QDBusConnection connection = QDBusConnection::sessionBus(); 300 if (! X11CheckDBusConnection(connection))300 if (!checkDBusConnection(connection)) 301 301 return methods; 302 302 303 QStringList services = X11FindDBusScreenSaverServices(connection);303 QStringList services = findDBusScreenSaverServices(connection); 304 304 foreach(const QString &strServiceName, services) 305 305 introspectDBusServices(connection, strServiceName, "", methods); … … 308 308 } 309 309 310 void NativeWindowSubsystem::toggleHostScrenSaver(bool fInhibit, QVector< X11ScreenSaverInhibitMethod*> &inOutInhibitMethods)310 void NativeWindowSubsystem::toggleHostScrenSaver(bool fInhibit, QVector<DBusScreenSaverInhibitMethod*> &inOutInhibitMethods) 311 311 { 312 312 QDBusConnection connection = QDBusConnection::sessionBus(); 313 if (! X11CheckDBusConnection(connection))313 if (!checkDBusConnection(connection)) 314 314 return; 315 315 for (int i = 0; i < inOutInhibitMethods.size(); ++i) -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h
r99435 r99436 64 64 65 65 /** X11: Screen-saver inhibit methods. */ 66 struct SHARED_LIBRARY_STUFF X11ScreenSaverInhibitMethod66 struct SHARED_LIBRARY_STUFF DBusScreenSaverInhibitMethod 67 67 { 68 68 QString m_strServiceName; … … 128 128 bool checkDBusScreenSaverServices(); 129 129 /** 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(); 131 131 /** 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); 133 133 134 134 /** Wrapper function for X11ActivateWindow or WaylandActivateWindow. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r99134 r99436 53 53 class CVirtualBoxErrorInfo; 54 54 #if defined(VBOX_WS_X11) 55 struct X11ScreenSaverInhibitMethod;55 struct DBusScreenSaverInhibitMethod; 56 56 #endif 57 57 … … 406 406 QMap<QString, uint> m_screenSaverInhibitionCookies; 407 407 #if defined(VBOX_WS_X11) 408 QVector< X11ScreenSaverInhibitMethod*> m_methods;408 QVector<DBusScreenSaverInhibitMethod*> m_methods; 409 409 #endif 410 410 };
Note:
See TracChangeset
for help on using the changeset viewer.