diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp index 19eed45c7980afb7935537b322c40b79a08fc98b..eb13bb893331b7877d6f6beb328e6a6ff0e86ee4 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp @@ -32,6 +32,7 @@ #include "maemoconstants.h" #include "maemodeployables.h" #include "maemodeploystepwidget.h" +#include "maemoglobal.h" #include "maemopackagecreationstep.h" #include "maemorunconfiguration.h" @@ -191,7 +192,7 @@ void MaemoDeployStep::stop() QString MaemoDeployStep::uploadDir() const { - return homeDirOnDevice(m_connection->connectionParameters().uname); + return MaemoGlobal::homeDirOnDevice(m_connection->connectionParameters().uname); } bool MaemoDeployStep::currentlyNeedsDeployment(const QString &host, @@ -350,7 +351,7 @@ void MaemoDeployStep::handleSftpJobFinished(Core::SftpJobId job, .arg(deployInfo.first.localFilePath)); const QString remoteFilePath = deployInfo.first.remoteDir + '/' + QFileInfo(deployInfo.first.localFilePath).fileName(); - QByteArray linkCommand = remoteSudo().toUtf8() + " ln -sf " + QByteArray linkCommand = MaemoGlobal::remoteSudo().toUtf8() + " ln -sf " + deployInfo.second.toUtf8() + ' ' + remoteFilePath.toUtf8(); SshRemoteProcess::Ptr linkProcess = m_connection->createRemoteProcess(linkCommand); @@ -397,8 +398,8 @@ void MaemoDeployStep::handleLinkProcessFinished(int exitStatus) writeOutput(tr("Installing package ...")); const QString packageFileName = QFileInfo(packagingStep()->packageFilePath()).fileName(); - const QByteArray cmd = remoteSudo().toUtf8() + " dpkg -i " - + packageFileName.toUtf8(); + const QByteArray cmd = MaemoGlobal::remoteSudo().toUtf8() + + " dpkg -i " + packageFileName.toUtf8(); m_installer = m_connection->createRemoteProcess(cmd); connect(m_installer.data(), SIGNAL(closed(int)), this, SLOT(handleInstallationFinished(int))); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp index 18496019f6da155dc8cc5d3b7bf828f7cf60aa11..0749e00e1c3087ceb473d1393ed8b5a70281ccad 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp @@ -48,18 +48,6 @@ typedef Core::SshConnectionParameters::AuthType AuthType; namespace Qt4ProjectManager { namespace Internal { -QString homeDirOnDevice(const QString &uname) -{ - return uname == QLatin1String("root") - ? QString::fromLatin1("/root") - : QLatin1String("/home/") + uname; -} - -QString remoteSudo() -{ - return QLatin1String("/usr/lib/mad-developer/devrootsh"); -} - namespace { const QLatin1String SettingsGroup("MaemoDeviceConfigs"); const QLatin1String IdCounterKey("IdCounter"); diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h index 6f8ad3a7b04778e141afaec4a8bdcdd351ec0b50..463911f817d6b557b93f0b6dece979fc8ff55b45 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.h @@ -48,9 +48,6 @@ QT_END_NAMESPACE namespace Qt4ProjectManager { namespace Internal { -QString homeDirOnDevice(const QString &uname); -QString remoteSudo(); - class MaemoDeviceConfig { public: diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a6f7853511d49624cf6156e6083a945b3a02398 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp @@ -0,0 +1,48 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "maemoglobal.h" + +namespace Qt4ProjectManager { +namespace Internal { + +QString MaemoGlobal::homeDirOnDevice(const QString &uname) +{ + return uname == QLatin1String("root") + ? QString::fromLatin1("/root") + : QLatin1String("/home/") + uname; +} + +QString MaemoGlobal::remoteSudo() +{ + return QLatin1String("/usr/lib/mad-developer/devrootsh"); +} + +} // namespace Internal +} // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h new file mode 100644 index 0000000000000000000000000000000000000000..3d23e6eef1884c6ca84ff0db27895551954710e3 --- /dev/null +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h @@ -0,0 +1,52 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef MAEMOGLOBAL_H +#define MAEMOGLOBAL_H + +#include <projectexplorer/buildconfiguration.h> + +QT_BEGIN_NAMESPACE +class QString; +QT_END_NAMESPACE + +namespace Qt4ProjectManager { +namespace Internal { + +class MaemoGlobal +{ +public: + static QString homeDirOnDevice(const QString &uname); + static QString remoteSudo(); +}; + +} // namespace Internal +} // namespace Qt4ProjectManager + +#endif // MAEMOGLOBAL_H diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp index 9a76be87c4b4c325f9d24dbf874a184b76bfe285..1ab2ded58e7b6ce7ea7be61701ea11a1b12bdaff 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp @@ -49,7 +49,7 @@ #include <QtCore/QStringBuilder> namespace Qt4ProjectManager { - namespace Internal { +namespace Internal { using namespace ProjectExplorer; @@ -269,5 +269,5 @@ void MaemoRunConfiguration::updateDeviceConfigurations() emit deviceConfigurationsUpdated(target()); } - } // namespace Internal +} // namespace Internal } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp index 5dee500af98abe3bfb2c70dd6c5c12c552231fd4..f35ceeab51d0e1b4978d6f356c062f5e28e47751 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp @@ -36,6 +36,7 @@ #include "maemodeployables.h" #include "maemodeploystep.h" +#include "maemoglobal.h" #include "maemopackagecreationstep.h" #include "maemorunconfiguration.h" @@ -271,13 +272,13 @@ const QString AbstractMaemoRunControl::executableFileName() const const QString AbstractMaemoRunControl::uploadDir() const { - return homeDirOnDevice(m_devConfig.server.uname); + return MaemoGlobal::homeDirOnDevice(m_devConfig.server.uname); } const QString AbstractMaemoRunControl::targetCmdLinePrefix() const { return QString::fromLocal8Bit("%1 chmod a+x %2 && source /etc/profile && DISPLAY=:0.0 ") - .arg(remoteSudo()).arg(executableFilePathOnTarget()); + .arg(MaemoGlobal::remoteSudo()).arg(executableFilePathOnTarget()); } QString AbstractMaemoRunControl::targetCmdLineSuffix() const diff --git a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri index 5d3c84c130867b3f8109cdf7fbb11dd5ced4409c..2ea996a8c0f6a820de48b3af99953dd67fe9718a 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri +++ b/src/plugins/qt4projectmanager/qt-maemo/qt-maemo.pri @@ -22,7 +22,8 @@ HEADERS += \ $$PWD/maemodeployablelistwidget.h \ $$PWD/maemodeploystep.h \ $$PWD/maemodeploystepwidget.h \ - $$PWD/maemodeploystepfactory.h + $$PWD/maemodeploystepfactory.h \ + $$PWD/maemoglobal.h SOURCES += \ $$PWD/maemoconfigtestdialog.cpp \ @@ -46,7 +47,8 @@ SOURCES += \ $$PWD/maemodeployablelistwidget.cpp \ $$PWD/maemodeploystep.cpp \ $$PWD/maemodeploystepwidget.cpp \ - $$PWD/maemodeploystepfactory.cpp + $$PWD/maemodeploystepfactory.cpp \ + $$PWD/maemoglobal.cpp FORMS += \ $$PWD/maemoconfigtestdialog.ui \ @@ -54,6 +56,6 @@ FORMS += \ $$PWD/maemosshconfigdialog.ui \ $$PWD/maemopackagecreationwidget.ui \ $$PWD/maemodeployablelistwidget.ui \ - qt-maemo/maemodeploystepwidget.ui + $$PWD/maemodeploystepwidget.ui RESOURCES += $$PWD/qt-maemo.qrc