Merge pull request #709 from andyvand/master

Fix strings
This commit is contained in:
thor2016 2024-02-18 16:08:56 -05:00 committed by GitHub
commit 72b297980b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 329 additions and 328 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
build
/vc/defaultconfig/scmrev.h
/vc/.vs
/vc/vc14_bin_Debug

View File

@ -2216,13 +2216,13 @@ int aviRecordOpenFile( const char *filepath )
date = QDate::currentDate();
avi_info.add_pair( "ICRD", date.toString(Qt::ISODate).toStdString().c_str() );
avi_info.add_pair( "ICRD", date.toString(Qt::ISODate).toLocal8Bit().constData() );
avi_info.add_pair( "ILNG", QLocale::languageToString( locale.language() ).toStdString().c_str() );
avi_info.add_pair( "ILNG", QLocale::languageToString( locale.language() ).toLocal8Bit().constData() );
avi_info.add_pair( "IARL", QLocale::countryToString( locale.country() ).toStdString().c_str() );
avi_info.add_pair( "IARL", QLocale::countryToString( locale.country() ).toLocal8Bit().constData() );
avi_info.add_pair( "IMED", QSysInfo::prettyProductName().toStdString().c_str() );
avi_info.add_pair( "IMED", QSysInfo::prettyProductName().toLocal8Bit().constData() );
sprintf( txt, "FCEUX %s", FCEU_VERSION_STRING );
avi_info.add_pair( "ITCH", txt );
@ -3263,10 +3263,10 @@ void LibavOptionsPage::initCodecLists(void)
c = av_codec_iterate( &it );
}
initPixelFormatSelect( videoEncSel->currentText().toStdString().c_str() );
initSampleFormatSelect( audioEncSel->currentText().toStdString().c_str() );
initSampleRateSelect( audioEncSel->currentText().toStdString().c_str() );
initChannelLayoutSelect( audioEncSel->currentText().toStdString().c_str() );
initPixelFormatSelect( videoEncSel->currentText().toLocal8Bit().constData() );
initSampleFormatSelect( audioEncSel->currentText().toLocal8Bit().constData() );
initSampleRateSelect( audioEncSel->currentText().toLocal8Bit().constData() );
initChannelLayoutSelect( audioEncSel->currentText().toLocal8Bit().constData() );
videoEncSel->model()->sort(0, Qt::AscendingOrder);
audioEncSel->model()->sort(0, Qt::AscendingOrder);
@ -3281,7 +3281,7 @@ void LibavOptionsPage::videoCodecChanged(int idx)
{
const AVCodec *c;
LIBAV::video_st.selEnc = videoEncSel->currentText().toStdString().c_str();
LIBAV::video_st.selEnc = videoEncSel->currentText().toLocal8Bit().constData();
c = avcodec_find_encoder_by_name( LIBAV::video_st.selEnc.c_str() );
@ -3296,7 +3296,7 @@ void LibavOptionsPage::audioCodecChanged(int idx)
{
const AVCodec *c;
LIBAV::audio_st.selEnc = audioEncSel->currentText().toStdString().c_str();
LIBAV::audio_st.selEnc = audioEncSel->currentText().toLocal8Bit().constData();
c = avcodec_find_encoder_by_name( LIBAV::audio_st.selEnc.c_str() );
@ -4102,7 +4102,7 @@ void LibavEncOptInputWin::applyChanges(void)
{
if ( strEntry )
{
av_opt_set( item->obj, item->opt->name, strEntry->text().toStdString().c_str(), 0 );
av_opt_set( item->obj, item->opt->name, strEntry->text().toLocal8Bit().constData(), 0 );
}
}
break;

View File

@ -294,18 +294,18 @@ void AviRiffViewerDialog::openAviFileDialog(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
printf( "AVI Debug movie %s\n", filename.toStdString().c_str() );
printf( "AVI Debug movie %s\n", filename.toLocal8Bit().constData() );
lastPath = QFileInfo(filename).absolutePath().toStdString();
lastPath = QFileInfo(filename).absolutePath().toLocal8Bit().constData();
if ( lastPath.size() > 0 )
{
g_config->setOption ("SDL.AviFilePath", lastPath);
}
openFile( filename.toStdString().c_str() );
openFile( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------------------------------
int AviRiffViewerDialog::openFile( const char *filepath )

View File

@ -591,9 +591,9 @@ void GuiCheatsDialog_t::knownValueCallback(void)
//printf("Cheat Search Known!\n");
FCEU_WRAPPER_LOCK();
//printf("'%s'\n", knownValEntry->displayText().toStdString().c_str() );
//printf("'%s'\n", knownValEntry->displayText().toLocal8Bit().constData() );
value = strtol(knownValEntry->displayText().toStdString().c_str(), NULL, 16);
value = strtol(knownValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
FCEUI_CheatSearchEnd(FCEU_SEARCH_NEWVAL_KNOWN, value, 0);
@ -624,7 +624,7 @@ void GuiCheatsDialog_t::notEqualValueCallback(void)
if (checked)
{
value = strtol(neValEntry->displayText().toStdString().c_str(), NULL, 16);
value = strtol(neValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
FCEUI_CheatSearchEnd(FCEU_SEARCH_PUERLY_RELATIVE_CHANGE, 0, value);
}
@ -648,7 +648,7 @@ void GuiCheatsDialog_t::greaterThanValueCallback(void)
if (checked)
{
value = strtol(grValEntry->displayText().toStdString().c_str(), NULL, 16);
value = strtol(grValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
FCEUI_CheatSearchEnd(FCEU_SEARCH_NEWVAL_GT_KNOWN, 0, value);
}
@ -672,7 +672,7 @@ void GuiCheatsDialog_t::lessThanValueCallback(void)
if (checked)
{
value = strtol(ltValEntry->displayText().toStdString().c_str(), NULL, 16);
value = strtol(ltValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
FCEUI_CheatSearchEnd(FCEU_SEARCH_NEWVAL_LT_KNOWN, 0, value);
}
@ -789,13 +789,13 @@ void GuiCheatsDialog_t::openCheatFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption("SDL.LastOpenFile", filename.toStdString().c_str());
g_config->setOption("SDL.LastOpenFile", filename.toLocal8Bit().constData());
FCEU_WRAPPER_LOCK();
fp = fopen(filename.toStdString().c_str(), "r");
fp = fopen(filename.toLocal8Bit().constData(), "r");
if (fp != NULL)
{
@ -860,13 +860,13 @@ void GuiCheatsDialog_t::saveCheatFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
//g_config->setOption ("SDL.LastOpenFile", filename.toStdString().c_str() );
//g_config->setOption ("SDL.LastOpenFile", filename.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
fp = FCEUD_UTF8fopen(filename.toStdString().c_str(), "wb");
fp = FCEUD_UTF8fopen(filename.toLocal8Bit().constData(), "wb");
if (fp != NULL)
{
@ -888,11 +888,11 @@ void GuiCheatsDialog_t::addActvCheat(void)
int t = 1;
std::string name, cmpStr;
a = strtoul(cheatAddrEntry->displayText().toStdString().c_str(), NULL, 16);
a = strtoul(cheatAddrEntry->displayText().toLocal8Bit().constData(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
cmpStr = cheatCmpEntry->displayText().toStdString();
cmpStr = cheatCmpEntry->displayText().toLocal8Bit().constData();
if (isxdigit(cmpStr[0]))
{
@ -903,7 +903,7 @@ void GuiCheatsDialog_t::addActvCheat(void)
c = -1;
}
name = cheatNameEntry->text().toStdString();
name = cheatNameEntry->text().toLocal8Bit().constData();
t = typeEntry->currentData().toInt();
@ -965,11 +965,11 @@ void GuiCheatsDialog_t::updateCheatParameters(void)
}
//printf("Row: %i \n", row );
a = strtoul(cheatAddrEntry->displayText().toStdString().c_str(), NULL, 16);
a = strtoul(cheatAddrEntry->displayText().toLocal8Bit().constData(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toStdString().c_str(), NULL, 16);
v = strtoul(cheatValEntry->displayText().toLocal8Bit().constData(), NULL, 16);
cmpStr = cheatCmpEntry->displayText().toStdString();
cmpStr = cheatCmpEntry->displayText().toLocal8Bit().constData();
//printf("CMP: '%s' \n", cmpStr.c_str() );
@ -983,7 +983,7 @@ void GuiCheatsDialog_t::updateCheatParameters(void)
}
//printf("CMP: '%i' 0x%X\n", c, c );
name = cheatNameEntry->text().toStdString();
name = cheatNameEntry->text().toLocal8Bit().constData();
//printf("Name: %s \n", name.c_str() );

View File

@ -476,10 +476,10 @@ void CodeDataLoggerDialog_t::saveCdlFileAs(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
FCEU_WRAPPER_LOCK();
strcpy(loadedcdfile, filename.toStdString().c_str());
strcpy(loadedcdfile, filename.toLocal8Bit().constData());
SaveCDLogFile();
FCEU_WRAPPER_UNLOCK();
}
@ -531,10 +531,10 @@ void CodeDataLoggerDialog_t::loadCdlFile(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
FCEU_WRAPPER_LOCK();
LoadCDLog(filename.toStdString().c_str());
LoadCDLog(filename.toLocal8Bit().constData());
FCEU_WRAPPER_UNLOCK();
return;
@ -615,9 +615,9 @@ void CodeDataLoggerDialog_t::SaveStrippedROM(int invert)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
FILE *fp = fopen(filename.toStdString().c_str(), "wb");
FILE *fp = fopen(filename.toLocal8Bit().constData(), "wb");
if (!fp)
{
FCEUD_PrintError("Error opening target stripped rom file!");

View File

@ -119,9 +119,9 @@ void ColorMenuItem::pickerClosed(int ret)
colorText = colorPtr->name();
//printf("Saving '%s' = Color string '%s'\n", confName.c_str(), colorText.toStdString().c_str() );
//printf("Saving '%s' = Color string '%s'\n", confName.c_str(), colorText.toLocal8Bit().constData() );
g_config->setOption( confName, colorText.toStdString().c_str() );
g_config->setOption( confName, colorText.toLocal8Bit().constData() );
g_config->save();
}
@ -140,7 +140,7 @@ void ColorMenuItem::openColorPicker(void)
qs = title;
qs.replace( "&", "", Qt::CaseInsensitive); // get rid of & accelerator characters
picker = new ColorMenuPickerDialog_t( colorPtr, qs.toStdString().c_str(), parentWidget() );
picker = new ColorMenuPickerDialog_t( colorPtr, qs.toLocal8Bit().constData(), parentWidget() );
picker->show();

View File

@ -352,7 +352,7 @@ void ConsoleDebugger::ld65ImportDebug(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
if (debugSymbolTable.numSymbols() > 0)
{
@ -371,7 +371,7 @@ void ConsoleDebugger::ld65ImportDebug(void)
debugSymbolTable.loadRegisterMap();
debugSymbolTable.ld65LoadDebugFile( filename.toStdString().c_str() );
debugSymbolTable.ld65LoadDebugFile( filename.toLocal8Bit().constData() );
queueUpdate(QAsmView::UPDATE_ALL);
@ -1561,7 +1561,7 @@ void ConsoleDebugger::loadDisplayViews(void)
{
if ( tabList[k].size() > 0 )
{
//printf(" %i: %s\n", k, tabList[k].toStdString().c_str() );
//printf(" %i: %s\n", k, tabList[k].toLocal8Bit().constData() );
if ( tabList[k].compare( cpuFrame->objectName() ) == 0 )
{
@ -1634,12 +1634,12 @@ void ConsoleDebugger::saveDisplayViews(void)
{
QWidget *w = tabView[i][j]->widget(k);
//printf("(%i,%i,%i) %s\n", i, j, k, w->objectName().toStdString().c_str() );
//printf("(%i,%i,%i) %s\n", i, j, k, w->objectName().toLocal8Bit().constData() );
tabListVal += w->objectName() + ",";
}
//printf("(%i,%i) %s\n", i, j, tabListVal.toStdString().c_str() );
//printf("(%i,%i) %s\n", i, j, tabListVal.toLocal8Bit().constData() );
settings.setValue( key, tabListVal );
}
}
@ -1711,7 +1711,7 @@ void ConsoleDebugger::moveTab( QWidget *w, int row, int column)
QString txt = p->tabBar()->tabText( idx );
p->removeTab( idx );
tabView[column][row]->addTab(w, txt);
//printf("Move Widget %p to (%i,%i) %s\n", w, row, column, txt.toStdString().c_str() );
//printf("Move Widget %p to (%i,%i) %s\n", w, row, column, txt.toLocal8Bit().constData() );
}
updateTabVisibility();
}
@ -1830,7 +1830,7 @@ void ConsoleDebugger::bmItemDoubleClicked( QTreeWidgetItem *item, int column)
//printf("Row: %i Column: %i \n", row, column );
addr = strtol( item->text(0).toStdString().c_str(), NULL, 16 );
addr = strtol( item->text(0).toLocal8Bit().constData(), NULL, 16 );
line = asmView->getAsmLineFromAddr( addr );
@ -1839,7 +1839,7 @@ void ConsoleDebugger::bmItemDoubleClicked( QTreeWidgetItem *item, int column)
//----------------------------------------------------------------------------
void ConsoleDebugger::selBmAddrChanged(const QString &txt)
{
selBmAddrVal = strtol( txt.toStdString().c_str(), NULL, 16 );
selBmAddrVal = strtol( txt.toLocal8Bit().constData(), NULL, 16 );
//printf("selBmAddrVal = %04X\n", selBmAddrVal );
}
@ -2129,7 +2129,7 @@ void DebuggerBreakpointEditor::checkDataValid(void)
{
bool convOk = false;
start_addr = offsetStringToInt( type, addr1->text().toStdString().c_str(), &convOk );
start_addr = offsetStringToInt( type, addr1->text().toLocal8Bit().constData(), &convOk );
//printf("StartAddr:0x%04X Upper:0x%04X\n", start_addr, addrUpperBound);
startAddrValid = convOk && (start_addr >= addrLowerBound) && (start_addr < addrUpperBound);
@ -2143,7 +2143,7 @@ void DebuggerBreakpointEditor::checkDataValid(void)
{
bool convOk = false;
end_addr = offsetStringToInt( type, addr2->text().toStdString().c_str(), &convOk );
end_addr = offsetStringToInt( type, addr2->text().toLocal8Bit().constData(), &convOk );
endAddrValid = convOk && (end_addr >= addrLowerBound) &&
(end_addr < addrUpperBound) && (start_addr < end_addr);
@ -2196,7 +2196,7 @@ void DebuggerBreakpointEditor::conditionTextChanged(const QString &txt)
{
if ( txt.size() > 0 )
{
Condition *c = generateCondition( txt.toStdString().c_str() );
Condition *c = generateCondition( txt.toLocal8Bit().constData() );
condValid = (c != nullptr);
@ -2238,14 +2238,14 @@ void DebuggerBreakpointEditor::loadBreakpoint(void)
type |= BT_R;
}
s = addr1->text().toStdString();
s = addr1->text().toLocal8Bit().constData();
if ( s.size() > 0 )
{
start_addr = offsetStringToInt( type, s.c_str() );
}
s = addr2->text().toStdString();
s = addr2->text().toLocal8Bit().constData();
if ( s.size() > 0 )
{
@ -2277,8 +2277,8 @@ void DebuggerBreakpointEditor::loadBreakpoint(void)
unsigned int retval;
std::string nameString, condString;
nameString = name->text().toStdString();
condString = cond->text().toStdString();
nameString = name->text().toLocal8Bit().constData();
condString = cond->text().toLocal8Bit().constData();
retval = NewBreak( nameString.c_str(), start_addr, end_addr, type, condString.c_str(), slot, enable);
@ -2478,7 +2478,7 @@ void ConsoleDebugger::edit_BM_CB(void)
printf( "No Item Selected\n");
return;
}
s = item->text(0).toStdString();
s = item->text(0).toLocal8Bit().constData();
addr = strtol( s.c_str(), NULL, 16 );
@ -2499,7 +2499,7 @@ void ConsoleDebugger::delete_BM_CB(void)
printf( "No Item Selected\n");
return;
}
s = item->text(0).toStdString();
s = item->text(0).toLocal8Bit().constData();
addr = strtol( s.c_str(), NULL, 16 );
@ -2534,7 +2534,7 @@ void ConsoleDebugger::edit_BM_name( int addr )
if ( QDialog::Accepted == ret )
{
bm->name = dialog.textValue().toStdString();
bm->name = dialog.textValue().toLocal8Bit().constData();
bmListUpdate(false);
}
}
@ -2764,7 +2764,7 @@ void ConsoleDebugger::breakOnCyclesCB( bool value )
break_on_cycles = value;
}
//s = cpuCycExdVal->text().toStdString();
//s = cpuCycExdVal->text().toLocal8Bit().constData();
//printf("'%s'\n", txt );
@ -2778,7 +2778,7 @@ void ConsoleDebugger::cpuCycleThresChanged(const QString &txt)
{
std::string s;
s = txt.toStdString();
s = txt.toLocal8Bit().constData();
//printf("Cycles: '%s'\n", s.c_str() );
@ -2802,7 +2802,7 @@ void ConsoleDebugger::breakOnInstructionsCB( bool value )
break_on_instructions = value;
}
//s = instrExdVal->text().toStdString();
//s = instrExdVal->text().toLocal8Bit().constData();
//printf("'%s'\n", txt );
@ -2816,7 +2816,7 @@ void ConsoleDebugger::instructionsThresChanged(const QString &txt)
{
std::string s;
s = txt.toStdString();
s = txt.toLocal8Bit().constData();
//printf("Instructions: '%s'\n", s.c_str() );
@ -2896,9 +2896,9 @@ void ConsoleDebugger::changeAsmFontCB(void)
asmView->setFont( selFont );
asmView->updateAssemblyView();
//printf("Font Changed to: '%s'\n", font.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", font.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.DebuggerAsmFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.DebuggerAsmFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -2912,9 +2912,9 @@ void ConsoleDebugger::changeStackFontCB(void)
{
stackText->setFont( selFont );
//printf("Font Changed to: '%s'\n", font.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", font.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.DebuggerStackFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.DebuggerStackFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -2930,9 +2930,9 @@ void ConsoleDebugger::changeCpuFontCB(void)
setCpuStatusFont( selFont );
setPpuStatusFont( selFont );
//printf("Font Changed to: '%s'\n", font.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", font.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.DebuggerCpuStatusFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.DebuggerCpuStatusFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -3148,7 +3148,7 @@ void ConsoleDebugger::debugRunLine128CB(void)
//{
// std::string s;
//
// s = seekEntry->displayText().toStdString();
// s = seekEntry->displayText().toLocal8Bit().constData();
//
// //printf("Seek To: '%s'\n", s.c_str() );
//
@ -4122,7 +4122,7 @@ void ConsoleDebugger::setRegsFromEntry(void)
std::string s;
long int i;
s = pcEntry->displayText().toStdString();
s = pcEntry->displayText().toLocal8Bit().constData();
if ( s.size() > 0 )
{
@ -4135,7 +4135,7 @@ void ConsoleDebugger::setRegsFromEntry(void)
X.PC = i;
//printf("Set PC: '%s' %04X\n", s.c_str(), X.PC );
s = regAEntry->displayText().toStdString();
s = regAEntry->displayText().toLocal8Bit().constData();
if ( s.size() > 0 )
{
@ -4148,7 +4148,7 @@ void ConsoleDebugger::setRegsFromEntry(void)
X.A = i;
//printf("Set A: '%s' %02X\n", s.c_str(), X.A );
s = regXEntry->displayText().toStdString();
s = regXEntry->displayText().toLocal8Bit().constData();
if ( s.size() > 0 )
{
@ -4161,7 +4161,7 @@ void ConsoleDebugger::setRegsFromEntry(void)
X.X = i;
//printf("Set X: '%s' %02X\n", s.c_str(), X.X );
s = regYEntry->displayText().toStdString();
s = regYEntry->displayText().toLocal8Bit().constData();
if ( s.size() > 0 )
{
@ -8204,7 +8204,7 @@ void DebugBreakOnDialog::setThreshold( unsigned long long int val )
//----------------------------------------------------------------------------
void DebugBreakOnDialog::setThreshold( const QString &text )
{
threshold = strtoull( text.toStdString().c_str(), NULL, 10 );
threshold = strtoull( text.toLocal8Bit().constData(), NULL, 10 );
updateLabel();
}

View File

@ -62,11 +62,11 @@ int getDirFromFile( const char *path, std::string &dir )
if (fi.exists())
{
dir = fi.canonicalPath().toStdString();
dir = fi.canonicalPath().toLocal8Bit().constData();
}
else
{
dir = fi.absolutePath().toStdString();
dir = fi.absolutePath().toLocal8Bit().constData();
}
//printf("Dir: '%s'\n", dir.c_str());
}
@ -535,13 +535,13 @@ void fceuDecIntValidtor::setMinMax( long long int min, long long int max)
QValidator::State fceuDecIntValidtor::validate(QString &input, int &pos) const
{
long long int i, v;
//printf("Validate: %i '%s'\n", input.size(), input.toStdString().c_str() );
//printf("Validate: %i '%s'\n", input.size(), input.toLocal8Bit().constData() );
if ( input.size() == 0 )
{
return QValidator::Acceptable;
}
std::string s = input.toStdString();
std::string s = input.toLocal8Bit().constData();
i=0;
if (s[i] == '-')
@ -602,14 +602,14 @@ void fceuHexIntValidtor::setMinMax( long long int min, long long int max)
QValidator::State fceuHexIntValidtor::validate(QString &input, int &pos) const
{
long long int i, v;
//printf("Validate: %i '%s'\n", input.size(), input.toStdString().c_str() );
//printf("Validate: %i '%s'\n", input.size(), input.toLocal8Bit().constData() );
if ( input.size() == 0 )
{
return QValidator::Acceptable;
}
input = input.toUpper();
std::string s = input.toStdString();
std::string s = input.toLocal8Bit().constData();
i=0;
if (s[i] == '-')

View File

@ -121,13 +121,13 @@ consoleWin_t::consoleWin_t(QWidget *parent)
int setFullScreen = false;
//QString libpath = QLibraryInfo::location(QLibraryInfo::PluginsPath);
//printf("LibPath: '%s'\n", libpath.toStdString().c_str() );
//printf("LibPath: '%s'\n", libpath.toLocal8Bit().constData() );
#ifdef __APPLE__
qt_set_sequence_auto_mnemonic(true);
#endif
printf("Running on Platform: %s\n", QGuiApplication::platformName().toStdString().c_str() );
printf("Running on Platform: %s\n", QGuiApplication::platformName().toLocal8Bit().constData() );
QThread *thread = QThread::currentThread();
@ -750,12 +750,12 @@ void consoleWin_t::dropEvent(QDropEvent *event)
(suffix[0] == 'f') && (suffix[1] == 'c') &&
( (suffix[2] == 's') || suffix[2].isDigit() );
//printf("DragNDrop Suffix: %s\n", suffix.toStdString().c_str() );
//printf("DragNDrop Suffix: %s\n", suffix.toLocal8Bit().constData() );
if (isStateSaveFile)
{
FCEU_WRAPPER_LOCK();
FCEUI_LoadState( filename.toStdString().c_str() );
FCEUI_LoadState( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
event->accept();
@ -765,12 +765,12 @@ void consoleWin_t::dropEvent(QDropEvent *event)
int luaLoadSuccess;
FCEU_WRAPPER_LOCK();
luaLoadSuccess = FCEU_LoadLuaCode( filename.toStdString().c_str() );
luaLoadSuccess = FCEU_LoadLuaCode( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
if (luaLoadSuccess)
{
g_config->setOption("SDL.LastLoadLua", filename.toStdString().c_str());
g_config->setOption("SDL.LastLoadLua", filename.toLocal8Bit().constData());
}
event->accept();
}
@ -779,12 +779,12 @@ void consoleWin_t::dropEvent(QDropEvent *event)
int romLoadSuccess;
FCEU_WRAPPER_LOCK();
romLoadSuccess = LoadGame( filename.toStdString().c_str() );
romLoadSuccess = LoadGame( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
if (!romLoadSuccess)
{
printf("DragNDrop ROM Load Failed for %s\n", filename.toStdString().c_str() );
printf("DragNDrop ROM Load Failed for %s\n", filename.toLocal8Bit().constData() );
}
event->accept();
}
@ -2514,13 +2514,13 @@ void consoleWin_t::openROMFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastOpenFile", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastOpenFile", filename.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
CloseGame ();
LoadGame ( filename.toStdString().c_str() );
LoadGame ( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
return;
@ -2528,10 +2528,10 @@ void consoleWin_t::openROMFile(void)
void consoleWin_t::loadRomRequestCB( QString s )
{
printf("Load ROM Req: '%s'\n", s.toStdString().c_str() );
printf("Load ROM Req: '%s'\n", s.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
CloseGame ();
LoadGame ( s.toStdString().c_str() );
LoadGame ( s.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
}
@ -2607,12 +2607,12 @@ void consoleWin_t::loadNSF(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastOpenNSF", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastOpenNSF", filename.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
LoadGame( filename.toStdString().c_str() );
LoadGame( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
}
@ -2691,12 +2691,12 @@ void consoleWin_t::loadStateFrom(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastLoadStateFrom", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastLoadStateFrom", filename.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
FCEUI_LoadState( filename.toStdString().c_str() );
FCEUI_LoadState( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
}
@ -2782,12 +2782,12 @@ void consoleWin_t::saveStateAs(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastSaveStateAs", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastSaveStateAs", filename.toLocal8Bit().constData() );
FCEU_WRAPPER_LOCK();
FCEUI_SaveState( filename.toStdString().c_str() );
FCEUI_SaveState( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
}
@ -3381,7 +3381,7 @@ void consoleWin_t::warnAmbiguousShortcut( QShortcut *shortcut)
std::string msg;
int c = 0;
sprintf( stmp, "Error: Ambiguous Shortcut Activation for Key Sequence: '%s'\n", shortcut->key().toString().toStdString().c_str() );
sprintf( stmp, "Error: Ambiguous Shortcut Activation for Key Sequence: '%s'\n", shortcut->key().toString().toLocal8Bit().constData() );
msg.assign( stmp );
@ -3576,12 +3576,12 @@ void consoleWin_t::loadGameGenieROM(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastOpenFile", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastOpenFile", filename.toLocal8Bit().constData() );
// copy file to proper place (~/.fceux/gg.rom)
std::ifstream f1 ( filename.toStdString().c_str(), std::fstream::binary);
std::ifstream f1 ( filename.toLocal8Bit().constData(), std::fstream::binary);
std::string fn_out = FCEU_MakeFName (FCEUMKF_GGROM, 0, "");
std::ofstream f2 (fn_out.c_str (),
std::fstream::trunc | std::fstream::binary);
@ -3671,10 +3671,10 @@ void consoleWin_t::fdsLoadBiosFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
// copy BIOS file to proper place (~/.fceux/disksys.rom)
std::ifstream fdsBios (filename.toStdString().c_str(), std::fstream::binary);
std::ifstream fdsBios (filename.toLocal8Bit().constData(), std::fstream::binary);
std::string output_filename =
FCEU_MakeFName (FCEUMKF_FDSROM, 0, "");
std::ofstream outFile (output_filename.c_str (),
@ -4106,11 +4106,11 @@ void consoleWin_t::aviRecordAsStart(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
FCEUI_printf ("AVI Recording movie to %s\n", filename.toStdString().c_str() );
FCEUI_printf ("AVI Recording movie to %s\n", filename.toLocal8Bit().constData() );
lastPath = QFileInfo(filename).absolutePath().toStdString();
lastPath = QFileInfo(filename).absolutePath().toLocal8Bit().constData();
if ( lastPath.size() > 0 )
{
@ -4118,7 +4118,7 @@ void consoleWin_t::aviRecordAsStart(void)
}
FCEU_WRAPPER_LOCK();
if ( aviRecordOpenFile( filename.toStdString().c_str() ) == 0 )
if ( aviRecordOpenFile( filename.toLocal8Bit().constData() ) == 0 )
{
aviDiskThread->start();
}
@ -4298,11 +4298,11 @@ void consoleWin_t::wavRecordAsStart(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
FCEUI_printf ("WAV Recording movie to %s\n", filename.toStdString().c_str() );
FCEUI_printf ("WAV Recording movie to %s\n", filename.toLocal8Bit().constData() );
lastPath = QFileInfo(filename).absolutePath().toStdString();
lastPath = QFileInfo(filename).absolutePath().toLocal8Bit().constData();
if ( lastPath.size() > 0 )
{
@ -4310,7 +4310,7 @@ void consoleWin_t::wavRecordAsStart(void)
}
FCEU_WRAPPER_LOCK();
FCEUI_BeginWaveRecord( filename.toStdString().c_str() );
FCEUI_BeginWaveRecord( filename.toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
}
@ -4969,7 +4969,7 @@ consoleRecentRomAction::consoleRecentRomAction(QString desc, QWidget *parent)
QString txt;
QFileInfo fi(desc);
path = desc.toStdString();
path = desc.toLocal8Bit().constData();
txt = fi.fileName();
txt += QString("\t");

View File

@ -858,9 +858,9 @@ void FKBConfigDialog::openFontDialog(void)
keyboard->setFont( selFont );
keyboard->update();
//printf("Font Changed to: '%s'\n", font.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", font.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.FamilyKeyboardFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.FamilyKeyboardFont", selFont.toString().toLocal8Bit().constData() );
QTimer::singleShot( 100, this, SLOT(keyTreeResizeDone(void)) );
}
@ -1189,9 +1189,9 @@ void FKBConfigDialog::mappingLoad(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
mappingLoad( filename.toStdString().c_str() );
mappingLoad( filename.toLocal8Bit().constData() );
return;
}
@ -1432,7 +1432,7 @@ void FKBConfigDialog::mappingSaveAs(void)
return;
}
saveFileName = filename.toStdString();
saveFileName = filename.toLocal8Bit().constData();
mappingSave();
}

View File

@ -60,14 +60,14 @@ class fceuGGCodeValidtor : public QValidator
QValidator::State validate(QString &input, int &pos) const
{
int i,j, ok;
//printf("Validate: %i '%s'\n", input.size(), input.toStdString().c_str() );
//printf("Validate: %i '%s'\n", input.size(), input.toLocal8Bit().constData() );
if ( input.size() == 0 )
{
return QValidator::Acceptable;
}
input = input.toUpper();
std::string s = input.toStdString();
std::string s = input.toLocal8Bit().constData();
i=0;
while ( s[i] != 0 )
@ -262,19 +262,19 @@ void GameGenieDialog_t::addCheatClicked(void)
int a = -1, v = -1, c = -1;
std::string name;
name = ggCode->text().toStdString();
name = ggCode->text().toLocal8Bit().constData();
if ( addr->text().size() > 0 )
{
a = strtol( addr->text().toStdString().c_str(), NULL, 16 );
a = strtol( addr->text().toLocal8Bit().constData(), NULL, 16 );
}
if ( val->text().size() > 0 )
{
v = strtol( val->text().toStdString().c_str(), NULL, 16 );
v = strtol( val->text().toLocal8Bit().constData(), NULL, 16 );
}
if ( cmp->text().size() > 0 )
{
c = strtol( cmp->text().toStdString().c_str(), NULL, 16 );
c = strtol( cmp->text().toLocal8Bit().constData(), NULL, 16 );
}
FCEU_WRAPPER_LOCK();
@ -288,7 +288,7 @@ void GameGenieDialog_t::romAddrDoubleClicked(QTreeWidgetItem *item, int column)
{
int addr;
addr = strtol( item->text(0).toStdString().c_str(), NULL, 16 );
addr = strtol( item->text(0).toLocal8Bit().constData(), NULL, 16 );
printf("ROM Addr: %06X \n", addr );
@ -300,12 +300,12 @@ void GameGenieDialog_t::addrChanged(const QString &s)
int a, v, c = -1;
char gg[12];
a = strtol( s.toStdString().c_str(), NULL, 16 );
v = strtol( val->text().toStdString().c_str(), NULL, 16 );
a = strtol( s.toLocal8Bit().constData(), NULL, 16 );
v = strtol( val->text().toLocal8Bit().constData(), NULL, 16 );
if ( cmp->text().size() > 0 )
{
c = strtol( cmp->text().toStdString().c_str(), NULL, 16 );
c = strtol( cmp->text().toLocal8Bit().constData(), NULL, 16 );
}
EncodeGG( gg, a, v, c );
@ -320,12 +320,12 @@ void GameGenieDialog_t::cmpChanged(const QString &s)
int a, v, c = -1;
char gg[12];
a = strtol( addr->text().toStdString().c_str(), NULL, 16 );
v = strtol( val->text().toStdString().c_str(), NULL, 16 );
a = strtol( addr->text().toLocal8Bit().constData(), NULL, 16 );
v = strtol( val->text().toLocal8Bit().constData(), NULL, 16 );
if ( s.size() > 0 )
{
c = strtol( s.toStdString().c_str(), NULL, 16 );
c = strtol( s.toLocal8Bit().constData(), NULL, 16 );
}
EncodeGG( gg, a, v, c );
@ -340,12 +340,12 @@ void GameGenieDialog_t::valChanged(const QString &s)
int a, v, c = -1;
char gg[12];
a = strtol( addr->text().toStdString().c_str(), NULL, 16 );
v = strtol( s.toStdString().c_str(), NULL, 16 );
a = strtol( addr->text().toLocal8Bit().constData(), NULL, 16 );
v = strtol( s.toLocal8Bit().constData(), NULL, 16 );
if ( cmp->text().size() > 0 )
{
c = strtol( cmp->text().toStdString().c_str(), NULL, 16 );
c = strtol( cmp->text().toLocal8Bit().constData(), NULL, 16 );
}
EncodeGG( gg, a, v, c );
@ -362,7 +362,7 @@ void GameGenieDialog_t::ggChanged(const QString &s)
memset( gg, 0, sizeof(gg) );
strncpy( gg, ggCode->text().toStdString().c_str(), 8 );
strncpy( gg, ggCode->text().toLocal8Bit().constData(), 8 );
FCEUI_DecodeGG( gg, &a, &v, &c);
@ -442,15 +442,15 @@ void GameGenieDialog_t::ListGGAddresses(void)
if ( addr->text().size() > 0 )
{
a = strtol( addr->text().toStdString().c_str(), NULL, 16 );
a = strtol( addr->text().toLocal8Bit().constData(), NULL, 16 );
}
if ( val->text().size() > 0 )
{
v = strtol( val->text().toStdString().c_str(), NULL, 16 );
v = strtol( val->text().toLocal8Bit().constData(), NULL, 16 );
}
if ( cmp->text().size() > 0 )
{
c = strtol( cmp->text().toStdString().c_str(), NULL, 16 );
c = strtol( cmp->text().toLocal8Bit().constData(), NULL, 16 );
}
// also enable/disable the add GG button here
addCheatEmable = (a >= 0) && ( (ggCode->text().size() == 6) || (ggCode->text().size() == 8) );

View File

@ -607,7 +607,7 @@ void GamePadConfDialog_t::loadMapList(void)
for (int i = 0; i < static_cast<int>(fileList.size()); i++)
{
size_t suffixIdx;
std::string fileName = fileList[i].toStdString();
std::string fileName = fileList[i].toLocal8Bit().constData();
suffixIdx = fileName.find_last_of('.');
@ -1103,7 +1103,7 @@ void GamePadConfDialog_t::saveConfig(void)
sprintf(stmp, "SDL.Input.GamePad.%u.", portNum);
prefix = stmp;
mapName = mapSel->currentText().toStdString();
mapName = mapSel->currentText().toLocal8Bit().constData();
guid = GamePad[portNum].getGUID();
@ -1151,7 +1151,7 @@ void GamePadConfDialog_t::newProfileCallback(void)
if (QDialog::Accepted == ret)
{
createNewProfile(dialog.textValue().toStdString().c_str());
createNewProfile(dialog.textValue().toLocal8Bit().constData());
}
}
//----------------------------------------------------
@ -1164,7 +1164,7 @@ void GamePadConfDialog_t::loadProfileCallback(void)
index = devSel->currentIndex();
devIdx = devSel->itemData(index).toInt();
mapName = mapSel->currentText().toStdString();
mapName = mapSel->currentText().toLocal8Bit().constData();
GamePad[portNum].setDeviceIndex(devIdx);
@ -1199,7 +1199,7 @@ void GamePadConfDialog_t::saveProfileCallback(void)
std::string mapName;
char stmp[256];
mapName = mapSel->currentText().toStdString();
mapName = mapSel->currentText().toLocal8Bit().constData();
ret = GamePad[portNum].saveCurrentMapToFile(mapName.c_str());
@ -1222,7 +1222,7 @@ void GamePadConfDialog_t::deleteProfileCallback(void)
std::string mapName;
char stmp[256];
mapName = mapSel->currentText().toStdString();
mapName = mapSel->currentText().toLocal8Bit().constData();
ret = GamePad[portNum].deleteMapping(mapName.c_str());
@ -2226,7 +2226,7 @@ void GamePadConfigHotKey_t::setKeyNameLbl( QLineEdit *lbl )
void GamePadConfigHotKey_t::keyPressEvent(QKeyEvent *event)
{
bool isModifier;
//printf("GamePad Hot Key Press: 0x%x '%s'\n", event->key(), event->text().toStdString().c_str() );
//printf("GamePad Hot Key Press: 0x%x '%s'\n", event->key(), event->text().toLocal8Bit().constData() );
isModifier = (event->key() == Qt::Key_Shift ) ||
(event->key() == Qt::Key_Control ) ||
@ -2241,7 +2241,7 @@ void GamePadConfigHotKey_t::keyPressEvent(QKeyEvent *event)
k->keySeq[idx].key = event->key();
k->keySeq[idx].modifier = event->modifiers();
k->keySeq[idx].name = ks.toString().toStdString();
k->keySeq[idx].name = ks.toString().toLocal8Bit().constData();
if ( keySeqLbl )
{

View File

@ -66,7 +66,7 @@ GuiConfDialog_t::GuiConfDialog_t(QWidget *parent)
QSettings settings;
//resize( 512, 600 );
//printf("Style: %s \n", style()->objectName().toStdString().c_str() );
//printf("Style: %s \n", style()->objectName().toLocal8Bit().constData() );
selStyle = style()->objectName();
@ -153,7 +153,7 @@ GuiConfDialog_t::GuiConfDialog_t(QWidget *parent)
if ( selStyle.compare( styleKeys[i], Qt::CaseInsensitive ) == 0 )
{
//printf("Style Match: %s \n", selStyle.toStdString().c_str() );
//printf("Style Match: %s \n", selStyle.toLocal8Bit().constData() );
styleComboBox->setCurrentIndex(i);
}
}
@ -348,7 +348,7 @@ void GuiConfDialog_t::styleChanged(int index)
s = styleComboBox->currentText();
g_config->setOption("SDL.GuiStyle", s.toStdString().c_str() );
g_config->setOption("SDL.GuiStyle", s.toLocal8Bit().constData() );
g_config->save();
QApplication::setStyle( new fceuStyle() );
@ -389,7 +389,7 @@ void GuiConfDialog_t::openQss(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
}
#ifdef WIN32
@ -400,7 +400,7 @@ void GuiConfDialog_t::openQss(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
@ -446,11 +446,11 @@ void GuiConfDialog_t::openQss(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
custom_qss_path->setText(filename.toStdString().c_str());
custom_qss_path->setText(filename.toLocal8Bit().constData());
g_config->setOption("SDL.QtStyleSheet", filename.toStdString().c_str() );
g_config->setOption("SDL.QtStyleSheet", filename.toLocal8Bit().constData() );
g_config->save();
QApplication::setStyle( new fceuStyle() );
@ -493,7 +493,7 @@ void GuiConfDialog_t::openQPal(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
}
#ifdef WIN32
@ -504,7 +504,7 @@ void GuiConfDialog_t::openQPal(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
@ -550,11 +550,11 @@ void GuiConfDialog_t::openQPal(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
custom_qpal_path->setText(filename.toStdString().c_str());
custom_qpal_path->setText(filename.toLocal8Bit().constData());
g_config->setOption("SDL.QPaletteFile", filename.toStdString().c_str() );
g_config->setOption("SDL.QPaletteFile", filename.toLocal8Bit().constData() );
g_config->save();
QApplication::setStyle( new fceuStyle() );
@ -602,7 +602,7 @@ fceuStyle::fceuStyle(QStyle *style) : QProxyStyle(style)
fceuStyle::~fceuStyle(void)
{
//printf("Style Deleted: %s\n", objectName().toStdString().c_str() );
//printf("Style Deleted: %s\n", objectName().toLocal8Bit().constData() );
if ( rccFilePath.size() > 0 )
{
@ -636,11 +636,11 @@ QStyle *fceuStyle::styleBase(QStyle *style) const
for (i=0; i<styleKeys.size(); i++)
{
//printf("Style: '%s'\n", styleKeys[i].toStdString().c_str() );
//printf("Style: '%s'\n", styleKeys[i].toLocal8Bit().constData() );
if ( styleName.compare( styleKeys[i], Qt::CaseInsensitive ) == 0 )
{
//printf("Style Match: %s\n", styleKeys[i].toStdString().c_str() );
//printf("Style Match: %s\n", styleKeys[i].toLocal8Bit().constData() );
idx = i;
break;
}
@ -903,7 +903,7 @@ static int writeQPaletteToFile( const char *path, QPalette *pal )
{
c = pal->color( g, r );
fprintf( fp, "%s::%s = %s \n", gTxt, rTxt, c.name().toStdString().c_str() );
fprintf( fp, "%s::%s = %s \n", gTxt, rTxt, c.name().toLocal8Bit().constData() );
}
}
}
@ -1200,7 +1200,7 @@ void GuiPaletteEditDialog_t::paletteSaveAs(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
}
#ifdef WIN32
@ -1211,7 +1211,7 @@ void GuiPaletteEditDialog_t::paletteSaveAs(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
@ -1258,11 +1258,11 @@ void GuiPaletteEditDialog_t::paletteSaveAs(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
writeQPaletteToFile( filename.toStdString().c_str(), &pal );
writeQPaletteToFile( filename.toLocal8Bit().constData(), &pal );
//g_config->setOption("SDL.QPaletteFile", filename.toStdString().c_str() );
//g_config->setOption("SDL.QPaletteFile", filename.toLocal8Bit().constData() );
//g_config->save();
//QApplication::setStyle( new fceuStyle() );
@ -1357,7 +1357,7 @@ void GuiPaletteColorSelect::updateColor(void)
txtColor.setRgb( 255, 255, 255 );
}
sprintf( stmp, "QLabel { background-color : %s; color : %s; border-color : black; }",
color.name().toStdString().c_str(), txtColor.name().toStdString().c_str() );
color.name().toLocal8Bit().constData(), txtColor.name().toLocal8Bit().constData() );
lbl->setStyleSheet( stmp );
}

View File

@ -73,7 +73,7 @@ void consoleWin_t::OpenHelpWindow(std::string subpage)
if ( !QFile( QString::fromStdString(helpFileName) ).exists() )
{
// Search for MacOSX DragNDrop Resources
helpFileName = QApplication::applicationDirPath().toStdString() + "/../Resources/fceux.qhc";
helpFileName = QApplication::applicationDirPath().toLocal8Bit() + "/../Resources/fceux.qhc";
}
#endif
}
@ -207,11 +207,11 @@ std::string consoleWin_t::findHelpFile(void)
{
return last;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.HelpFilePath", filename.toStdString().c_str() );
g_config->setOption ("SDL.HelpFilePath", filename.toLocal8Bit().constData() );
return filename.toStdString();
return filename.toLocal8Bit().constData();
}
//#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)

View File

@ -1048,7 +1048,7 @@ void HexEditorFindDialog_t::runSearch(void)
{
int i=0;
unsigned char v;
std::string s = searchBox->text().toStdString();
std::string s = searchBox->text().toLocal8Bit().constData();
std::vector <unsigned char> varray;
if ( s.size() == 0 )
@ -1667,9 +1667,9 @@ void HexEditorDialog_t::saveRomFileAs(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
iNesSaveAs( filename.toStdString().c_str() );
iNesSaveAs( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------------------------------
void HexEditorDialog_t::loadTableFromFile(void)
@ -1709,9 +1709,9 @@ void HexEditorDialog_t::loadTableFromFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
editor->charTable.loadFromFile( filename.toStdString().c_str() );
editor->charTable.loadFromFile( filename.toLocal8Bit().constData() );
unloadTableAct->setEnabled( editor->charTable.customMapLoaded );
}
@ -2118,9 +2118,9 @@ void QHexEdit::changeFontRequest(void)
calcFontData();
//printf("Font Changed to: '%s'\n", font.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", font.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.HexEditFont", font.toString().toStdString().c_str() );
g_config->setOption("SDL.HexEditFont", font.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -2337,7 +2337,7 @@ void QHexEdit::loadClipboard( const char *txt )
void QHexEdit::pasteFromClipboard(void)
{
int i, nbytes=0, val, addr;
std::string s = clipboard->text().toStdString();
std::string s = clipboard->text().toLocal8Bit().constData();
const char *c;
unsigned char *buf;
@ -3258,7 +3258,7 @@ void QHexEdit::addBookMarkCB(void)
if ( QDialog::Accepted == ret )
{
hbm.addBookMark( ctxAddr, viewMode, dialog.textValue().toStdString().c_str() );
hbm.addBookMark( ctxAddr, viewMode, dialog.textValue().toLocal8Bit().constData() );
parent->populateBookmarkMenu();
}
}

View File

@ -442,7 +442,7 @@ void HotKeyConfSetDialog_t::assignHotkey(QKeyEvent *event)
(k == SDLK_LGUI) || (k == SDLK_RGUI) ||
(k == SDLK_CAPSLOCK);
//printf("Assign: '%s' %i 0x%08x\n", ks.toString().toStdString().c_str(), event->key(), event->key() );
//printf("Assign: '%s' %i 0x%08x\n", ks.toString().toLocal8Bit().constData(), event->key(), event->key() );
if ((k != SDLK_UNKNOWN) && !keyIsModifier)
{
@ -452,7 +452,7 @@ void HotKeyConfSetDialog_t::assignHotkey(QKeyEvent *event)
confName = prefix + Hotkeys[item->hkIdx].getConfigName();
keyText = ks.toString().toStdString();
keyText = ks.toString().toLocal8Bit().constData();
g_config->setOption( confName, keyText);

View File

@ -509,10 +509,10 @@ void InputConfDialog_t::openLoadPresetFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
FCEU_WRAPPER_LOCK();
loadInputSettingsFromFile(filename.toStdString().c_str());
loadInputSettingsFromFile(filename.toLocal8Bit().constData());
FCEU_WRAPPER_UNLOCK();
updatePortLabels();
@ -581,9 +581,9 @@ void InputConfDialog_t::openSavePresetFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
saveInputSettingsToFile(filename.toStdString().c_str());
saveInputSettingsToFile(filename.toLocal8Bit().constData());
}
//----------------------------------------------------------------------------
void InputConfDialog_t::updatePeriodic(void)

View File

@ -406,9 +406,9 @@ void LuaControlDialog_t::openLuaScriptFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption("SDL.LastLoadLua", filename.toStdString().c_str());
g_config->setOption("SDL.LastLoadLua", filename.toLocal8Bit().constData());
scriptPath->setText(filename);
@ -420,10 +420,10 @@ void LuaControlDialog_t::startLuaScript(void)
#ifdef _S9XLUA_H
outBuf.clear();
FCEU_WRAPPER_LOCK();
if (0 == FCEU_LoadLuaCode(scriptPath->text().toStdString().c_str(), scriptArgs->text().toStdString().c_str()))
if (0 == FCEU_LoadLuaCode(scriptPath->text().toLocal8Bit().constData(), scriptArgs->text().toLocal8Bit().constData()))
{
char error_msg[2048];
sprintf( error_msg, "Error: Could not open the selected lua script: '%s'\n", scriptPath->text().toStdString().c_str());
sprintf( error_msg, "Error: Could not open the selected lua script: '%s'\n", scriptPath->text().toLocal8Bit().constData());
FCEUD_PrintError(error_msg);
}
FCEU_WRAPPER_UNLOCK();

View File

@ -241,7 +241,7 @@ void MoviePlayDialog_t::updateMovieText(void)
}
idx = movSelBox->currentIndex();
path = movSelBox->itemText(idx).toStdString();
path = movSelBox->itemText(idx).toLocal8Bit().constData();
fp = FCEU_fopen(path.c_str(), 0, "rb", 0);
@ -337,7 +337,7 @@ int MoviePlayDialog_t::addFileToList(const char *file, bool setActive)
for (int i = 0; i < movSelBox->count(); i++)
{
if (strcmp(file, movSelBox->itemText(i).toStdString().c_str()) == 0)
if (strcmp(file, movSelBox->itemText(i).toLocal8Bit().constData()) == 0)
{
if (setActive)
{
@ -402,7 +402,7 @@ void MoviePlayDialog_t::scanDirectory(const char *dirPath, const char *md5)
{
QFileInfo fileInfo = list.at(i);
path = std::string(dirPath) + fileInfo.fileName().toStdString();
path = std::string(dirPath) + fileInfo.fileName().toLocal8Bit().constData();
//printf("File: '%s'\n", path.c_str() );
@ -465,13 +465,13 @@ void MoviePlayDialog_t::playMovie(void)
idx = movSelBox->currentIndex();
path = movSelBox->itemText(idx).toStdString();
path = movSelBox->itemText(idx).toLocal8Bit().constData();
replayReadOnlySetting = openReadOnly->isChecked();
if (pauseAtFrame->isChecked())
{
pauseframe = strtol(pauseAtFrameEntry->text().toStdString().c_str(), NULL, 0);
pauseframe = strtol(pauseAtFrameEntry->text().toLocal8Bit().constData(), NULL, 0);
}
FCEU_WRAPPER_LOCK();
@ -539,7 +539,7 @@ void MoviePlayDialog_t::openMovie(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
if (GameInfo)
{
@ -547,7 +547,7 @@ void MoviePlayDialog_t::openMovie(void)
strcpy(md5, md5_asciistr(GameInfo->MD5));
if (checkMD5Sum(filename.toStdString().c_str(), md5))
if (checkMD5Sum(filename.toLocal8Bit().constData(), md5))
{
md5Match = 1;
}
@ -558,11 +558,11 @@ void MoviePlayDialog_t::openMovie(void)
}
}
addFileToList(filename.toStdString().c_str(), true);
addFileToList(filename.toLocal8Bit().constData(), true);
updateMovieText();
g_config->setOption("SDL.LastOpenMovie", filename.toStdString().c_str());
g_config->setOption("SDL.LastOpenMovie", filename.toLocal8Bit().constData());
return;
}

View File

@ -156,7 +156,7 @@ void MovieRecordDialog_t::setFilePath( QString s )
dirEdit->setText( fi.absolutePath() );
fileEdit->setText( fi.fileName() );
filepath = s.toStdString();
filepath = s.toLocal8Bit().constData();
}
//----------------------------------------------------------------------------
void MovieRecordDialog_t::stateSelChanged( int idx )
@ -249,11 +249,11 @@ void MovieRecordDialog_t::setLoadState(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption ("SDL.LastLoadStateFrom", filename.toStdString().c_str() );
g_config->setOption ("SDL.LastLoadStateFrom", filename.toLocal8Bit().constData() );
ic_file = filename.toStdString();
ic_file = filename.toLocal8Bit().constData();
}
//----------------------------------------------------------------------------
void MovieRecordDialog_t::recordMovie(void)
@ -300,7 +300,7 @@ void MovieRecordDialog_t::recordMovie(void)
if ( startRecording )
{
std::string s = authorEdit->text().toStdString();
std::string s = authorEdit->text().toLocal8Bit().constData();
std::wstring author (s.begin (), s.end ());
FCEUI_printf("Recording movie to %s\n", filepath.c_str ());
FCEUI_SaveMovie (filepath.c_str(), flags, author);
@ -356,13 +356,13 @@ void MovieRecordDialog_t::browseFiles(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
int pauseframe;
g_config->getOption ("SDL.PauseFrame", &pauseframe);
g_config->setOption ("SDL.PauseFrame", 0);
FCEUI_printf ("Recording movie to %s\n", filename.toStdString().c_str() );
FCEUI_printf ("Recording movie to %s\n", filename.toLocal8Bit().constData() );
setFilePath( filename );
return;

View File

@ -516,19 +516,19 @@ void PaletteConfDialog_t::openPaletteFile(void)
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#ifdef __APPLE__
// Search for MacOSX DragNDrop Resources
d.setPath(QString(exePath) + "/../Resources/palettes");
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
//printf("Looking for: '%s'\n", d.path().toLocal8Bit().constData());
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
}
@ -553,12 +553,12 @@ void PaletteConfDialog_t::openPaletteFile(void)
d.setPath(QString("/usr/share/fceux/palettes"));
}
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
//printf("Looking for: '%s'\n", d.path().toLocal8Bit().constData());
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
@ -604,18 +604,18 @@ void PaletteConfDialog_t::openPaletteFile(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
if (fceuWrapperTryLock())
{
if (LoadCPalette(filename.toStdString().c_str()))
if (LoadCPalette(filename.toLocal8Bit().constData()))
{
g_config->setOption("SDL.Palette", filename.toStdString().c_str());
custom_palette_path->setText(filename.toStdString().c_str());
g_config->setOption("SDL.Palette", filename.toLocal8Bit().constData());
custom_palette_path->setText(filename.toLocal8Bit().constData());
}
else
{
printf("Error: Failed to Load Palette File: %s \n", filename.toStdString().c_str());
printf("Error: Failed to Load Palette File: %s \n", filename.toLocal8Bit().constData());
}
palupdate = 1;
fceuWrapperUnLock();

View File

@ -335,19 +335,19 @@ void PaletteEditorDialog_t::openPaletteFileDialog(void)
if ( d.exists() )
{
urls << QUrl::fromLocalFile( d.absolutePath() );
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#ifdef __APPLE__
// Search for MacOSX DragNDrop Resources
d.setPath(QString(exePath) + "/../Resources/palettes");
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
//printf("Looking for: '%s'\n", d.path().toLocal8Bit().constData());
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
}
@ -372,12 +372,12 @@ void PaletteEditorDialog_t::openPaletteFileDialog(void)
d.setPath(QString("/usr/share/fceux/palettes"));
}
//printf("Looking for: '%s'\n", d.path().toStdString().c_str());
//printf("Looking for: '%s'\n", d.path().toLocal8Bit().constData());
if (d.exists())
{
urls << QUrl::fromLocalFile(d.absolutePath());
iniPath = d.absolutePath().toStdString();
iniPath = d.absolutePath().toLocal8Bit().constData();
}
#endif
@ -428,10 +428,10 @@ void PaletteEditorDialog_t::openPaletteFileDialog(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
palView->loadFromFile( filename.toStdString().c_str() );
g_config->setOption ("SDL.Palette", filename.toStdString().c_str() );
palView->loadFromFile( filename.toLocal8Bit().constData() );
g_config->setOption ("SDL.Palette", filename.toLocal8Bit().constData() );
return;
}
@ -481,9 +481,9 @@ void PaletteEditorDialog_t::savePaletteFileDialog(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
palView->saveToFile( filename.toStdString().c_str() );
palView->saveToFile( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------------------------------
void PaletteEditorDialog_t::exportPaletteFileDialog(void)
@ -531,9 +531,9 @@ void PaletteEditorDialog_t::exportPaletteFileDialog(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
palView->exportToFileACT( filename.toStdString().c_str() );
palView->exportToFileACT( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------------------------------
//---NES Color Palette Viewer

View File

@ -666,7 +666,7 @@ void EmuScriptObject::exit()
//----------------------------------------------------
void EmuScriptObject::message(const QString& msg)
{
FCEU_DispMessage("%s",0, msg.toStdString().c_str());
FCEU_DispMessage("%s",0, msg.toLocal8Bit().constData());
}
//----------------------------------------------------
void EmuScriptObject::speedMode(const QString& mode)
@ -1933,7 +1933,7 @@ void QtScriptInstance::loadObjectChildren(QJSValue& jsObject, QObject* obj)
if (!name.isEmpty())
{
//printf("Object: %s.%s\n", obj->objectName().toStdString().c_str(), child->objectName().toStdString().c_str());
//printf("Object: %s.%s\n", obj->objectName().toLocal8Bit().constData(), child->objectName().toLocal8Bit().constData());
QJSValue newJsObj = engine->newQObject(child);
@ -3158,9 +3158,9 @@ void QScriptDialog_t::openScriptFile(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
g_config->setOption("SDL.LastLoadJs", filename.toStdString().c_str());
g_config->setOption("SDL.LastLoadJs", filename.toLocal8Bit().constData());
scriptPath->setText(filename);

View File

@ -127,13 +127,13 @@ public:
QValidator::State validate(QString &input, int &pos) const
{
int i;
//printf("Validate: %i '%s'\n", input.size(), input.toStdString().c_str() );
//printf("Validate: %i '%s'\n", input.size(), input.toLocal8Bit().constData() );
if (input.size() == 0)
{
return QValidator::Acceptable;
}
std::string s = input.toStdString();
std::string s = input.toLocal8Bit().constData();
i = 0;
if ((s[i] == '-') || (s[i] == '+'))
@ -648,7 +648,7 @@ static int64_t getLineEditValue(QLineEdit *edit, bool forceHex = false)
int64_t val = 0;
std::string s;
s = edit->text().toStdString();
s = edit->text().toLocal8Bit().constData();
if (s.size() > 0)
{

View File

@ -577,9 +577,9 @@ void RamWatchDialog_t::openListCB(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
loadWatchFile ( filename.toStdString().c_str() );
loadWatchFile ( filename.toLocal8Bit().constData() );
return;
}
@ -637,9 +637,9 @@ void RamWatchDialog_t::appendListCB(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
loadWatchFile( filename.toStdString().c_str(), 1 );
loadWatchFile( filename.toLocal8Bit().constData(), 1 );
}
//----------------------------------------------------------------------------
void RamWatchDialog_t::saveListCB(void)
@ -716,9 +716,9 @@ void RamWatchDialog_t::saveListAs(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
saveWatchFile( filename.toStdString().c_str() );
saveWatchFile( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------------------------------
void ramWatch_t::updateMem (void)
@ -893,7 +893,7 @@ void RamWatchDialog_t::openWatchEditWindow( ramWatch_t *rw, int mode)
{
int addr = -1, size = 1;
addr = ::strtol( addrEntry->text().toStdString().c_str(), NULL, 16 );
addr = ::strtol( addrEntry->text().toLocal8Bit().constData(), NULL, 16 );
if ( dataSize4Btn->isChecked() )
{
@ -910,12 +910,12 @@ void RamWatchDialog_t::openWatchEditWindow( ramWatch_t *rw, int mode)
if ( (rw == NULL) || mode )
{
ramWatchList.add_entry( notesEntry->text().toStdString().c_str(),
ramWatchList.add_entry( notesEntry->text().toLocal8Bit().constData(),
addr, unsignedTypeBtn->isChecked() ? 'u' : 's', size, isSep);
}
else
{
rw->name = notesEntry->text().toStdString();
rw->name = notesEntry->text().toLocal8Bit().constData();
rw->type = unsignedTypeBtn->isChecked() ? 'u' : 's';
rw->addr = addr;
rw->size = size;

View File

@ -794,8 +794,8 @@ int SymbolEditWindow::exec(void)
FCEU_WRAPPER_LOCK();
if ( isArrayBox->isChecked() )
{
size = atoi( arraySize->text().toStdString().c_str() );
init = atoi( arrayInit->text().toStdString().c_str() );
size = atoi( arraySize->text().toLocal8Bit().constData() );
init = atoi( arrayInit->text().toLocal8Bit().constData() );
for (i=0; i<size; i++)
{
@ -847,7 +847,7 @@ int SymbolEditWindow::exec(void)
{
if ( isNew || arrayCommentOverWrite->isChecked() || (i == 0) )
{
sym->commentAssign( commentEntry->toPlainText().toStdString() );
sym->commentAssign( commentEntry->toPlainText().toLocal8Bit().constData() );
}
}
sym->trimTrailingSpaces();
@ -865,8 +865,8 @@ int SymbolEditWindow::exec(void)
}
else if ( sym == NULL )
{
sym = new debugSymbol_t( addr, nameEntry->text().toStdString().c_str(),
commentEntry->toPlainText().toStdString().c_str());
sym = new debugSymbol_t( addr, nameEntry->text().toLocal8Bit().constData(),
commentEntry->toPlainText().toLocal8Bit().constData());
if ( debugSymbolTable.addSymbolAtBankOffset( bank, addr, sym ) )
{
@ -879,14 +879,14 @@ int SymbolEditWindow::exec(void)
}
else
{
if ( sym->updateName( nameEntry->text().toStdString().c_str() ) )
if ( sym->updateName( nameEntry->text().toLocal8Bit().constData() ) )
{
if (consoleWindow)
{
consoleWindow->QueueErrorMsgWindow( debugSymbolTable.errorMessage() );
}
}
sym->commentAssign( commentEntry->toPlainText().toStdString().c_str() );
sym->commentAssign( commentEntry->toPlainText().toLocal8Bit().constData() );
sym->trimTrailingSpaces();
}
}
@ -906,7 +906,7 @@ void SymbolEditWindow::determineArrayStart(void)
{
return;
}
strcpy( stmp, nameEntry->text().toStdString().c_str() );
strcpy( stmp, nameEntry->text().toLocal8Bit().constData() );
// Find Current Array Braces
i=0;
@ -967,7 +967,7 @@ void SymbolEditWindow::setSymNameWithArray(int idx)
{
return;
}
strcpy( stmp, nameEntry->text().toStdString().c_str() );
strcpy( stmp, nameEntry->text().toLocal8Bit().constData() );
// Remove Current Array Braces
i=0;

View File

@ -1301,7 +1301,7 @@ void TasEditorWindow::initHotKeys(void)
QKeySequence ks = Hotkeys[i].getKeySeq();
QShortcut *shortcut = Hotkeys[i].getShortcut();
//printf("HotKey: %i %s\n", i, ks.toString().toStdString().c_str() );
//printf("HotKey: %i %s\n", i, ks.toString().toLocal8Bit().constData() );
if ( hotkeyShortcut[i] == nullptr )
{
@ -1715,7 +1715,7 @@ bool TasEditorWindow::saveProjectAs(bool save_compact)
std::string msg;
msg = "Pre-existing TAS project file will be overwritten:\n\n" +
fi.fileName().toStdString() + "\n\nReplace file?";
std::string(fi.fileName().toLocal8Bit()) + "\n\nReplace file?";
ret = QMessageBox::warning( this, QObject::tr("Overwrite Warning"),
QString::fromStdString(msg), QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
@ -1725,18 +1725,18 @@ bool TasEditorWindow::saveProjectAs(bool save_compact)
return false;
}
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
project.renameProject( filename.toStdString().c_str(), true);
project.renameProject( filename.toLocal8Bit().constData(), true);
if (save_compact)
{
project.save( filename.toStdString().c_str(), taseditorConfig.saveCompact_SaveInBinary, taseditorConfig.saveCompact_SaveMarkers, taseditorConfig.saveCompact_SaveBookmarks, taseditorConfig.saveCompact_GreenzoneSavingMode, taseditorConfig.saveCompact_SaveHistory, taseditorConfig.saveCompact_SavePianoRoll, taseditorConfig.saveCompact_SaveSelection);
project.save( filename.toLocal8Bit().constData(), taseditorConfig.saveCompact_SaveInBinary, taseditorConfig.saveCompact_SaveMarkers, taseditorConfig.saveCompact_SaveBookmarks, taseditorConfig.saveCompact_GreenzoneSavingMode, taseditorConfig.saveCompact_SaveHistory, taseditorConfig.saveCompact_SavePianoRoll, taseditorConfig.saveCompact_SaveSelection);
}
else
{
project.save( filename.toStdString().c_str(), taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
project.save( filename.toLocal8Bit().constData(), taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
}
addRecentProject( filename.toStdString().c_str() );
addRecentProject( filename.toLocal8Bit().constData() );
// saved successfully - remove * mark from caption
project.reset();
updateCaption();
@ -1852,9 +1852,9 @@ void TasEditorWindow::openProject(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
loadProject( filename.toStdString().c_str());
loadProject( filename.toLocal8Bit().constData());
return;
}
@ -2030,9 +2030,9 @@ void TasEditorWindow::importMovieFile( const char *path )
QFileInfo fi( path );
// loaded successfully, now register Input changes
//char drv[512], dir[512], name[1024], ext[512];
//splitpath(filename.toStdString().c_str(), drv, dir, name, ext);
//splitpath(filename.toLocal8Bit().constData(), drv, dir, name, ext);
//strcat(name, ext);
int result = history.registerImport(md, fi.fileName().toStdString().c_str() );
int result = history.registerImport(md, fi.fileName().toLocal8Bit().constData() );
if (result >= 0)
{
greenzone.invalidateAndUpdatePlayback(result);
@ -2135,11 +2135,11 @@ void TasEditorWindow::importMovieFile(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
importMovieFile( filename.toStdString().c_str() );
importMovieFile( filename.toLocal8Bit().constData() );
//EMUFILE_FILE ifs( filename.toStdString().c_str(), "rb");
//EMUFILE_FILE ifs( filename.toLocal8Bit().constData(), "rb");
//// Load Input to temporary moviedata
//MovieData md;
@ -2148,9 +2148,9 @@ void TasEditorWindow::importMovieFile(void)
// QFileInfo fi( filename );
// // loaded successfully, now register Input changes
// //char drv[512], dir[512], name[1024], ext[512];
// //splitpath(filename.toStdString().c_str(), drv, dir, name, ext);
// //splitpath(filename.toLocal8Bit().constData(), drv, dir, name, ext);
// //strcat(name, ext);
// int result = history.registerImport(md, fi.fileName().toStdString().c_str() );
// int result = history.registerImport(md, fi.fileName().toLocal8Bit().constData() );
// if (result >= 0)
// {
// greenzone.invalidateAndUpdatePlayback(result);
@ -2256,7 +2256,7 @@ void TasEditorWindow::exportMovieFile(void)
return;
}
EMUFILE* osRecordingMovie = FCEUD_UTF8_fstream( filename.toStdString().c_str(), "wb");
EMUFILE* osRecordingMovie = FCEUD_UTF8_fstream( filename.toLocal8Bit().constData(), "wb");
// create copy of current movie data
MovieData temp_md = currMovieData;
// modify the copy according to selected type of export
@ -2551,7 +2551,7 @@ bool TasEditorWindow::saveCompactGetFilename( QString &outputFilePath )
std::string msg;
msg = "Pre-existing TAS project file will be overwritten:\n\n" +
fi.fileName().toStdString() + "\n\nReplace file?";
std::string(fi.fileName().toLocal8Bit()) + "\n\nReplace file?";
ret = QMessageBox::warning( this, QObject::tr("Overwrite Warning"),
QString::fromStdString(msg), QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
@ -2563,7 +2563,7 @@ bool TasEditorWindow::saveCompactGetFilename( QString &outputFilePath )
}
outputFilePath = filename;
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
return true;
}
@ -2683,7 +2683,7 @@ void TasEditorWindow::saveProjectCompactCb(void)
if ( saveCompactGetFilename( filename ) )
{
project.save(filename.toStdString().c_str(), taseditorConfig.saveCompact_SaveInBinary, taseditorConfig.saveCompact_SaveMarkers, taseditorConfig.saveCompact_SaveBookmarks, taseditorConfig.saveCompact_GreenzoneSavingMode, taseditorConfig.saveCompact_SaveHistory, taseditorConfig.saveCompact_SavePianoRoll, taseditorConfig.saveCompact_SaveSelection);
project.save(filename.toLocal8Bit().constData(), taseditorConfig.saveCompact_SaveInBinary, taseditorConfig.saveCompact_SaveMarkers, taseditorConfig.saveCompact_SaveBookmarks, taseditorConfig.saveCompact_GreenzoneSavingMode, taseditorConfig.saveCompact_SaveHistory, taseditorConfig.saveCompact_SavePianoRoll, taseditorConfig.saveCompact_SaveSelection);
}
}
}
@ -3113,9 +3113,9 @@ void TasEditorWindow::changePianoRollFontCB(void)
{
pianoRoll->setFont( selFont );
//printf("Font Changed to: '%s'\n", selFont.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", selFont.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.TasPianoRollFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.TasPianoRollFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -3129,9 +3129,9 @@ void TasEditorWindow::changeBookmarksFontCB(void)
{
bookmarks.setFont( selFont );
//printf("Font Changed to: '%s'\n", selFont.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", selFont.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.TasBookmarksFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.TasBookmarksFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -3145,9 +3145,9 @@ void TasEditorWindow::changeBranchesFontCB(void)
{
branches.setFont( selFont );
//printf("Font Changed to: '%s'\n", selFont.toString().toStdString().c_str() );
//printf("Font Changed to: '%s'\n", selFont.toString().toLocal8Bit().constData() );
g_config->setOption("SDL.TasBranchesFont", selFont.toString().toStdString().c_str() );
g_config->setOption("SDL.TasBranchesFont", selFont.toString().toLocal8Bit().constData() );
}
}
//----------------------------------------------------------------------------
@ -5256,7 +5256,7 @@ void QPianoRoll::dragEnterEvent(QDragEnterEvent *event)
QList<QUrl> urls = event->mimeData()->urls();
QFileInfo fi( urls[0].toString( QUrl::PreferLocalFile ) );
//printf("Suffix: '%s'\n", fi.suffix().toStdString().c_str() );
//printf("Suffix: '%s'\n", fi.suffix().toLocal8Bit().constData() );
if ( fi.suffix().compare("fm3") == 0)
{
@ -5287,14 +5287,14 @@ void QPianoRoll::dropEvent(QDropEvent *event)
if ( fi.suffix().compare("fm3") == 0 )
{
FCEU_WRAPPER_LOCK();
tasWin->loadProject( fi.filePath().toStdString().c_str() );
tasWin->loadProject( fi.filePath().toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
event->accept();
}
else if ( fi.suffix().compare("fm2") == 0 )
{
FCEU_WRAPPER_LOCK();
tasWin->importMovieFile( fi.filePath().toStdString().c_str() );
tasWin->importMovieFile( fi.filePath().toLocal8Bit().constData() );
FCEU_WRAPPER_UNLOCK();
event->accept();
}
@ -7228,7 +7228,7 @@ void TasFindNoteWindow::findNextClicked(void)
{
return;
}
strncpy( markersManager->findNoteString, searchPattern->text().toStdString().c_str(), MAX_NOTE_LEN-1 );
strncpy( markersManager->findNoteString, searchPattern->text().toLocal8Bit().constData(), MAX_NOTE_LEN-1 );
markersManager->findNoteString[MAX_NOTE_LEN-1] = 0;
// scan frames from current Selection to the border
@ -7306,7 +7306,7 @@ TasRecentProjectAction::TasRecentProjectAction(QString desc, QWidget *parent)
QString txt;
QFileInfo fi(desc);
path = desc.toStdString();
path = desc.toLocal8Bit().constData();
txt = fi.fileName();
txt += QString("\t");

View File

@ -390,7 +390,7 @@ void MARKERS_MANAGER::updateEditedMarkerNote()
{
len = MAX_NOTE_LEN-1;
}
strncpy( new_text, tasWin->upperMarkerNote->text().toStdString().c_str(), MAX_NOTE_LEN-1 );
strncpy( new_text, tasWin->upperMarkerNote->text().toLocal8Bit().constData(), MAX_NOTE_LEN-1 );
new_text[len] = 0;
// check changes
if (strcmp(getNoteCopy(playback->displayedMarkerNumber).c_str(), new_text))
@ -416,7 +416,7 @@ void MARKERS_MANAGER::updateEditedMarkerNote()
{
len = MAX_NOTE_LEN-1;
}
strncpy( new_text, tasWin->lowerMarkerNote->text().toStdString().c_str(), MAX_NOTE_LEN-1 );
strncpy( new_text, tasWin->lowerMarkerNote->text().toLocal8Bit().constData(), MAX_NOTE_LEN-1 );
new_text[len] = 0;
// check changes

View File

@ -497,7 +497,7 @@ bool SPLICER::pasteInputFromClipboard()
int num_joypads = joysticksPerFrame[getInputType(currMovieData)];
int pos = *(current_selection->begin());
std::string stmp = tasWin->clipboard->text().toStdString();
std::string stmp = tasWin->clipboard->text().toLocal8Bit().constData();
const char *pGlobal = stmp.c_str();
// TAS recording info starts with "TAS "
@ -622,7 +622,7 @@ bool SPLICER::pasteInsertInputFromClipboard(void)
int num_joypads = joysticksPerFrame[getInputType(currMovieData)];
bool markers_changed = false;
int pos = *current_selection_begin;
std::string stmp = tasWin->clipboard->text().toStdString();
std::string stmp = tasWin->clipboard->text().toLocal8Bit().constData();
const char *pGlobal = stmp.c_str();
// TAS recording info starts with "TAS "
@ -743,7 +743,7 @@ void SPLICER::checkClipboardContents(void)
// check if clipboard contains TAS Editor Input data
clipboardSelection.clear();
int current_pos = -1;
std::string stmp = tasWin->clipboard->text().toStdString();
std::string stmp = tasWin->clipboard->text().toLocal8Bit().constData();
const char *pGlobal = stmp.c_str();
// TAS recording info starts with "TAS "
if (pGlobal[0]=='T' && pGlobal[1]=='A' && pGlobal[2]=='S')

View File

@ -612,9 +612,9 @@ void TraceLoggerDialog_t::openLogFile(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
logFilePath = filename.toStdString();
logFilePath = filename.toLocal8Bit().constData();
g_config->setOption("SDL.TraceLogSaveFilePath", logFilePath);
@ -2133,14 +2133,14 @@ void QTraceLogView::openBpEditWindow(int editIdx, watchpointinfo *wp, traceRecor
type |= BT_S;
}
s = addr1->text().toStdString();
s = addr1->text().toLocal8Bit().constData();
if (s.size() > 0)
{
start_addr = offsetStringToInt(type, s.c_str());
}
s = addr2->text().toStdString();
s = addr2->text().toLocal8Bit().constData();
if (s.size() > 0)
{
@ -2172,8 +2172,8 @@ void QTraceLogView::openBpEditWindow(int editIdx, watchpointinfo *wp, traceRecor
unsigned int retval;
std::string nameString, condString;
nameString = name->text().toStdString();
condString = cond->text().toStdString();
nameString = name->text().toLocal8Bit().constData();
condString = cond->text().toLocal8Bit().constData();
retval = NewBreak(nameString.c_str(), start_addr, end_addr, type, condString.c_str(), slot, enable);

View File

@ -321,9 +321,9 @@ int LoadGame(const char *path, bool silent)
// Resolve absolute path to file
if ( fi.exists() )
{
//printf("FI: '%s'\n", fi.absoluteFilePath().toStdString().c_str() );
//printf("FI: '%s'\n", fi.canonicalFilePath().toStdString().c_str() );
fullpath = fi.canonicalFilePath().toStdString();
//printf("FI: '%s'\n", fi.absoluteFilePath().toLocal8Bit().constData() );
//printf("FI: '%s'\n", fi.canonicalFilePath().toLocal8Bit().constData() );
fullpath = fi.canonicalFilePath().toLocal8Bit().constData();
}
else
{
@ -689,7 +689,7 @@ static void ShowUsage(const char *prog)
j=0;
for (i=0; i<styleList.size(); i++)
{
printf(" %16s ", styleList[i].toStdString().c_str() ); j++;
printf(" %16s ", styleList[i].toLocal8Bit().constData() ); j++;
if ( j >= 4 )
{
@ -1044,7 +1044,7 @@ int fceuWrapperInit( int argc, char *argv[] )
// Resolve absolute path to file
if ( fi.exists() )
{
std::string fullpath = fi.canonicalFilePath().toStdString().c_str();
std::string fullpath = fi.canonicalFilePath().toLocal8Bit().constData();
error = LoadGame( fullpath.c_str() );
@ -1117,9 +1117,9 @@ int fceuWrapperInit( int argc, char *argv[] )
// Resolve absolute path to file
if ( fi.exists() )
{
//printf("FI: '%s'\n", fi.absoluteFilePath().toStdString().c_str() );
//printf("FI: '%s'\n", fi.canonicalFilePath().toStdString().c_str() );
s = fi.canonicalFilePath().toStdString();
//printf("FI: '%s'\n", fi.absoluteFilePath().toLocal8Bit().constData() );
//printf("FI: '%s'\n", fi.canonicalFilePath().toLocal8Bit().constData() );
s = fi.canonicalFilePath().toLocal8Bit().constData();
}
//#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
//

View File

@ -823,11 +823,11 @@ bool iNesHeaderEditor_t::openFile(void)
{
return false;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
if ( GameInfo == NULL )
{
strncpy( LoadedRomFName, filename.toStdString().c_str(), sizeof(LoadedRomFName)-1 );
strncpy( LoadedRomFName, filename.toLocal8Bit().constData(), sizeof(LoadedRomFName)-1 );
LoadedRomFName[sizeof(LoadedRomFName)-1] = 0;
}
@ -877,11 +877,11 @@ void iNesHeaderEditor_t::saveFileAs(void)
{
return;
}
qDebug() << "selected file path : " << filename.toUtf8();
qDebug() << "selected file path : " << filename.toLocal8Bit();
WriteHeaderData( iNesHdr );
if ( SaveINESFile( filename.toStdString().c_str(), iNesHdr ) )
if ( SaveINESFile( filename.toLocal8Bit().constData(), iNesHdr ) )
{
// Error
}
@ -1414,7 +1414,7 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
// Sub mapper
if (ines20)
{
strcpy( buf, mapperSubEdit->text().toStdString().c_str() );
strcpy( buf, mapperSubEdit->text().toLocal8Bit().constData() );
int submapper;
if (sscanf(buf, "%d", &submapper) > 0)
{
@ -1935,7 +1935,7 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
// Miscellanous ROM(s)
if (ines20)
{
strcpy( buf, miscRomsEdit->text().toStdString().c_str() );
strcpy( buf, miscRomsEdit->text().toLocal8Bit().constData() );
int misc_roms = 0;
if (sscanf(buf, "%d", &misc_roms) < 1)
{

View File

@ -239,7 +239,7 @@ int hotkey_t::init(QWidget *parent)
shortcut = new QShortcut(QKeySequence(QString::fromStdString(keyText)), parent);
//printf("ShortCut: '%s' = '%s'\n", configName, shortcut->key().toString().toStdString().c_str() );
//printf("ShortCut: '%s' = '%s'\n", configName, shortcut->key().toString().toLocal8Bit().constData() );
conv2SDL();
return 0;
@ -259,7 +259,7 @@ int hotkey_t::readConfig(void)
{
shortcut->setKey(QString::fromStdString(keyText));
//printf("ShortCut: '%s' = '%s'\n", configName, shortcut->key().toString().toStdString().c_str() );
//printf("ShortCut: '%s' = '%s'\n", configName, shortcut->key().toString().toLocal8Bit().constData() );
if (act)
{
@ -290,7 +290,7 @@ void hotkey_t::conv2SDL(void)
SDL_Keymod m = convQtKey2SDLModifier((Qt::KeyboardModifier)(shortcut->key()[0] & 0xFE000000));
#endif
//printf("Key: '%s' 0x%08x\n", shortcut->key().toString().toStdString().c_str(), shortcut->key()[0] );
//printf("Key: '%s' 0x%08x\n", shortcut->key().toString().toLocal8Bit().constData(), shortcut->key()[0] );
sdl.value = k;
sdl.modifier = m;
@ -328,7 +328,7 @@ int hotkey_t::getString(char *s)
if (shortcut)
{
strcpy(s, shortcut->key().toString().toStdString().c_str());
strcpy(s, shortcut->key().toString().toLocal8Bit().constData());
}
//if ( sdl.modifier != 0 )
//{
@ -671,7 +671,7 @@ static std::string GetFilename(const char *title, int mode, const char *filter)
if (fileList.size() > 0)
{
fname = fileList[0].toStdString();
fname = fileList[0].toLocal8Bit().constData();
}
}
@ -691,7 +691,7 @@ void FCEUD_MovieRecordTo(void)
// return; // no filename selected, quit the whole thing
//}
//std::string s = QInputDialog::getText( consoleWindow, QObject::tr("Movie Recording"),
// QObject::tr("Enter Author Name"), QLineEdit::Normal, QObject::tr(""), &ok ).toStdString();
// QObject::tr("Enter Author Name"), QLineEdit::Normal, QObject::tr(""), &ok ).toLocal8Bit().constData();
//std::wstring author (s.begin (), s.end ());

View File

@ -1892,9 +1892,9 @@ void tilePaletteView_t::exportPaletteFileDialog(void)
{
return;
}
//qDebug() << "selected file path : " << filename.toUtf8();
//qDebug() << "selected file path : " << filename.toLocal8Bit();
exportActivePaletteACT( filename.toStdString().c_str() );
exportActivePaletteACT( filename.toLocal8Bit().constData() );
}
//----------------------------------------------------
void tilePaletteView_t::openColorPicker(void)