avoid some more static/global QStrings in plugins

This commit is contained in:
Seth Alves 2016-11-13 11:29:19 -08:00
parent 9b4a8427e6
commit f8fb5b9709
10 changed files with 24 additions and 24 deletions

View file

@ -76,8 +76,8 @@ class SpacemouseManager : public InputPlugin, public QAbstractNativeEventFilter
Q_OBJECT
public:
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString& getID() const override { return NAME; }
const QString getName() const override { return NAME; }
const QString getID() const override { return NAME; }
bool activate() override;
void deactivate() override;
@ -127,7 +127,7 @@ private:
// use to calculate distance traveled since last event
DWORD fLast3dmouseInputTime;
static const QString NAME;
static const char* NAME;
friend class SpacemouseDevice;
};

View file

@ -25,9 +25,9 @@
Q_DECLARE_LOGGING_CATEGORY(oculus)
static const QString MENU_PARENT = "Avatar";
static const QString MENU_NAME = "Oculus Touch Controllers";
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
static const char* MENU_PARENT = "Avatar";
static const char* MENU_NAME = "Oculus Touch Controllers";
static const char* MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
const QString OculusControllerManager::NAME = "Oculus";

View file

@ -24,7 +24,7 @@ class OculusControllerManager : public InputPlugin {
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
bool isHandController() const override { return _touch != nullptr; }
QStringList getSubdeviceNames() override;
@ -95,7 +95,7 @@ private:
ovrInputState _inputState {};
RemoteDevice::Pointer _remote;
TouchDevice::Pointer _touch;
static const QString NAME;
static const char* NAME;
};
#endif // hifi__OculusControllerManager

View file

@ -8,7 +8,7 @@
#include "OculusDebugDisplayPlugin.h"
#include <QtCore/QProcessEnvironment>
const QString OculusDebugDisplayPlugin::NAME("Oculus Rift (Simulator)");
const char* OculusDebugDisplayPlugin::NAME { "Oculus Rift (Simulator)" };
static const QString DEBUG_FLAG("HIFI_DEBUG_OCULUS");
static bool enableDebugOculus = true || QProcessEnvironment::systemEnvironment().contains("HIFI_DEBUG_OCULUS");

View file

@ -11,7 +11,7 @@
class OculusDebugDisplayPlugin : public OculusBaseDisplayPlugin {
public:
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
grouping getGrouping() const override { return DEVELOPER; }
bool isSupported() const override;
@ -20,6 +20,6 @@ protected:
bool isHmdMounted() const override { return true; }
private:
static const QString NAME;
static const char* NAME;
};

View file

@ -13,7 +13,7 @@ class OculusDisplayPlugin : public OculusBaseDisplayPlugin {
using Parent = OculusBaseDisplayPlugin;
public:
~OculusDisplayPlugin();
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -29,7 +29,7 @@ protected:
void cycleDebugOutput() override;
private:
static const QString NAME;
static const char* NAME;
ovrTextureSwapChain _textureSwapChain;
gpu::FramebufferPointer _outputFramebuffer;
bool _customized { false };

View file

@ -21,7 +21,7 @@ class OculusLegacyDisplayPlugin : public HmdDisplayPlugin {
public:
OculusLegacyDisplayPlugin();
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -41,9 +41,9 @@ protected:
void uncustomizeContext() override;
void hmdPresent() override;
bool isHmdMounted() const override { return true; }
private:
static const QString NAME;
static const char* NAME;
GLWindow* _hmdWindow{ nullptr };
ovrHmd _hmd;

View file

@ -36,7 +36,7 @@ class OpenVrDisplayPlugin : public HmdDisplayPlugin {
using Parent = HmdDisplayPlugin;
public:
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
void init() override;
@ -72,7 +72,7 @@ private:
vr::IVRSystem* _system { nullptr };
std::atomic<vr::EDeviceActivityLevel> _hmdActivityLevel { vr::k_EDeviceActivityLevel_Unknown };
std::atomic<uint32_t> _keyboardSupressionCount{ 0 };
static const QString NAME;
static const char* NAME;
vr::HmdMatrix34_t _lastGoodHMDPose;
mat4 _sensorResetMat;

View file

@ -37,10 +37,10 @@ void releaseOpenVrSystem();
static const char* CONTROLLER_MODEL_STRING = "vr_controller_05_wireless_b";
static const QString MENU_PARENT = "Avatar";
static const QString MENU_NAME = "Vive Controllers";
static const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME;
static const QString RENDER_CONTROLLERS = "Render Hand Controllers";
static const char* MENU_PARENT = "Avatar";
static const char* MENU_NAME = "Vive Controllers";
static const char* MENU_PATH = "Avatar" ">" "Vive Controllers";
static const char* RENDER_CONTROLLERS = "Render Hand Controllers";
const QString ViveControllerManager::NAME = "OpenVR";

View file

@ -33,7 +33,7 @@ class ViveControllerManager : public InputPlugin {
public:
// Plugin functions
bool isSupported() const override;
const QString& getName() const override { return NAME; }
const QString getName() const override { return NAME; }
bool isHandController() const override { return true; }
@ -125,7 +125,7 @@ private:
vr::IVRSystem* _system { nullptr };
std::shared_ptr<InputDevice> _inputDevice { std::make_shared<InputDevice>(_system) };
static const QString NAME;
static const char* NAME;
};
#endif // hifi__ViveControllerManager