Commit 6dffb2a4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated method

parent aee3336c
......@@ -89,7 +89,7 @@ MobileProviders::~MobileProviders()
QStringList MobileProviders::getCountryList() const
{
QStringList temp = mCountries.values();
qSort(temp.begin(), temp.end(), localeAwareCompare);
std::sort(temp.begin(), temp.end(), localeAwareCompare);
return temp;
}
......
......@@ -69,7 +69,7 @@ IPv6Widget::IPv6Widget(const NetworkManager::Setting::Ptr &setting, QWidget* par
m_ui->setupUi(this);
m_ui->tableViewAddresses->setModel(&d->model);
m_ui->tableViewAddresses->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
m_ui->tableViewAddresses->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
m_ui->tableViewAddresses->horizontalHeader()->setStretchLastSection(true);
IpV6Delegate *ipDelegate = new IpV6Delegate(this);
......
......@@ -233,7 +233,7 @@ void TeamWidget::populateTeams()
void TeamWidget::importConfig()
{
const QString filename = QFileDialog::getOpenFileName(this, i18n("Select file to import"), QDesktopServices::storageLocation(QDesktopServices::HomeLocation),
const QString filename = QFileDialog::getOpenFileName(this, i18n("Select file to import"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation),
"text/plain");
if (!filename.isEmpty()) {
//qCDebug(PLASMA_NM) << "Importing" << filename;
......
......@@ -114,7 +114,7 @@ void BssidComboBox::init(const QString & bssid, const QString &ssid)
}
}
qSort(aps.begin(), aps.end(), signalCompare);
std::sort(aps.begin(), aps.end(), signalCompare);
addBssidsToCombo(aps);
const int index = findData(m_initialBssid);
......
......@@ -53,7 +53,7 @@ IpV4RoutesWidget::IpV4RoutesWidget(QWidget * parent)
{
d->ui.setupUi(this);
d->ui.tableViewAddresses->setModel(&d->model);
d->ui.tableViewAddresses->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
d->ui.tableViewAddresses->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
IpV4Delegate *ipDelegate = new IpV4Delegate(this);
IntDelegate *metricDelegate = new IntDelegate(this);
......
......@@ -54,7 +54,7 @@ IpV6RoutesWidget::IpV6RoutesWidget(QWidget * parent)
{
d->ui.setupUi(this);
d->ui.tableViewAddresses->setModel(&d->model);
d->ui.tableViewAddresses->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
d->ui.tableViewAddresses->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
IpV6Delegate *ipDelegate = new IpV6Delegate(this);
IntDelegate *netmaskDelegate = new IntDelegate(0,128,this);
......
......@@ -95,7 +95,7 @@ void SsidComboBox::init(const QString &ssid)
}
}
qSort(networks.begin(), networks.end(), signalCompare);
std::sort(networks.begin(), networks.end(), signalCompare);
addSsidsToCombo(networks);
int index = findData(m_initialSsid);
......
......@@ -231,7 +231,7 @@ void OpenconnectAuthWidget::readSecrets()
d->secrets = d->setting->secrets();
if (!d->secrets["xmlconfig"].isEmpty()) {
const QByteArray config = QByteArray::fromBase64(d->secrets["xmlconfig"].toAscii());
const QByteArray config = QByteArray::fromBase64(d->secrets["xmlconfig"].toLatin1());
QCryptographicHash hash(QCryptographicHash::Sha1);
hash.addData(config.data(), config.size());
......@@ -350,12 +350,12 @@ void OpenconnectAuthWidget::connectHost()
}
i = d->ui.cmbHosts->itemData(i).toInt();
const VPNHost &host = d->hosts.at(i);
if (openconnect_parse_url(d->vpninfo, host.address.toAscii().data())) {
if (openconnect_parse_url(d->vpninfo, host.address.toLatin1().data())) {
qCWarning(PLASMA_NM) << "Failed to parse server URL" << host.address;
openconnect_set_hostname(d->vpninfo, OC3DUP(host.address.toAscii().data()));
openconnect_set_hostname(d->vpninfo, OC3DUP(host.address.toLatin1().data()));
}
if (!openconnect_get_urlpath(d->vpninfo) && !host.group.isEmpty()) {
openconnect_set_urlpath(d->vpninfo, OC3DUP(host.group.toAscii().data()));
openconnect_set_urlpath(d->vpninfo, OC3DUP(host.group.toLatin1().data()));
}
d->secrets["lasthost"] = host.name;
addFormInfo(QLatin1String("dialog-information"), i18n("Contacting host, please wait..."));
......@@ -713,7 +713,7 @@ void OpenconnectAuthWidget::formLoginClicked()
}
} else if (opt->type == OC_FORM_OPT_SELECT) {
QComboBox *cbo = qobject_cast<QComboBox*>(widget);
QByteArray text = cbo->itemData(cbo->currentIndex()).toString().toAscii();
QByteArray text = cbo->itemData(cbo->currentIndex()).toString().toLatin1();
openconnect_set_option_value(opt, text.data());
d->secrets.insert(key,cbo->itemData(cbo->currentIndex()).toString());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment