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
2836}2836}
2837 2837
2838Application::~Application() {2838Application::~Application() {
2839 qCInfo(interfaceapp) << "HRS FIXME Quit 1";
2840 // remove avatars from physics engine2839 // remove avatars from physics engine
2841 auto avatarManager = DependencyManager::get<AvatarManager>();2840 auto avatarManager = DependencyManager::get<AvatarManager>();
2842 avatarManager->clearOtherAvatars();2841 avatarManager->clearOtherAvatars();
2843 auto myCharacterController = getMyAvatar()->getCharacterController();2842 auto myCharacterController = getMyAvatar()->getCharacterController();
2844 myCharacterController->clearDetailedMotionStates();2843 myCharacterController->clearDetailedMotionStates();
2845 qCInfo(interfaceapp) << "HRS FIXME Quit 2";
2846 2844
2847 PhysicsEngine::Transaction transaction;2845 PhysicsEngine::Transaction transaction;
2848 avatarManager->buildPhysicsTransaction(transaction);2846 avatarManager->buildPhysicsTransaction(transaction);
2849 _physicsEngine->processTransaction(transaction);2847 _physicsEngine->processTransaction(transaction);
2850 avatarManager->handleProcessedPhysicsTransaction(transaction);2848 avatarManager->handleProcessedPhysicsTransaction(transaction);
2851 avatarManager->deleteAllAvatars();2849 avatarManager->deleteAllAvatars();
2852 qCInfo(interfaceapp) << "HRS FIXME Quit 3";
2853 2850
2854 _physicsEngine->setCharacterController(nullptr);2851 _physicsEngine->setCharacterController(nullptr);
2855 2852
@@ -2860,12 +2857,9 @@ Application::~Application() { · 4 unmodified lines
2860 // shutdown graphics engine2857 // shutdown graphics engine
2861 _graphicsEngine.shutdown();2858 _graphicsEngine.shutdown();
2862 2859
2863 qCInfo(interfaceapp) << "HRS FIXME Quit 4";
2864 _gameWorkload.shutdown();2860 _gameWorkload.shutdown();
2865 qCInfo(interfaceapp) << "HRS FIXME Quit 5";
2866 2861
2867 DependencyManager::destroy<Preferences>();2862 DependencyManager::destroy<Preferences>();
2868 qCInfo(interfaceapp) << "HRS FIXME Quit 6";
2869#ifdef Q_OS_MAC2863#ifdef Q_OS_MAC
2870 DependencyManager::destroy<MacHelper>();2864 DependencyManager::destroy<MacHelper>();
2871#endif2865#endif
interface/src/MacHelper.cpp+14−13
@@ -11,32 +11,34 @@ · 10 unmodified lines
11 11
12#include "InterfaceLogging.h"12#include "InterfaceLogging.h"
13#include "MacHelper.h"13#include "MacHelper.h"
14#include <NodeList.h>
14 15
15#ifdef Q_OS_MAC16#ifdef Q_OS_MAC
16#include <IOKit/pwr_mgt/IOPMLib.h>
17#include <IOKit/IOMessage.h>17#include <IOKit/IOMessage.h>
18 18#include <IOKit/pwr_mgt/IOPMLib.h>
19io_connect_t root_port;19
20IONotificationPortRef notifyPortRef;20// These type definitions come from IOKit, which includes a definition of Duration that conflicts with ours.
21io_object_t notifierObject;21// So... we include these definitions here rather than in the .h, as the .h is included in Application.cpp which
22void* refCon;22// uses Duration.
23static io_connect_t root_port;
24static IONotificationPortRef notifyPortRef;
25static io_object_t notifierObject;
26static void* refCon;
23 27
24void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) {28static void sleepHandler(void* refCon, io_service_t service, natural_t messageType, void* messageArgument) {
25 qCInfo(interfaceapp) << "HRS FIXME sleepHandler.";
26 if (messageType == kIOMessageSystemHasPoweredOn) {29 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);
28 }32 }
29}33}
30#endif34#endif
31 35
32MacHelper::MacHelper() {36MacHelper::MacHelper() {
33 qCInfo(interfaceapp) << "HRS FIXME Start MacHelper.";
34#ifdef Q_OS_MAC37#ifdef Q_OS_MAC
35 root_port = IORegisterForSystemPower(refCon, &notifyPortRef, sleepHandler, &notifierObject);38 root_port = IORegisterForSystemPower(refCon, &notifyPortRef, sleepHandler, &notifierObject);
36 if (root_port == 0) {39 if (root_port == 0) {
37 qCWarning(interfaceapp) << "IORegisterForSystemPower failed";40 qCWarning(interfaceapp) << "IORegisterForSystemPower failed";
38 } else {41 return;
39 qCDebug(interfaceapp) << "HRS FIXME IORegisterForSystemPower OK";
40 }42 }
41 CFRunLoopAddSource(CFRunLoopGetCurrent(),43 CFRunLoopAddSource(CFRunLoopGetCurrent(),
42 IONotificationPortGetRunLoopSource(notifyPortRef),44 IONotificationPortGetRunLoopSource(notifyPortRef),
@@ -45,7 +47,6 @@ MacHelper::MacHelper() { · 2 unmodified lines
45}47}
46 48
47MacHelper::~MacHelper() {49MacHelper::~MacHelper() {
48 qCInfo(interfaceapp) << "HRS FIXME End MacHelper.";
49#ifdef Q_OS_MAC50#ifdef Q_OS_MAC
50 CFRunLoopRemoveSource(CFRunLoopGetCurrent(),51 CFRunLoopRemoveSource(CFRunLoopGetCurrent(),
51 IONotificationPortGetRunLoopSource(notifyPortRef),52 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