Commit abb6dc9c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix compile without deprecated methods

parent 6453a9fe
......@@ -48,8 +48,14 @@ using namespace KQuickAddons;
KCMEnergyInfo::KCMEnergyInfo(QObject *parent, const QVariantList &args) : ConfigModule(parent, args)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
qmlRegisterType<BatteryModel>();
qmlRegisterType<WakeUpModel>();
#else
qmlRegisterAnonymousType<BatteryModel>("org.kde.kinfocenter.energy.private", 1);
qmlRegisterAnonymousType<WakeUpModel>("org.kde.kinfocenter.energy.private", 1);
#endif
qmlRegisterType<StatisticsProvider>("org.kde.kinfocenter.energy.private", 1, 0, "HistoryModel");
qmlRegisterUncreatableType<BatteryModel>("org.kde.kinfocenter.energy.private", 1, 0, "BatteryModel",
QStringLiteral("Use BatteryModel"));
......
This diff is collapsed.
......@@ -216,10 +216,8 @@ void StatisticsView::calculate() {
count++;
}
}
QString number(QLatin1String(""));
number.sprintf("%6d", calcCount);
QString hits(QLatin1String(""));
hits.sprintf("%7d", count);
const QString number = QString::asprintf("%6d", calcCount);
const QString hits = QString::asprintf("%7d", count);
QTreeWidgetItem *item = new QTreeWidgetItem(viewStatistics);
item->setText(0, number);
item->setText(1, eventCb->currentText());
......
......@@ -195,7 +195,7 @@ void NetMon::update() {
QTimer::singleShot(5000,this,&NetMon::killShowmount);
////qDebug()<<"starting kill timer with 5 seconds";
connect(showmountProc, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), this, &NetMon::killShowmount);
connect(showmountProc, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), this, &NetMon::killShowmount);
connect(showmountProc, &QProcess::errorOccurred, this, &NetMon::killShowmount);
showmountProc->start(QStringLiteral("showmount"), QStringList() << QStringLiteral("-a") << QStringLiteral("localhost"));
version->adjustSize();
......
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