1
/**************************************************************************
3
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
5
** Contact: BlackBerry (qt@blackberry.com)
6
** Contact: KDAB (info@kdab.com)
8
** This file is part of Qt Creator.
10
** Commercial License Usage
11
** Licensees holding valid commercial Qt licenses may use this file in
12
** accordance with the commercial license agreement provided with the
13
** Software or, alternatively, in accordance with the terms contained in
14
** a written agreement between you and Digia. For licensing terms and
15
** conditions see http://qt.digia.com/licensing. For further information
16
** use the contact form at http://qt.digia.com/contact-us.
18
** GNU Lesser General Public License Usage
19
** Alternatively, this file may be used under the terms of the GNU Lesser
20
** General Public License version 2.1 as published by the Free Software
21
** Foundation and appearing in the file LICENSE.LGPL included in the
22
** packaging of this file. Please review the following information to
23
** ensure the GNU Lesser General Public License version 2.1 requirements
24
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26
** In addition, as a special exception, Digia gives you certain additional
27
** rights. These rights are described in the Digia Qt LGPL Exception
28
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30
****************************************************************************/
32
#include "blackberryruntimeconfiguration.h"
34
#include "qnxconstants.h"
36
#include <QVariantMap>
38
#include <QCoreApplication>
43
const QLatin1String PathKey("Path");
44
const QLatin1String DisplayNameKey("DisplayName");
45
const QLatin1String VersionKey("Version");
47
BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(
49
const BlackBerryVersionNumber &version)
52
if (!version.isEmpty())
55
m_version = BlackBerryVersionNumber::fromFileName(QFileInfo(path).baseName(),
56
QRegExp(QLatin1String("^runtime_(.*)$")));
58
m_displayName = QCoreApplication::translate("Qnx::Internal::BlackBerryRuntimeConfiguration", "Runtime %1").arg(m_version.toString());
61
BlackBerryRuntimeConfiguration::BlackBerryRuntimeConfiguration(const QVariantMap &data)
63
m_path = data.value(QLatin1String(PathKey)).toString();
64
m_displayName = data.value(QLatin1String(DisplayNameKey)).toString();
65
m_version = BlackBerryVersionNumber(data.value(QLatin1String(VersionKey)).toString());
68
QString BlackBerryRuntimeConfiguration::path() const
73
QString BlackBerryRuntimeConfiguration::displayName() const
78
BlackBerryVersionNumber BlackBerryRuntimeConfiguration::version() const
83
QVariantMap BlackBerryRuntimeConfiguration::toMap() const
86
data.insert(QLatin1String(Qnx::Constants::QNX_BB_KEY_CONFIGURATION_TYPE),
87
QLatin1String(Qnx::Constants::QNX_BB_RUNTIME_TYPE));
88
data.insert(QLatin1String(PathKey), m_path);
89
data.insert(QLatin1String(DisplayNameKey), m_displayName);
90
data.insert(QLatin1String(VersionKey), m_version.toString());