Merge pull request #12456 from Atlante45/fix/min-spec-crash

Fix crash when passing --checkMinSpec flag
This commit is contained in:
John Conklin II 2018-02-26 17:35:46 -08:00 committed by GitHub
commit 25144f0fec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 189 additions and 227 deletions

View file

@ -9,22 +9,13 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <LogHandler.h>
#include <BuildInfo.h>
#include <SharedUtil.h>
#include "AssignmentClientApp.h"
#include <BuildInfo.h>
int main(int argc, char* argv[]) {
disableQtBearerPoll(); // Fixes wifi ping spikes
QCoreApplication::setApplicationName(BuildInfo::ASSIGNMENT_CLIENT_NAME);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
qInstallMessageHandler(LogHandler::verboseMessageHandler);
qInfo() << "Starting.";
setupHifiApplication(BuildInfo::ASSIGNMENT_CLIENT_NAME);
AssignmentClientApp app(argc, argv);

View file

@ -22,22 +22,10 @@
#include "DomainServer.h"
int main(int argc, char* argv[]) {
disableQtBearerPoll(); // Fixes wifi ping spikes
QCoreApplication::setApplicationName(BuildInfo::DOMAIN_SERVER_NAME);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
setupHifiApplication(BuildInfo::DOMAIN_SERVER_NAME);
Setting::init();
#ifndef WIN32
setvbuf(stdout, NULL, _IOLBF, 0);
#endif
qInstallMessageHandler(LogHandler::verboseMessageHandler);
qInfo() << "Starting.";
int currentExitCode = 0;
// use a do-while to handle domain-server restart

View file

@ -11,18 +11,13 @@
#include <QtCore/QCoreApplication>
#include <LogHandler.h>
#include <SharedUtil.h>
#include "IceServer.h"
int main(int argc, char* argv[]) {
#ifndef WIN32
setvbuf(stdout, NULL, _IOLBF, 0);
#endif
qInstallMessageHandler(LogHandler::verboseMessageHandler);
qInfo() << "Starting.";
setupHifiApplication("Ice Server");
IceServer iceServer(argc, argv);
return iceServer.exec();
}
}

View file

@ -574,10 +574,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt
QString logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message);
if (!logMessage.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(logMessage.toLocal8Bit().constData());
OutputDebugStringA("\n");
#elif defined Q_OS_ANDROID
#ifdef Q_OS_ANDROID
const char * local=logMessage.toStdString().c_str();
switch (type) {
case QtDebugMsg:
@ -598,7 +595,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt
abort();
}
#endif
qApp->getLogger()->addMessage(qPrintable(logMessage + "\n"));
qApp->getLogger()->addMessage(qPrintable(logMessage));
}
}
@ -1513,6 +1510,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
settingsTimer->setSingleShot(false);
settingsTimer->setInterval(SAVE_SETTINGS_INTERVAL); // 10s, Qt::CoarseTimer acceptable
QObject::connect(settingsTimer, &QTimer::timeout, this, &Application::saveSettings);
settingsTimer->start();
}, QThread::LowestPriority);
if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {

View file

@ -38,6 +38,7 @@ extern "C" {
#endif
int main(int argc, const char* argv[]) {
setupHifiApplication(BuildInfo::INTERFACE_NAME);
#ifdef Q_OS_LINUX
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
@ -51,17 +52,9 @@ int main(int argc, const char* argv[]) {
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
disableQtBearerPoll(); // Fixes wifi ping spikes
QElapsedTimer startupTime;
startupTime.start();
// Set application infos
QCoreApplication::setApplicationName(BuildInfo::INTERFACE_NAME);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
Setting::init();
// Instance UserActivityLogger now that the settings are loaded

View file

@ -14,6 +14,10 @@
#include <mutex>
#ifdef Q_OS_WIN
#include <windows.h>
#endif
#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
#include <QtCore/QDebug>
@ -184,8 +188,13 @@ QString LogHandler::printMessage(LogMsgType type, const QMessageLogContext& cont
}
}
QString logMessage = QString("%1 %2").arg(prefixString, message.split('\n').join('\n' + prefixString + " "));
fprintf(stdout, "%s\n", qPrintable(logMessage));
QString logMessage = QString("%1 %2\n").arg(prefixString, message.split('\n').join('\n' + prefixString + " "));
fprintf(stdout, "%s", qPrintable(logMessage));
#ifdef Q_OS_WIN
// On windows, this will output log lines into the Visual Studio "output" tab
OutputDebugStringA(qPrintable(logMessage));
#endif
return logMessage;
}

View file

@ -23,51 +23,69 @@
#include "SharedUtil.h"
namespace Setting {
static QSharedPointer<Manager> globalManager;
// This should only run as a post-routine in the QCoreApplication destructor
void cleanupSettingsSaveThread() {
auto globalManager = DependencyManager::get<Manager>();
Q_ASSERT(qApp && globalManager);
// cleans up the settings private instance. Should only be run once at closing down.
void cleanupPrivateInstance() {
// grab the thread before we nuke the instance
QThread* settingsManagerThread = DependencyManager::get<Manager>()->thread();
// Grab the settings thread to shut it down
QThread* settingsManagerThread = globalManager->thread();
// tell the private instance to clean itself up on its thread
DependencyManager::destroy<Manager>();
globalManager.reset();
// quit the settings manager thread and wait on it to make sure it's gone
// Quit the settings manager thread and wait for it so we
// don't get concurrent accesses when we save all settings below
settingsManagerThread->quit();
settingsManagerThread->wait();
// [IMPORTANT] Save all settings when the QApplication goes down
globalManager->saveAll();
qCDebug(shared) << "Settings thread stopped.";
}
void setupPrivateInstance() {
// Ensure Setting::init has already ran and qApp exists
if (qApp && globalManager) {
// Let's set up the settings Private instance on its own thread
QThread* thread = new QThread();
Q_CHECK_PTR(thread);
thread->setObjectName("Settings Thread");
// This should only run as a pre-routine in the QCoreApplication constructor
void setupSettingsSaveThread() {
auto globalManager = DependencyManager::get<Manager>();
Q_ASSERT(qApp && globalManager);
QObject::connect(thread, SIGNAL(started()), globalManager.data(), SLOT(startTimer()));
QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
QObject::connect(thread, SIGNAL(finished()), globalManager.data(), SLOT(deleteLater()));
globalManager->moveToThread(thread);
thread->start();
qCDebug(shared) << "Settings thread started.";
// Let's set up the settings private instance on its own thread
QThread* thread = new QThread(qApp);
Q_CHECK_PTR(thread);
thread->setObjectName("Settings Thread");
// Register cleanupPrivateInstance to run inside QCoreApplication's destructor.
qAddPostRoutine(cleanupPrivateInstance);
}
// Setup setting periodical save timer
QObject::connect(thread, &QThread::started, globalManager.data(), &Manager::startTimer);
QObject::connect(thread, &QThread::finished, globalManager.data(), &Manager::stopTimer);
// Setup manager threading affinity
// This makes the timer fire on the settings thread so we don't block the main
// thread with a lot of file I/O.
// We bring back the manager to the main thread when the QApplication goes down
globalManager->moveToThread(thread);
QObject::connect(thread, &QThread::finished, globalManager.data(), [] {
auto globalManager = DependencyManager::get<Manager>();
Q_ASSERT(qApp && globalManager);
// Move manager back to the main thread (has to be done on owning thread)
globalManager->moveToThread(qApp->thread());
});
// Start the settings save thread
thread->start();
qCDebug(shared) << "Settings thread started.";
// Register cleanupSettingsSaveThread to run inside QCoreApplication's destructor.
// This will cleanup the settings thread and save all settings before shut down.
qAddPostRoutine(cleanupSettingsSaveThread);
}
FIXED_Q_COREAPP_STARTUP_FUNCTION(setupPrivateInstance)
// Sets up the settings private instance. Should only be run once at startup. preInit() must be run beforehand,
// Sets up the settings private instance. Should only be run once at startup.
void init() {
// Set settings format
QSettings::setDefaultFormat(JSON_FORMAT);
QSettings settings;
qCDebug(shared) << "Settings file:" << settings.fileName();
// Backward compatibility for old settings file
if (settings.allKeys().isEmpty()) {
loadOldINIFile(settings);
}
@ -80,11 +98,13 @@ namespace Setting {
qCDebug(shared) << (deleted ? "Deleted" : "Failed to delete") << "settings lock file" << settingsLockFilename;
}
globalManager = DependencyManager::set<Manager>();
// Setup settings manager, the manager will live until the process shuts down
DependencyManager::set<Manager>();
setupPrivateInstance();
// Add pre-routine to setup threading
qAddPreRoutine(setupSettingsSaveThread);
}
void Interface::init() {
if (!DependencyManager::isSet<Manager>()) {
// WARNING: As long as we are using QSettings this should always be triggered for each Setting::Handle

View file

@ -23,11 +23,7 @@ namespace Setting {
// Cleanup timer
stopTimer();
delete _saveTimer;
// Save all settings before exit
saveAll();
// sync will be called in the QSettings destructor
_saveTimer = nullptr;
}
// Custom deleter does nothing, because we need to shutdown later than the dependency manager

View file

@ -50,8 +50,8 @@ namespace Setting {
QHash<QString, QVariant> _pendingChanges;
friend class Interface;
friend void cleanupPrivateInstance();
friend void setupPrivateInstance();
friend void cleanupSettingsSaveThread();
friend void setupSettingsSaveThread();
};
}

View file

@ -59,16 +59,32 @@ extern "C" FILE * __cdecl __iob_func(void) {
#include <QSysInfo>
#include <QThread>
#include <BuildInfo.h>
#include "LogHandler.h"
#include "NumericalConstants.h"
#include "OctalCode.h"
#include "SharedLogging.h"
// Global instances are stored inside the QApplication properties
// to provide a single instance across DLL boundaries.
// This is something we cannot do here since several DLLs
// and our main binaries statically link this "shared" library
// resulting in multiple static memory blocks in different constexts
// But we need to be able to use global instances before the QApplication
// is setup, so to accomplish that we stage the global instances in a local
// map and setup a pre routine (commitGlobalInstances) that will run in the
// QApplication constructor and commit all the staged instances to the
// QApplication properties.
// Note: One of the side effects of this, is that no DLL loaded before
// the QApplication is constructed, can expect to access the existing staged
// global instanced. For this reason, we advise all DLLs be loaded after
// the QApplication is instanced.
static std::mutex stagedGlobalInstancesMutex;
static std::unordered_map<std::string, QVariant> stagedGlobalInstances;
std::mutex& globalInstancesMutex() {
static std::mutex mutex;
return mutex;
return stagedGlobalInstancesMutex;
}
static void commitGlobalInstances() {
@ -78,7 +94,13 @@ static void commitGlobalInstances() {
}
stagedGlobalInstances.clear();
}
FIXED_Q_COREAPP_STARTUP_FUNCTION(commitGlobalInstances)
// This call is necessary for global instances to work across DLL boundaries
// Ideally, this founction would be called at the top of the main function.
// See description at the top of the file.
void setupGlobalInstances() {
qAddPreRoutine(commitGlobalInstances);
}
QVariant getGlobalInstance(const char* propertyName) {
if (qApp) {
@ -813,8 +835,8 @@ bool similarStrings(const QString& stringA, const QString& stringB) {
}
void disableQtBearerPoll() {
// to disable the Qt constant wireless scanning, set the env for polling interval
qDebug() << "Disabling Qt wireless polling by using a negative value for QTimer::setInterval";
// To disable the Qt constant wireless scanning, set the env for polling interval to -1
// The constant polling causes ping spikes on windows every 10 seconds or so that affect the audio
const QByteArray DISABLE_BEARER_POLL_TIMEOUT = QString::number(-1).toLocal8Bit();
qputenv("QT_BEARER_POLL_TIMEOUT", DISABLE_BEARER_POLL_TIMEOUT);
}
@ -1176,6 +1198,32 @@ void watchParentProcess(int parentPID) {
}
#endif
void setupHifiApplication(QString applicationName) {
disableQtBearerPoll(); // Fixes wifi ping spikes
// Those calls are necessary to format the log correctly
// and to direct the application to the correct location
// for read/writes into AppData and other platform equivalents.
QCoreApplication::setApplicationName(applicationName);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
// This ensures the global instances mechanism is correctly setup.
// You can find more details as to why this is important in the SharedUtil.h/cpp files
setupGlobalInstances();
#ifndef WIN32
// Windows tends to hold onto log lines until it has a sizeable buffer
// This makes the log feel unresponsive and trap useful log data in the log buffer
// when a crash occurs.
//Force windows to flush the buffer on each new line character to avoid this.
setvbuf(stdout, NULL, _IOLBF, 0);
#endif
// Install the standard hifi message handler so we get consistant log formatting
qInstallMessageHandler(LogHandler::verboseMessageHandler);
}
#ifdef Q_OS_WIN
QString getLastErrorAsString() {

View file

@ -25,23 +25,6 @@
#include <QtCore/QCoreApplication>
#include <QUuid>
// Workaround for https://bugreports.qt.io/browse/QTBUG-54479
// Wrap target function inside another function that holds
// a unique string identifier and uses it to ensure it only runs once
// by storing a state within the qApp
// We cannot used std::call_once with a static once_flag because
// this is used in shared libraries that are linked by several DLLs
// (ie. plugins), meaning the static will be useless in that case
#define FIXED_Q_COREAPP_STARTUP_FUNCTION(AFUNC) \
static void AFUNC ## _fixed() { \
const auto propertyName = std::string(Q_FUNC_INFO) + __FILE__; \
if (!qApp->property(propertyName.c_str()).toBool()) { \
AFUNC(); \
qApp->setProperty(propertyName.c_str(), QVariant(true)); \
} \
} \
Q_COREAPP_STARTUP_FUNCTION(AFUNC ## _fixed)
// When writing out avatarEntities to a QByteArray, if the parentID is the ID of MyAvatar, use this ID instead. This allows
// the value to be reset when the sessionID changes.
const QUuid AVATAR_SELF_ID = QUuid("{00000000-0000-0000-0000-000000000001}");
@ -53,20 +36,11 @@ std::unique_ptr<T>& globalInstancePointer() {
return instancePtr;
}
template <typename T>
void setGlobalInstance(const char* propertyName, T* instance) {
globalInstancePointer<T>().reset(instance);
}
template <typename T>
bool destroyGlobalInstance() {
std::unique_ptr<T>& instancePtr = globalInstancePointer<T>();
if (instancePtr.get()) {
instancePtr.reset();
return true;
}
return false;
}
// Sets up the global instances for use
// This NEEDS to be called on startup
// for any binary planing on using global instances
// More details in cpp file
void setupGlobalInstances();
std::mutex& globalInstancesMutex();
QVariant getGlobalInstance(const char* propertyName);
@ -78,7 +52,6 @@ void setGlobalInstance(const char* propertyName, const QVariant& variant);
template <typename T, typename... Args>
T* globalInstance(const char* propertyName, Args&&... args) {
static T* resultInstance { nullptr };
static std::mutex mutex;
if (!resultInstance) {
std::unique_lock<std::mutex> lock(globalInstancesMutex());
if (!resultInstance) {
@ -260,6 +233,7 @@ void watchParentProcess(int parentPID);
bool processIsRunning(int64_t pid);
void setupHifiApplication(QString applicationName);
#ifdef Q_OS_WIN
void* createProcessGroup();

View file

@ -20,6 +20,7 @@
#include <EntityItemProperties.h>
#include <Octree.h>
#include <PathUtils.h>
#include <SharedUtil.h>
const QString& getTestResourceDir() {
static QString dir;
@ -136,6 +137,8 @@ void testPropertyFlags() {
}
int main(int argc, char** argv) {
setupHifiApplication("Entities Test");
QCoreApplication app(argc, argv);
{
auto start = usecTimestampNow();

View file

@ -45,6 +45,7 @@
#include <TextureCache.h>
#include <PerfStat.h>
#include <PathUtils.h>
#include <SharedUtil.h>
#include <ViewFrustum.h>
#include <gpu/Pipeline.h>
@ -192,7 +193,9 @@ void testSparseRectify() {
}
}
int main(int argc, char** argv) {
int main(int argc, char** argv) {
setupHifiApplication("GPU Test");
testSparseRectify();
// FIXME this test appears to be broken

View file

@ -149,7 +149,8 @@ static const QString TEST_FOLDER { "H:/ktx_cacheold" };
static const QString EXTENSIONS { "*.ktx" };
int mainTemp(int, char**) {
qInstallMessageHandler(messageHandler);
setupHifiApplication("KTX Tests");
auto fileInfoList = QDir { TEST_FOLDER }.entryInfoList(QStringList { EXTENSIONS });
for (auto fileInfo : fileInfoList) {
qDebug() << fileInfo.filePath();

View file

@ -179,18 +179,10 @@ void TestWindow::resizeEvent(QResizeEvent* ev) {
resizeWindow(ev->size());
}
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
if (!message.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(message.toLocal8Bit().constData());
OutputDebugStringA("\n");
#endif
}
}
int main(int argc, char** argv) {
setupHifiApplication("QML Test");
int main(int argc, char** argv) {
QGuiApplication app(argc, argv);
qInstallMessageHandler(messageHandler);
TestWindow window;
app.exec();
return 0;

View file

@ -63,14 +63,11 @@ void Qt59TestApp::finish(int exitCode) {
int main(int argc, char * argv[]) {
QCoreApplication::setApplicationName("Qt59Test");
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
setupHifiApplication("Qt59Test");
Qt59TestApp app(argc, argv);
return app.exec();
}
#include "main.moc"
#include "main.moc"

View file

@ -10,6 +10,8 @@
#include <recording/Clip.h>
#include <recording/Frame.h>
#include <SharedUtil.h>
#include "Constants.h"
using namespace recording;
@ -97,18 +99,10 @@ void testClipOrdering() {
Q_UNUSED(lastFrameTimeOffset); // FIXME - Unix build not yet upgraded to Qt 5.5.1 we can remove this once it is
}
#ifdef Q_OS_WIN32
void myMessageHandler(QtMsgType type, const QMessageLogContext & context, const QString & msg) {
OutputDebugStringA(msg.toLocal8Bit().toStdString().c_str());
OutputDebugStringA("\n");
}
#endif
int main(int, const char**) {
#ifdef Q_OS_WIN32
qInstallMessageHandler(myMessageHandler);
#endif
setupHifiApplication("Recording Test");
testFrameTypeRegistration();
testFilePersist();
testClipOrdering();
}
}

View file

@ -1138,31 +1138,17 @@ private:
bool QTestWindow::_cullingEnabled = true;
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
QString logMessage = LogHandler::getInstance().printMessage((LogMsgType)type, context, message);
if (!logMessage.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(logMessage.toLocal8Bit().constData());
OutputDebugStringA("\n");
#endif
logger->addMessage(qPrintable(logMessage + "\n"));
}
}
const char * LOG_FILTER_RULES = R"V0G0N(
hifi.gpu=true
)V0G0N";
int main(int argc, char** argv) {
setupHifiApplication("RenderPerf");
QApplication app(argc, argv);
QCoreApplication::setApplicationName("RenderPerf");
QCoreApplication::setOrganizationName("High Fidelity");
QCoreApplication::setOrganizationDomain("highfidelity.com");
logger.reset(new FileLogger());
qInstallMessageHandler(messageHandler);
QLoggingCategory::setFilterRules(LOG_FILTER_RULES);
QTestWindow::setup();
QTestWindow window;

View file

@ -610,16 +610,6 @@ private:
bool _ready { false };
};
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
if (!message.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(message.toLocal8Bit().constData());
OutputDebugStringA("\n");
#endif
std::cout << message.toLocal8Bit().constData() << std::endl;
}
}
const char * LOG_FILTER_RULES = R"V0G0N(
hifi.gpu=true
)V0G0N";
@ -645,11 +635,9 @@ void unzipTestData(const QByteArray& zipData) {
}
int main(int argc, char** argv) {
setupHifiApplication("RenderPerf");
QApplication app(argc, argv);
QCoreApplication::setApplicationName("RenderPerf");
QCoreApplication::setOrganizationName("High Fidelity");
QCoreApplication::setOrganizationDomain("highfidelity.com");
qInstallMessageHandler(messageHandler);
QLoggingCategory::setFilterRules(LOG_FILTER_RULES);
if (!DATA_DIR.exists()) {

View file

@ -179,25 +179,14 @@ void QTestWindow::draw() {
}
}
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
if (!message.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(message.toLocal8Bit().constData());
OutputDebugStringA("\n");
#else
std::cout << message.toLocal8Bit().constData() << std::endl;
#endif
}
}
const char * LOG_FILTER_RULES = R"V0G0N(
hifi.gpu=true
)V0G0N";
int main(int argc, char** argv) {
int main(int argc, char** argv) {
setupHifiApplication("Render Utils Test");
QGuiApplication app(argc, argv);
qInstallMessageHandler(messageHandler);
QLoggingCategory::setFilterRules(LOG_FILTER_RULES);
QTestWindow window;
QTimer timer;

View file

@ -214,24 +214,14 @@ void QTestWindow::draw() {
_context.swapBuffers(this);
}
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
if (!message.isEmpty()) {
#ifdef Q_OS_WIN
OutputDebugStringA(message.toLocal8Bit().constData());
OutputDebugStringA("\n");
#else
std::cout << message.toLocal8Bit().constData() << std::endl;
#endif
}
}
const char * LOG_FILTER_RULES = R"V0G0N(
hifi.gpu=true
)V0G0N";
int main(int argc, char** argv) {
int main(int argc, char** argv) {
setupHifiApplication("Shaders Test");
QGuiApplication app(argc, argv);
qInstallMessageHandler(messageHandler);
QLoggingCategory::setFilterRules(LOG_FILTER_RULES);
QTestWindow window;
QTimer timer;

View file

@ -19,15 +19,11 @@
using namespace std;
int main(int argc, char * argv[]) {
QCoreApplication::setApplicationName(BuildInfo::AC_CLIENT_SERVER_NAME);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
int main(int argc, char* argv[]) {
setupHifiApplication(BuildInfo::AC_CLIENT_SERVER_NAME);
Setting::init();
ACClientApp app(argc, argv);
return app.exec();
}

View file

@ -20,14 +20,10 @@
using namespace std;
int main(int argc, char * argv[]) {
QCoreApplication::setApplicationName(BuildInfo::AC_CLIENT_SERVER_NAME);
QCoreApplication::setOrganizationName(BuildInfo::MODIFIED_ORGANIZATION);
QCoreApplication::setOrganizationDomain(BuildInfo::ORGANIZATION_DOMAIN);
QCoreApplication::setApplicationVersion(BuildInfo::VERSION);
setupHifiApplication("ATP Client");
Setting::init();
ATPClientApp app(argc, argv);
return app.exec();
}

View file

@ -17,4 +17,4 @@ int main(int argc, char *argv[]) {
autoTester.show();
return application.exec();
}
}

View file

@ -13,11 +13,15 @@
#include <string>
#include <vector>
#include <SharedUtil.h>
#include "ICEClientApp.h"
using namespace std;
int main(int argc, char * argv[]) {
setupHifiApplication("ICE Client");
ICEClientApp app(argc, argv);
return app.exec();
}

View file

@ -10,11 +10,12 @@
#include "Oven.h"
#include <BuildInfo.h>
#include <SettingInterface.h>
#include <SharedUtil.h>
int main (int argc, char** argv) {
QCoreApplication::setOrganizationName("High Fidelity");
QCoreApplication::setApplicationName("Oven");
setupHifiApplication("Oven");
// init the settings interface so we can save and load settings
Setting::init();

View file

@ -14,9 +14,13 @@
#include <vector>
#include <QDebug>
#include <SharedUtil.h>
#include "SkeletonDumpApp.h"
int main(int argc, char * argv[]) {
setupHifiApplication("Skeleton Dump App");
SkeletonDumpApp app(argc, argv);
return app.getReturnCode();
}

View file

@ -71,8 +71,6 @@ const QStringList SERVER_STATS_TABLE_HEADERS {
UDTTest::UDTTest(int& argc, char** argv) :
QCoreApplication(argc, argv)
{
qInstallMessageHandler(LogHandler::verboseMessageHandler);
parseArguments();
// randomize the seed for packet size randomization

View file

@ -10,9 +10,13 @@
#include <QtCore/QCoreApplication>
#include <SharedUtil.h>
#include "UDTTest.h"
int main(int argc, char* argv[]) {
setupHifiApplication("UDT Test);
UDTTest app(argc, argv);
return app.exec();
}

View file

@ -15,6 +15,8 @@
#include <string>
#include <vector>
#include <SharedUtil.h>
#include "VHACDUtilApp.h"
using namespace std;
@ -22,6 +24,8 @@ using namespace VHACD;
int main(int argc, char * argv[]) {
setupHifiApplication("VHACD Util");
VHACDUtilApp app(argc, argv);
return app.getReturnCode();
}