@@ -562,7 +562,7 @@ void MainWindow::openFile()
562
562
{
563
563
filename = fileToOpen->text ();
564
564
}
565
- DbgCmdExec (QString (" init \" " + filename + " \" " ).toUtf8 ().constData ());
565
+ DbgCmdExec (QString (). sprintf ( " init \" %s \" " , filename. toUtf8 (). constData () ).toUtf8 ().constData ());
566
566
567
567
// file is from recent menu
568
568
if (fileToOpen != NULL && fileToOpen->objectName ().startsWith (" MRU" ))
@@ -612,16 +612,9 @@ void MainWindow::startScylla() //this is executed
612
612
613
613
void MainWindow::restartDebugging ()
614
614
{
615
- char filename[MAX_SETTING_SIZE] = " " ;
616
615
if (!mMRUList .size ())
617
616
return ;
618
- strcpy_s (filename, mMRUList .at (0 ).toUtf8 ().constData ());
619
- if (DbgIsDebugging ())
620
- {
621
- DbgCmdExec (" stop" ); // close current file (when present)
622
- Sleep (400 );
623
- }
624
- DbgCmdExec (QString ().sprintf (" init \" %s\" " , filename).toUtf8 ().constData ());
617
+ DbgCmdExec (QString ().sprintf (" init \" %s\" " , mMRUList .at (0 ).toUtf8 ().constData ()).toUtf8 ().constData ());
625
618
626
619
mCpuWidget ->setDisasmFocus ();
627
620
}
@@ -644,10 +637,7 @@ void MainWindow::dropEvent(QDropEvent* pEvent)
644
637
if (pEvent->mimeData ()->hasUrls ())
645
638
{
646
639
QString filename = QDir::toNativeSeparators (pEvent->mimeData ()->urls ()[0 ].toLocalFile ());
647
- if (DbgIsDebugging ())
648
- DbgCmdExecDirect (" stop" );
649
- QString cmd;
650
- DbgCmdExec (cmd.sprintf (" init \" %s\" " , filename.toUtf8 ().constData ()).toUtf8 ().constData ());
640
+ DbgCmdExec (QString ().sprintf (" init \" %s\" " , filename.toUtf8 ().constData ()).toUtf8 ().constData ());
651
641
pEvent->acceptProposedAction ();
652
642
}
653
643
}
0 commit comments