Skip to content

Commit

Permalink
Merge pull request #3101 from torusrxxx/patch000000dd
Browse files Browse the repository at this point in the history
fix File open failed! Please open the file yourself...
  • Loading branch information
mrexodia committed May 23, 2023
2 parents 5eb556e + a8096b2 commit fdc6df5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gui/Src/Gui/ScriptView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ void ScriptView::unload()
void ScriptView::edit()
{
if(!filename.isEmpty())
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(filename))))
if(!QDesktopServices::openUrl(QUrl("file:///" + QDir::fromNativeSeparators(filename))))
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/Src/Gui/SystemBreakpointScriptDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void SystemBreakpointScriptDialog::on_openDebuggee_clicked()
// First open the script if that is available
if(!ui->lineEditDebuggee->text().isEmpty())
{
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
if(!QDesktopServices::openUrl(QUrl("file:///" + QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
{
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}
Expand All @@ -134,7 +134,7 @@ void SystemBreakpointScriptDialog::on_openDebuggee_clicked()
ui->lineEditDebuggee->setText(defaultFileName);
ui->openDebuggee->setText(tr("Open"));
// Open the file
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
if(!QDesktopServices::openUrl(QUrl("file:///" + QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
{
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}
Expand Down

0 comments on commit fdc6df5

Please sign in to comment.