X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fprofile.cpp;h=484d4b4f8e79f01d07b837d5661c432cd0d2b99e;hb=ddac3e0e78a5c4b0236bdeaff18cf9a3ac4ba4f7;hp=434d01d8ac0918d7d183cb96ab816a3fae99de94;hpb=5b056aa1b8278aff14df2dacb5df2787d2eb8bdf;p=virtualjaguar diff --git a/src/gui/profile.cpp b/src/gui/profile.cpp index 434d01d..484d4b4 100644 --- a/src/gui/profile.cpp +++ b/src/gui/profile.cpp @@ -30,7 +30,6 @@ // #include "profile.h" -#include #include "gamepad.h" #include "log.h" #include "settings.h" @@ -49,6 +48,7 @@ int gamepadIDSlot2; int numberOfProfiles; int numberOfDevices; char deviceNames[MAX_DEVICES][128]; +static int numberOfProfilesSave; // This is so that new devices have something reasonable to show for default uint32_t defaultMap[21] = { @@ -68,6 +68,7 @@ int FindProfileForDevice(int deviceNum, int preferred, int * found); // void SaveProfiles(void) { + numberOfProfilesSave = numberOfProfiles; memcpy(&profileBackup, &profile, sizeof(Profile) * MAX_PROFILES); } @@ -75,6 +76,7 @@ void SaveProfiles(void) void RestoreProfiles(void) { memcpy(&profile, &profileBackup, sizeof(Profile) * MAX_PROFILES); + numberOfProfiles = numberOfProfilesSave; } @@ -94,7 +96,7 @@ void ReadProfiles(QSettings * set) for(int i=1; isetArrayIndex(i - 1); - strcpy(deviceNames[i], set->value("deviceName").toString().toAscii().data()); + strcpy(deviceNames[i], set->value("deviceName").toString().toUtf8().data()); #ifdef DEBUG_PROFILES printf("Read device name: %s\n", deviceNames[i]); #endif @@ -110,7 +112,7 @@ printf("Number of profiles: %u\n", numberOfProfiles); { set->setArrayIndex(i); profile[i].device = set->value("deviceNum").toInt(); - strcpy(profile[i].mapName, set->value("mapName").toString().toAscii().data()); + strcpy(profile[i].mapName, set->value("mapName").toString().toUtf8().data()); profile[i].preferredSlot = set->value("preferredSlot").toInt(); for(int j=0; j<21; j++)