| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef SSHAGENT_H |
| 22 |
#define SSHAGENT_H |
| 23 |
|
| 24 |
#include <qobject.h> |
| 25 |
#include <qstring.h> |
| 26 |
#include <qstringlist.h> |
| 27 |
|
| 28 |
class KProcess; |
| 29 |
|
| 30 |
class SshAgent : public QObject |
| 31 |
{ |
| 32 |
Q_OBJECT |
| 33 |
|
| 34 |
public: |
| 35 |
explicit SshAgent(QObject *parent = nullptr); |
| 36 |
~SshAgent() override; |
| 37 |
|
| 38 |
bool querySshAgent(); |
| 39 |
bool addSshIdentities(); |
| 40 |
void killSshAgent(); |
| 41 |
|
| 42 |
bool isRunning() const |
| 43 |
{ |
| 44 |
return m_isRunning; |
| 45 |
} |
| 46 |
QString pid() const |
| 47 |
{ |
| 48 |
return m_pid; |
| 49 |
} |
| 50 |
QString authSock() const |
| 51 |
{ |
| 52 |
return m_authSock; |
| 53 |
} |
| 54 |
|
| 55 |
private Q_SLOTS: |
| 56 |
void slotProcessFinished(); |
| 57 |
void slotReceivedOutput(); |
| 58 |
|
| 59 |
private: |
| 60 |
bool startSshAgent(); |
| 61 |
|
| 62 |
QStringList m_outputLines; |
| 63 |
|
| 64 |
KProcess *m_agentProcess; |
| 65 |
|
| 66 |
static bool m_isRunning; |
| 67 |
static bool m_isOurAgent; |
| 68 |
static QString m_authSock; |
| 69 |
static QString m_pid; |
| 70 |
}; |
| 71 |
|
| 72 |
#endif |