~pieq/checkbox/add-30suspend-1reboot-cycles-support

« back to all changes in this revision

Viewing changes to checkbox-gui/gui-engine/PBJsonUtils.cpp

  • Committer: Zygmunt Krynicki
  • Date: 2015-09-17 13:32:37 UTC
  • mto: This revision was merged to the branch mainline in revision 4014.
  • Revision ID: zygmunt.krynicki@canonical.com-20150917133237-7d4mdzlgpin1na9g
checkbox-gui: remove checkbox gui entirely

This patch removes all of checkbox-gui. This was long in the making but
it's now done. We cannot maintain this codebase effectively. Keeping it
around slows us down as we are unable to make feature-parity changes
here with the same simplicity that we can make them elsewhere, most
notably in checkbox-converged.

The code has served us well but it is the time to let go and make
checkbox-converged the only application that we use across all of Ubuntu
releases and across different environments (phone, table and desktop).

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of Checkbox
3
 
 *
4
 
 * Copyright 2013 Canonical Ltd.
5
 
 *
6
 
 * Authors:
7
 
 * - Andrew Haigh <andrew.haigh@cellsoftware.co.uk>
8
 
 *
9
 
 * This program is free software; you can redistribute it and/or modify
10
 
 * it under the terms of the GNU General Public License as published by
11
 
 * the Free Software Foundation; version 3.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
 */
21
 
 
22
 
#include "PBJsonUtils.h"
23
 
 
24
 
// Key should be a meaningful name, ideally the member name
25
 
const QJsonObject PBJsonUtils::QDBusObjectPathArrayToJson(\
26
 
        const QString& key, \
27
 
        const QList<QDBusObjectPath> opath_list)
28
 
{
29
 
    QJsonObject object;
30
 
    QJsonArray jsonarray;
31
 
    if ( opath_list.count() ) {
32
 
        for (int i=0; i < opath_list.count();i++) {
33
 
            QString path = opath_list.at(i).path();
34
 
            jsonarray.append(path);
35
 
        }
36
 
    }
37
 
    QJsonValue value(jsonarray);
38
 
    object.insert(key,value);
39
 
    return object;
40
 
}
41
 
 
42
 
// Key should be a meaningful name, ideally the member name
43
 
const QList<QDBusObjectPath> PBJsonUtils::JSONToQDBusObjectPathArray(\
44
 
        const QString& key, \
45
 
        const QJsonObject& object)
46
 
{
47
 
    QJsonArray jsonarray;
48
 
    QJsonValue value;
49
 
    value = object.find(key).value();
50
 
    jsonarray = value.toArray();
51
 
    QList<QDBusObjectPath> opath_list;
52
 
    for(int i=0; i<jsonarray.count(); i++) {
53
 
        QString path = jsonarray.at(i).toString();
54
 
        QDBusObjectPath opath(path);
55
 
        opath_list.append(opath);
56
 
    }
57
 
    return opath_list;
58
 
}