diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp index 8495cc93a..bf14f69b0 100644 --- a/plugins/share/shareplugin.cpp +++ b/plugins/share/shareplugin.cpp @@ -145,6 +145,17 @@ bool SharePlugin::receivePacket(const NetworkPacket& np) } else if (np.has(QStringLiteral("text"))) { QString text = np.get(QStringLiteral("text")); + /* Handle apps which share links as 'Title\nurl' */ + QStringList lines = text.split(QStringLiteral("\n"), Qt::SkipEmptyParts); + if (lines.count() == 2) { + QUrl url (lines[1]); + if (url.isValid() && !url.scheme().isEmpty()) { + QDesktopServices::openUrl(url); + Q_EMIT shareReceived(url.toString()); + return true; + } + } + KService::Ptr service = KApplicationTrader::preferredService(QStringLiteral("text/plain")); const QString defaultApp = service ? service->desktopEntryName() : QString();