Skip to content

Commit

Permalink
Qt GUI: Support opening URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
cjee21 committed Jan 14, 2025
1 parent 8d08ab1 commit a146958
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/GUI/Qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,14 @@ void MainWindow::openFiles(QStringList fileNames) {
//Configuring
if(fileNames.isEmpty())
return;
for(int i=0;i<fileNames.size();i++) {
for (int i = 0; i < fileNames.size(); ++i) {
QUrl url(fileNames[i]);
if (url.isValid())
if (!url.scheme().isEmpty())
if (url.scheme().startsWith("http", Qt::CaseInsensitive) ||
url.scheme().startsWith("ftp", Qt::CaseInsensitive) ||
url.scheme().startsWith("sftp", Qt::CaseInsensitive))
break;
fileNames[i] = QDir::toNativeSeparators(fileNames[i]);
}
C->Menu_File_Open_Files_Begin(settings->value("closeBeforeOpen",true).toBool(), true);
Expand Down

0 comments on commit a146958

Please sign in to comment.