genericdirectuploadservice.h 2.61 KB
Newer Older
Tobias Hunger's avatar
Tobias Hunger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**************************************************************************
**
** 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.
**
**************************************************************************/
32
33
#ifndef DIRECTDEVICEUPLOADACTION_H
#define DIRECTDEVICEUPLOADACTION_H
Tobias Hunger's avatar
Tobias Hunger committed
34

35
36
#include "abstractremotelinuxdeployservice.h"
#include "remotelinux_export.h"
37
38
39
40
41

#include <utils/ssh/sftpdefs.h>

#include <QtCore/QList>

42
QT_FORWARD_DECLARE_CLASS(QString)
43

44
namespace RemoteLinux {
45
class DeployableFile;
46
namespace Internal { class GenericDirectUploadServicePrivate; }
47

48
class REMOTELINUX_EXPORT GenericDirectUploadService : public AbstractRemoteLinuxDeployService
49
50
51
{
    Q_OBJECT
public:
52
    GenericDirectUploadService(QObject *parent);
53

54
    void setDeployableFiles(const QList<DeployableFile> &deployableFiles);
55
56
57
58
59
60

private slots:
    void handleSftpInitialized();
    void handleSftpInitializationFailed(const QString &errorMessage);
    void handleUploadFinished(Utils::SftpJobId jobId, const QString &errorMsg);
    void handleMkdirFinished(int exitStatus);
61
62
63
    void handleLnFinished(int exitStatus);
    void handleStdOutData(const QByteArray &data);
    void handleStdErrData(const QByteArray &data);
64
65

private:
66
67
68
69
    bool isDeploymentNecessary() const;

    void doDeviceSetup();
    void stopDeviceSetup();
70

71
72
    void doDeploy();
    void stopDeployment();
73

74
    void checkDeploymentNeeded(const DeployableFile &file) const;
75
76
77
    void setFinished();
    void uploadNextFile();

78
    Internal::GenericDirectUploadServicePrivate * const m_d;
79
80
};

81
} //namespace RemoteLinux
82

83
#endif // DIRECTDEVICEUPLOADACTION_H