History

cleanup

howard-stearns committed 7 years ago

Commit cc7214f1 parent 2eb3fdb2 files · +14 −19Browse files

Unified · Split

2 files
  1. interface/src/Application.cpp +0 −6
  2. interface/src/MacHelper.cpp +14 −13
interface/src/Application.cpp+0−6
@@ -2836,20 +2836,17 @@ void Application::cleanupBeforeQuit() { · 2835 unmodified lines
28362836 }
28372837
28382838 Application::~Application() {
2839− qCInfo(interfaceapp) << "HRS FIXME Quit 1";
28402839 // remove avatars from physics engine
28412840 auto avatarManager = DependencyManager::get<AvatarManager>();
28422841 avatarManager->clearOtherAvatars();
28432842 auto myCharacterController = getMyAvatar()->getCharacterController();
28442843 myCharacterController->clearDetailedMotionStates();
2845− qCInfo(interfaceapp) << "HRS FIXME Quit 2";
28462844
28472845 PhysicsEngine::Transaction transaction;
28482846 avatarManager->buildPhysicsTransaction(transaction);
28492847 _physicsEngine->processTransaction(transaction);
28502848 avatarManager->handleProcessedPhysicsTransaction(transaction);
28512849 avatarManager->deleteAllAvatars();
2852− qCInfo(interfaceapp) << "HRS FIXME Quit 3";
28532850
28542851 _physicsEngine->setCharacterController(nullptr);
28552852
@@ -2860,12 +2857,9 @@ Application::~Application() { · 4 unmodified lines
28602857 // shutdown graphics engine
28612858 _graphicsEngine.shutdown();
28622859
2863− qCInfo(interfaceapp) << "HRS FIXME Quit 4";
28642860 _gameWorkload.shutdown();
2865− qCInfo(interfaceapp) << "HRS FIXME Quit 5";
28662861
28672862 DependencyManager::destroy<Preferences>();
2868− qCInfo(interfaceapp) << "HRS FIXME Quit 6";
28692863 #ifdef Q_OS_MAC
28702864 DependencyManager::destroy<MacHelper>();
28712865 #endif
interface/src/MacHelper.cpp+14−13
@@ -11,32 +11,34 @@ · 10 unmodified lines
1111
1212 #include "InterfaceLogging.h"
1313 #include "MacHelper.h"
14+#include <NodeList.h>
1415
1516 #ifdef Q_OS_MAC
16−#include <IOKit/pwr_mgt/IOPMLib.h>
1717 #include <IOKit/IOMessage.h>
18−
19−io_connect_t root_port;
20−IONotificationPortRef notifyPortRef;
21−io_object_t notifierObject;
22−void* refCon;
18+#include <IOKit/pwr_mgt/IOPMLib.h>
19+
20+// These type definitions come from IOKit, which includes a definition of Duration that conflicts with ours.
21+// So... we include these definitions here rather than in the .h, as the .h is included in Application.cpp which
22+// uses Duration.
23+static io_connect_t root_port;
24+static IONotificationPortRef notifyPortRef;
25+static io_object_t notifierObject;
26+static void* refCon;
2327
24−void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) {
25− qCInfo(interfaceapp) << "HRS FIXME sleepHandler.";
28+static void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) {
2629 if (messageType == kIOMessageSystemHasPoweredOn) {
27− qCInfo(interfaceapp) << "HRS FIXME Waking up from sleep or hybernation.";
30+ qCInfo(interfaceapp) << "Waking up from sleep or hybernation.";
31+ QMetaObject::invokeMethod(DependencyManager::get<NodeList>().data(), "noteAwakening", Qt::QueuedConnection);
2832 }
2933 }
3034 #endif
3135
3236 MacHelper::MacHelper() {
33− qCInfo(interfaceapp) << "HRS FIXME Start MacHelper.";
3437 #ifdef Q_OS_MAC
3538 root_port = IORegisterForSystemPower(refCon, &notifyPortRef, sleepHandler, &notifierObject);
3639 if (root_port == 0) {
3740 qCWarning(interfaceapp) << "IORegisterForSystemPower failed";
38− } else {
39− qCDebug(interfaceapp) << "HRS FIXME IORegisterForSystemPower OK";
41+ return;
4042 }
4143 CFRunLoopAddSource(CFRunLoopGetCurrent(),
4244 IONotificationPortGetRunLoopSource(notifyPortRef),
@@ -45,7 +47,6 @@ MacHelper::MacHelper() { · 2 unmodified lines
4547 }
4648
4749 MacHelper::~MacHelper() {
48− qCInfo(interfaceapp) << "HRS FIXME End MacHelper.";
4950 #ifdef Q_OS_MAC
5051 CFRunLoopRemoveSource(CFRunLoopGetCurrent(),
5152 IONotificationPortGetRunLoopSource(notifyPortRef),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t