kdeconnect-handler: auto select the sendFile radio button if url is actually a local file
This commit is contained in:
parent
e683dd218a
commit
ea8ed5c427
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue