Commit 7aad3c1b authored by Florent Revest's avatar Florent Revest

Adds a nemo-qml-plugin-systemsettings recipe

parent fc8956f1
From 8cd5abea3b6c34c2e5e21c00a1b759c963ebf069 Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Mon, 26 Oct 2015 21:18:35 +0100
Subject: [PATCH] Update QStorageInfo API usage
---
src/aboutsettings.cpp | 10 ++++------
src/aboutsettings.h | 2 --
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/aboutsettings.cpp b/src/aboutsettings.cpp
index ef10c82..d1a2f89 100644
--- a/src/aboutsettings.cpp
+++ b/src/aboutsettings.cpp
@@ -118,11 +118,9 @@ static QMap<QString, QString> parseReleaseFile(const QString &filename)
AboutSettings::AboutSettings(QObject *parent)
: QObject(parent),
- m_sysinfo(new QStorageInfo(this)),
m_netinfo(new QNetworkInfo(this)),
m_devinfo(new QDeviceInfo(this))
{
- qDebug() << "Drives:" << m_sysinfo->allLogicalDrives();
}
AboutSettings::~AboutSettings()
@@ -131,12 +129,12 @@ AboutSettings::~AboutSettings()
qlonglong AboutSettings::totalDiskSpace() const
{
- return m_sysinfo->totalDiskSpace("/");
+ return QStorageInfo("/").bytesTotal();
}
qlonglong AboutSettings::availableDiskSpace() const
{
- return m_sysinfo->availableDiskSpace("/");
+ return QStorageInfo("/").bytesFree();
}
QVariant AboutSettings::diskUsageModel() const
@@ -172,8 +170,8 @@ QVariant AboutSettings::diskUsageModel() const
QVariantMap row;
row["storageType"] = (paths.count() == 1) ? QString("mass") : (path == "/") ? QString("system") : QString("user");
row["path"] = QString(path);
- row["available"] = m_sysinfo->availableDiskSpace(path);
- row["total"] = m_sysinfo->totalDiskSpace(path);
+ row["available"] = QStorageInfo(path).bytesFree();
+ row["total"] = QStorageInfo(path).bytesTotal();
result << QVariant(row);
}
diff --git a/src/aboutsettings.h b/src/aboutsettings.h
index dd3335a..bd3897f 100644
--- a/src/aboutsettings.h
+++ b/src/aboutsettings.h
@@ -35,7 +35,6 @@
#include <QObject>
#include <QVariant>
-class QStorageInfo;
class QNetworkInfo;
class QDeviceInfo;
class AboutSettings: public QObject
@@ -75,7 +74,6 @@ public:
QString adaptationVersion() const;
private:
- QStorageInfo *m_sysinfo;
QNetworkInfo *m_netinfo;
QDeviceInfo *m_devinfo;
};
--
2.6.1
SUMMARY = "QML Plugin for system settings on Nemo"
HOMEPAGE = "https://git.merproject.org/mer-core/nemo-qml-plugin-systemsettings"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://src/displaysettings.cpp;beginline=1;endline=31;md5=99ff23884718e3e2c85992a9294d18df"
SRC_URI = "git://git.merproject.org/mer-core/nemo-qml-plugin-systemsettings.git;protocol=https \
file://0001-Update-QStorageInfo-API-usage.patch"
SRCREV = "8e98f8c8069592d3dd21011743fdfb4d2efcc50a"
PR = "r1"
PV = "+git${SRCREV}"
S = "${WORKDIR}/git"
inherit qmake5
DEPENDS += "qtquickcontrols profiled usb-moded-qt5 mlite mce timed qtsystems"
RDEPENDS_${PN} += "qtquickcontrols-qmlplugins profiled"
FILES_${PN}-dbg += "/usr/lib/qt5/qml/org/nemomobile/systemsettings/.debug /opt/ /usr/share/nemo-qml-plugin-systemsettings-tests /usr/lib/nemo-qml-plugin-systemsettings-tests"
FILES_${PN} += "/usr/lib/qt5/qml/org/nemomobile/systemsettings/"
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