mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-05 15:32:13 +02:00
Initial creation of class - has COPY of getOperatingSystemType().
This commit is contained in:
parent
4f3dd390b5
commit
c28167f797
2 changed files with 53 additions and 0 deletions
23
interface/src/scripting/PlatformInfoScriptingInterface.cpp
Normal file
23
interface/src/scripting/PlatformInfoScriptingInterface.cpp
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//
|
||||||
|
// Created by Nissim Hadar on 2018/12/28
|
||||||
|
// Copyright 2013-2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
#include "PlatformInfoScriptingInterface.h"
|
||||||
|
|
||||||
|
PlatformInfoScriptingInterface* PlatformInfoScriptingInterface::getInstance() {
|
||||||
|
static PlatformInfoScriptingInterface sharedInstance;
|
||||||
|
return &sharedInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PlatformInfoScriptingInterface::getOperatingSystemType() {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
return "WINDOWS";
|
||||||
|
#elif defined Q_OS_MAC
|
||||||
|
return "MACOS";
|
||||||
|
#else
|
||||||
|
return "UNKNOWN";
|
||||||
|
#endif
|
||||||
|
}
|
30
interface/src/scripting/PlatformInfoScriptingInterface.h
Normal file
30
interface/src/scripting/PlatformInfoScriptingInterface.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
// Created by Nissim Hadar on 2018/12/28
|
||||||
|
// Copyright 2013-2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_PlatformInfoScriptingInterface_h
|
||||||
|
#define hifi_PlatformInfoScriptingInterface_h
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
class QScriptValue;
|
||||||
|
|
||||||
|
class PlatformInfoScriptingInterface : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
static PlatformInfoScriptingInterface* getInstance();
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Returns the Operating Sytem type
|
||||||
|
* @function Test.getOperatingSystemType
|
||||||
|
* @returns {string} "WINDOWS", "MACOS" or "UNKNOWN"
|
||||||
|
*/
|
||||||
|
QString getOperatingSystemType();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_PlatformInfoScriptingInterface_h
|
Loading…
Reference in a new issue