~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-zesty-2066

« back to all changes in this revision

Viewing changes to plugins/about/storageabout.cpp

  • Committer: Bileto Bot
  • Author(s): Jonas G. Drange
  • Date: 2016-09-30 13:48:06 UTC
  • mfrom: (1720.3.7 path-fixes)
  • Revision ID: ci-train-bot@canonical.com-20160930134806-tir714ireb8xzaau
uses XDG_DATA_DIRS where applicable to enable USS to find files and folders on snappy-based systems (LP: #1629009)

Approved by: Alberto Mardegan, Ken VanDine, Lukáš Tinkl, system-apps-ci-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <QJsonArray>
38
38
#include <QJsonDocument>
39
39
#include <QJsonObject>
 
40
#include <QStandardPaths>
40
41
#include <QtCore/QStorageInfo>
41
42
#include <QtCore/QSharedPointer>
 
43
#include <QtGlobal>
42
44
#include <QProcess>
43
45
#include <QVariant>
44
46
#include <hybris/properties/properties.h>
195
197
{
196
198
    if (m_ubuntuBuildID.isEmpty() || m_ubuntuBuildID.isNull())
197
199
    {
198
 
        QFile file("/etc/media-info");
 
200
        QFile file(qgetenv("SNAP").append("/etc/media-info"));
199
201
        if (!file.exists())
200
202
            return "";
201
203
        file.open(QIODevice::ReadOnly | QIODevice::Text);
235
237
QString StorageAbout::licenseInfo(const QString &subdir) const
236
238
{
237
239
 
238
 
    QString copyright = "/usr/share/doc/" + subdir + "/copyright";
 
240
    QString copyright = "doc/" + subdir + "/copyright";
239
241
    QString copyrightText;
240
242
 
241
 
    QFile file(copyright);
 
243
    QString copyrightFile = QStandardPaths::locate(
 
244
        QStandardPaths::GenericDataLocation, copyright,
 
245
        QStandardPaths::LocateFile
 
246
    );
 
247
    if (copyrightFile.isEmpty()) {
 
248
        return QString();
 
249
    }
 
250
 
 
251
    QFile file(copyrightFile);
242
252
    if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
243
253
        return QString();
244
254
    copyrightText = QString(file.readAll());