Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/dbus/applicationservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,19 @@ LaunchTask ApplicationService::processExec(const QString &str, const QStringList
QList<QUrl> resources;
resources.reserve(fields.size());
for (const auto &field : fields) {
resources.emplace_back(QUrl::fromUserInput(field, dir, QUrl::AssumeLocalFile));
// Fix: preserve custom URI schemes (e.g. ksowpscloudsvr://)
// QUrl::fromUserInput() treats unknown schemes as HTTP hostnames,
// rewriting "ksowpscloudsvr://x" -> "http://ksowpscloudsvr//x".

@ComixHe ComixHe Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ksowpscloudsvr://start=foo isn’t a valid URL. QUrl will generate an empty string when using the ‘toString’ method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we need some kind of heuristic algorithm?

// If the field already contains "://", parse it with TolerantMode
// (which accepts non-RFC-compliant host parts like "start=foo")
// and skip fromUserInput entirely.
QUrl url;
if (field.contains(u"://"_s)) {
url = QUrl(field, QUrl::TolerantMode);
} else {
url = QUrl::fromUserInput(field, dir, QUrl::AssumeLocalFile);
}
resources.emplace_back(std::move(url));
}

if (code.isUpper()) {
Expand Down
Loading