2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2012-06-29 07:23:13 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BlackBerry Limited. All rights reserved.
|
2012-06-29 07:23:13 +02:00
|
|
|
** Contact: KDAB (info@kdab.com)
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-06-29 07:23:13 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-06-29 07:23:13 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-06-29 07:23:13 +02:00
|
|
|
|
|
|
|
|
#include "qnxrunconfiguration.h"
|
|
|
|
|
#include "qnxconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <remotelinux/remotelinuxrunconfigurationwidget.h>
|
2013-08-08 14:05:11 +02:00
|
|
|
#include <utils/environment.h>
|
2012-06-29 07:23:13 +02:00
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace RemoteLinux;
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
namespace Qnx {
|
|
|
|
|
namespace Internal {
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
const char QtLibPathKey[] = "Qt4ProjectManager.QnxRunConfiguration.QtLibPath";
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
QnxRunConfiguration::QnxRunConfiguration(Target *parent, Core::Id id, const QString &targetName)
|
|
|
|
|
: RemoteLinuxRunConfiguration(parent, id, targetName)
|
2012-06-29 07:23:13 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
QnxRunConfiguration::QnxRunConfiguration(Target *parent, QnxRunConfiguration *source)
|
|
|
|
|
: RemoteLinuxRunConfiguration(parent, source), m_qtLibPath(source->m_qtLibPath)
|
2012-06-29 07:23:13 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-08 14:05:11 +02:00
|
|
|
Utils::Environment QnxRunConfiguration::environment() const
|
2012-06-29 07:23:13 +02:00
|
|
|
{
|
2013-08-08 14:05:11 +02:00
|
|
|
Utils::Environment env = RemoteLinuxRunConfiguration::environment();
|
|
|
|
|
if (!m_qtLibPath.isEmpty()) {
|
|
|
|
|
env.appendOrSet(QLatin1String("LD_LIBRARY_PATH"),
|
2014-05-02 11:21:42 +02:00
|
|
|
m_qtLibPath + QLatin1String("/lib:$LD_LIBRARY_PATH"));
|
|
|
|
|
env.appendOrSet(QLatin1String("QML_IMPORT_PATH"),
|
|
|
|
|
m_qtLibPath + QLatin1String("/imports:$QML_IMPORT_PATH"));
|
|
|
|
|
env.appendOrSet(QLatin1String("QML2_IMPORT_PATH"),
|
|
|
|
|
m_qtLibPath + QLatin1String("/qml:$QML2_IMPORT_PATH"));
|
|
|
|
|
env.appendOrSet(QLatin1String("QT_PLUGIN_PATH"),
|
|
|
|
|
m_qtLibPath + QLatin1String("/plugins:$QT_PLUGIN_PATH"));
|
2014-05-19 16:00:23 +02:00
|
|
|
env.set(QLatin1String("QT_QPA_FONTDIR"),
|
|
|
|
|
m_qtLibPath + QLatin1String("/lib/fonts"));
|
2013-08-08 14:05:11 +02:00
|
|
|
}
|
2014-05-02 11:21:42 +02:00
|
|
|
|
2013-08-08 14:05:11 +02:00
|
|
|
return env;
|
2012-06-29 07:23:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *QnxRunConfiguration::createConfigurationWidget()
|
|
|
|
|
{
|
2016-01-21 17:38:03 +01:00
|
|
|
auto rcWidget = qobject_cast<RemoteLinuxRunConfigurationWidget *>
|
|
|
|
|
(RemoteLinuxRunConfiguration::createConfigurationWidget());
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
auto label = new QLabel(tr("Path to Qt libraries on device:"));
|
|
|
|
|
auto lineEdit = new QLineEdit(m_qtLibPath);
|
2012-06-29 07:23:13 +02:00
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
connect(lineEdit, &QLineEdit::textChanged,
|
|
|
|
|
this, [this](const QString &path) { m_qtLibPath = path; });
|
2012-06-29 07:23:13 +02:00
|
|
|
|
|
|
|
|
rcWidget->addFormLayoutRow(label, lineEdit);
|
|
|
|
|
|
|
|
|
|
return rcWidget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariantMap QnxRunConfiguration::toMap() const
|
|
|
|
|
{
|
2016-01-21 17:38:03 +01:00
|
|
|
QVariantMap map(RemoteLinuxRunConfiguration::toMap());
|
2012-06-29 07:23:13 +02:00
|
|
|
map.insert(QLatin1String(QtLibPathKey), m_qtLibPath);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QnxRunConfiguration::fromMap(const QVariantMap &map)
|
|
|
|
|
{
|
2016-01-21 17:38:03 +01:00
|
|
|
if (!RemoteLinuxRunConfiguration::fromMap(map))
|
2012-06-29 07:23:13 +02:00
|
|
|
return false;
|
|
|
|
|
|
2016-01-21 17:38:03 +01:00
|
|
|
m_qtLibPath = map.value(QLatin1String(QtLibPathKey)).toString();
|
2012-06-29 07:23:13 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
2016-01-21 17:38:03 +01:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qnx
|