aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxpackageinstaller.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2011-07-19 17:30:37 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2011-07-19 17:35:56 +0200
commit1656335edba1af91aed7da9697b0a775f65aabee (patch)
treeefe3bf2aa3b4a422887127d39d04e15f5e6f6103 /src/plugins/remotelinux/remotelinuxpackageinstaller.h
parent410d5bd0cf3ab20bf1bdc4a90635effcb3921d48 (diff)
RemoteLinux: Remove Maemo dependency from generic package installation.
Change-Id: I3c62fe77656fed22b4de287430b0b13190e274a9 Reviewed-on: http://codereview.qt.nokia.com/1839 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxpackageinstaller.h')
-rw-r--r--src/plugins/remotelinux/remotelinuxpackageinstaller.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/plugins/remotelinux/remotelinuxpackageinstaller.h b/src/plugins/remotelinux/remotelinuxpackageinstaller.h
new file mode 100644
index 00000000000..8f8e33aadf0
--- /dev/null
+++ b/src/plugins/remotelinux/remotelinuxpackageinstaller.h
@@ -0,0 +1,103 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (info@qt.nokia.com)
+**
+**
+** GNU Lesser General Public License Usage
+**
+** 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.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** Other Usage
+**
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at info@qt.nokia.com.
+**
+**************************************************************************/
+#ifndef REMOTELINUXPACKAGEINSTALLER_H
+#define REMOTELINUXPACKAGEINSTALLER_H
+
+#include "remotelinux_export.h"
+
+#include <QtCore/QObject>
+
+#include <QtCore/QSharedPointer>
+#include <QtCore/QString>
+
+namespace Utils {
+class SshConnection;
+}
+
+namespace RemoteLinux {
+namespace Internal {
+class AbstractRemoteLinuxPackageInstallerPrivate;
+} // namespace Internal
+
+class REMOTELINUX_EXPORT AbstractRemoteLinuxPackageInstaller : public QObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(AbstractRemoteLinuxPackageInstaller)
+public:
+ ~AbstractRemoteLinuxPackageInstaller();
+
+ void installPackage(const QSharedPointer<Utils::SshConnection> &connection,
+ const QString &packageFilePath, bool removePackageFile);
+ void cancelInstallation();
+
+signals:
+ void stdoutData(const QString &output);
+ void stderrData(const QString &output);
+ void finished(const QString &errorMsg = QString());
+
+protected:
+ explicit AbstractRemoteLinuxPackageInstaller(QObject *parent = 0);
+
+private slots:
+ void handleConnectionError();
+ void handleInstallationFinished(int exitStatus);
+ void handleInstallerOutput(const QByteArray &output);
+ void handleInstallerErrorOutput(const QByteArray &output);
+
+private:
+ virtual QString installCommandLine(const QString &packageFilePath) const=0;
+ virtual QString cancelInstallationCommandLine() const=0;
+
+ virtual void prepareInstallation() {}
+ virtual QString errorString() const { return QString(); }
+
+ void setFinished();
+
+ Internal::AbstractRemoteLinuxPackageInstallerPrivate * const m_d;
+};
+
+
+class REMOTELINUX_EXPORT RemoteLinuxTarPackageInstaller : public AbstractRemoteLinuxPackageInstaller
+{
+ Q_OBJECT
+public:
+ RemoteLinuxTarPackageInstaller(QObject *parent = 0);
+
+private:
+ QString installCommandLine(const QString &packageFilePath) const;
+ QString cancelInstallationCommandLine() const;
+};
+
+
+} // namespace RemoteLinux
+
+#endif // REMOTELINUXPACKAGEINSTALLER_H