diff --git a/urlhandler/kdeconnect-handler.cpp b/urlhandler/kdeconnect-handler.cpp index 1d687152d..c716695c6 100644 --- a/urlhandler/kdeconnect-handler.cpp +++ b/urlhandler/kdeconnect-handler.cpp @@ -111,6 +111,13 @@ int main(int argc, char** argv) } }); + QObject::connect(urlRequester, &KUrlRequester::textChanged, [urlRequester, &uidialog](const QString& newUrl) + { + bool isLocalFileUrl = QFileInfo(newUrl).exists() && QFileInfo(newUrl).isFile(); // we don't support sending directories yet! + uidialog.sendFileRadioButton->setChecked(isLocalFileUrl); + uidialog.sendUrlRadioButton->setChecked(!isLocalFileUrl); + }); + if (!urlToShare.isEmpty()) { uidialog.sendUrlRadioButton->setVisible(false); uidialog.sendFileRadioButton->setVisible(false);