~ci-train-bot/ubuntu-system-settings/ubuntu-system-settings-ubuntu-yakkety-landing-041

« back to all changes in this revision

Viewing changes to src/main.cpp

  • Committer: Alberto Mardegan
  • Date: 2013-05-03 19:32:01 UTC
  • Revision ID: alberto.mardegan@canonical.com-20130503193201-tgk28uue1j6u8s0c
Add a few files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of system-settings
 
3
 *
 
4
 * Copyright (C) 2013 Canonical Ltd.
 
5
 *
 
6
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
 
7
 *
 
8
 * This program is free software: you can redistribute it and/or modify it
 
9
 * under the terms of the GNU General Public License version 3, as published
 
10
 * by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
14
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
15
 * PURPOSE.  See the GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#include "debug.h"
 
22
#include "i18n.h"
 
23
 
 
24
#include <QGuiApplication>
 
25
#include <QProcessEnvironment>
 
26
 
 
27
using namespace SystemSettings;
 
28
 
 
29
int main(int argc, char **argv)
 
30
{
 
31
    QGuiApplication app(argc, argv);
 
32
 
 
33
    /* read environment variables */
 
34
    QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
 
35
    if (environment.contains(QLatin1String("SS_LOGGING_LEVEL"))) {
 
36
        bool isOk;
 
37
        int value = environment.value(
 
38
            QLatin1String("SS_LOGGING_LEVEL")).toInt(&isOk);
 
39
        if (isOk)
 
40
            setLoggingLevel(value);
 
41
    }
 
42
 
 
43
    initTr(I18N_DOMAIN, NULL);
 
44
 
 
45
    return app.exec();
 
46
}