[URL Handler] Special-case label for phone URLs

It's a lot nicer than "sending a URL"

Differential Revision: https://phabricator.kde.org/D10069
This commit is contained in:
Kai Uwe Broulik 2018-01-25 10:25:57 +01:00
parent 6ff4dd914e
commit 686e3f98a9

View file

@ -89,7 +89,14 @@ int main(int argc, char** argv)
Ui::Dialog uidialog; Ui::Dialog uidialog;
uidialog.setupUi(&dialog); uidialog.setupUi(&dialog);
uidialog.devicePicker->setModel(&proxyModel); uidialog.devicePicker->setModel(&proxyModel);
uidialog.urlLabel->setText(urlToShare.toDisplayString());
if (urlToShare.scheme() == QLatin1String("tel")) {
uidialog.label->setText(i18n("Device to call this phone number with:"));
uidialog.urlLabel->setText(urlToShare.toDisplayString(QUrl::RemoveScheme));
} else {
uidialog.urlLabel->setText(urlToShare.toDisplayString());
}
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
QUrl url = urlToShare; QUrl url = urlToShare;
const int currentDeviceIndex = uidialog.devicePicker->currentIndex(); const int currentDeviceIndex = uidialog.devicePicker->currentIndex();