Skip to content

Commit

Permalink
Handle file list to open or drag'n drop
Browse files Browse the repository at this point in the history
  • Loading branch information
afichet committed May 30, 2023
1 parent d4c7ba2 commit 88d1d3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ int main(int argc, char* argv[])
// Read from stdin
w.open(std::cin);
} else {
w.open(argv[1]);
for (int i = 1; i < argc; i++) {
w.open(argv[i]);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/view/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ void MainWindow::dropEvent(QDropEvent* ev)
{
QList<QUrl> urls = ev->mimeData()->urls();

if (!urls.empty()) {
QString filename = urls[0].toString();
QString startFileTypeString =
for (const QUrl& url: urls) {
QString filename = url.toString();
const QString startFileTypeString =
#ifdef _WIN32
"file:///";
#else
Expand Down

0 comments on commit 88d1d3b

Please sign in to comment.