Test with max users instead, for some reason it's not getting the same value

This commit is contained in:
radius 2015-08-31 22:23:40 -05:00
parent 9bb97e42e0
commit f3389bbd42
5 changed files with 27 additions and 26 deletions

View File

@ -22,12 +22,15 @@
QObject *topLevel; QObject *topLevel;
int Wimp::CreateMainWindow() static settings_t *settings;
int Wimp::CreateMainWindow(char* windowTitle)
{ {
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
topLevel = engine.rootObjects().value(0); topLevel = engine.rootObjects().value(0);
window = qobject_cast<QQuickWindow *>(topLevel); window = qobject_cast<QQuickWindow *>(topLevel);
SetTitle(windowTitle);
return this->exec(); return this->exec();
} }
@ -38,10 +41,10 @@ void Wimp::SetTitle(char* title)
window->setTitle(title); window->setTitle(title);
} }
void Wimp::ConfigGetPtr(settings_t *settings) void Wimp::ConfigGetPtr(settings_t *g_config)
{ {
this->settings = settings; settings = g_config;
/* Test, print the video driver name to check if we got the settings data succesfully */ /* test print the value of max users to compare with the value in RA */
printf("Video Driver: %s\n",settings->video.driver); printf("Max Users: %d\n",g_config->input.max_users);
fflush(stdout); fflush(stdout);
} }

View File

@ -26,14 +26,13 @@
class WIMPSHARED_EXPORT Wimp : public QGuiApplication class WIMPSHARED_EXPORT Wimp : public QGuiApplication
{ {
QQuickWindow *window; QQuickWindow *window;
settings_t *settings;
Q_OBJECT Q_OBJECT
public: public:
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {} Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
int CreateMainWindow(); int CreateMainWindow(char* windowTitle);
void SetTitle(char* title); void SetTitle(char* title);
void ConfigGetPtr(settings_t* settings); void ConfigGetPtr(settings_t *g_config);
}; };

View File

@ -29,19 +29,14 @@ Wimp* ctrWimp(int argc, char *argv[]){
return new Wimp(argc,argv); return new Wimp(argc,argv);
} }
int CreateMainWindow(Wimp* p) int CreateMainWindow(Wimp* p, char* windowTitle)
{ {
return p->CreateMainWindow(); return p->CreateMainWindow(windowTitle);
} }
void SetTitle(Wimp*p, char* title) void ConfigGetPtr(Wimp*p, settings_t *g_config)
{ {
return p->SetTitle(title); return p->ConfigGetPtr(g_config);
}
void ConfigGetPtr(Wimp*p, settings_t *settings)
{
return p->ConfigGetPtr(settings);
} }
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -26,9 +26,8 @@ typedef struct Wimp Wimp;
Wimp* ctrWimp(int argc, char *argv[]); Wimp* ctrWimp(int argc, char *argv[]);
int CreateMainWindow(Wimp* p); int CreateMainWindow(Wimp* p, char* windowTitle);
void SetTitle(Wimp* p, char* title); void ConfigGetPtr(Wimp*p, settings_t *g_config);
void ConfigGetPtr(Wimp*p, settings_t *settings);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -18,6 +18,8 @@
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "general.h"
#include "system.h"
#include <file/file_path.h> #include <file/file_path.h>
#include <rthreads/rthreads.h> #include <rthreads/rthreads.h>
@ -38,11 +40,18 @@ typedef struct ui_companion_qt
static void qt_thread(void *data) static void qt_thread(void *data)
{ {
settings_t *settings = config_get_ptr();
/* test print the value of max users to compare with the value in QT */
RARCH_LOG("Max Users: %d\n", settings->input.max_users);
ui_companion_qt_t *handle = (ui_companion_qt_t*)data; ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
wimp = ctrWimp(0, NULL); wimp = ctrWimp(0, NULL);
ConfigGetPtr(wimp,config_get_ptr());
if(wimp) if(wimp)
CreateMainWindow(wimp); {
ConfigGetPtr(wimp, settings);
CreateMainWindow(wimp, "RetroArch QT");
}
return; return;
} }
@ -63,9 +72,6 @@ static void ui_companion_qt_deinit(void *data)
static void *ui_companion_qt_init(void) static void *ui_companion_qt_init(void)
{ {
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle)); ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
fflush(stdout);
if (!handle) if (!handle)
return NULL; return NULL;
@ -85,7 +91,6 @@ static int ui_companion_qt_iterate(void *data, unsigned action)
{ {
(void)data; (void)data;
(void)action; (void)action;
fflush(stdout);
return 0; return 0;
} }