Tidy logging (+whitespace) in Mac 3Dconnexion

This commit is contained in:
Ian Rees
2016-01-23 19:16:06 +13:00
parent ada6ad5d89
commit b5688aade5
2 changed files with 35 additions and 32 deletions

View File

@@ -73,18 +73,14 @@ Gui::GUIApplicationNativeEventAware::~GUIApplicationNativeEventAware()
#endif
//mac
#ifdef Q_WS_MACX
/* make sure the framework is installed */
if (InstallConnexionHandlers == NULL)
{
Base::Console().Log("3Dconnexion framework not found!\n");
return;
}
/* close the connection with the 3dx driver */
//std::cerr << "tdxClientID: " << tdxClientID << std::endl;
if (tdxClientID)
UnregisterConnexionClient(tdxClientID);
CleanupConnexionHandlers();
Base::Console().Log("Disconnected from 3DConnexion driver\n");
// if 3Dconnexion library was loaded at runtime
if (InstallConnexionHandlers) {
// Close our connection with the 3dx driver
if (tdxClientID)
UnregisterConnexionClient(tdxClientID);
CleanupConnexionHandlers();
Base::Console().Log("Disconnected from 3Dconnexion driver\n");
}
#endif
#endif
}
@@ -123,33 +119,33 @@ void Gui::GUIApplicationNativeEventAware::initSpaceball(QMainWindow *window)
OSStatus err;
/* make sure the framework is installed */
if (InstallConnexionHandlers == NULL)
{
{
Base::Console().Log("3Dconnexion framework not found!\n");
return;
}
}
/* install 3dx message handler in order to receive driver events */
err = InstallConnexionHandlers(tdx_drv_handler, 0L, 0L);
assert(err == 0);
if (err)
{
{
Base::Console().Log("Error installing 3Dconnexion handler\n");
return;
}
}
/* register our app with the driver */
//Pascal string Application name required to register driver for application
// Pascal string Application name required to register driver for application
UInt8 tdxAppName[] = {7,'F','r','e','e','C','A','D'};
//32bit appID to register driver for application
// 32bit appID to register driver for application
UInt32 tdxAppID = 'FCAd';
//std::cerr << "tdxClientID: " << tdxClientID << std::endl;
tdxClientID = RegisterConnexionClient(tdxAppID, tdxAppName, kConnexionClientModeTakeOver, kConnexionMaskAll);
//std::cerr << "tdxClientID: " << tdxClientID << std::endl;
tdxClientID = RegisterConnexionClient( tdxAppID, tdxAppName,
kConnexionClientModeTakeOver,
kConnexionMaskAll );
if (tdxClientID == 0)
{
{
Base::Console().Log("Couldn't connect to 3Dconnexion driver\n");
return;
}
}
Base::Console().Log("3Dconnexion device initialized. Client ID: %d\n", tdxClientID);
Base::Console().Log("3Dconnexion driver initialized. Client ID: %d\n", tdxClientID);
spaceballPresent = true;
#endif
#endif // _USE_3DCONNEXION_SDK