forked from qt-creator/qt-creator
Clang: Decouple ConnectionClient and ClangCodeModel*
We want to reuse the connection client in other plugins. This is the first step, the next step is refactoring the IPC mechanismn and move it up to the IpcServer- and IpcClientInterface. Change-Id: I6eb6db1e9bc18232c8df350a6303afd2edc68da8 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -49,7 +49,7 @@ class CMBIPC_EXPORT ConnectionClient : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConnectionClient(ClangCodeModelClientInterface *client);
|
||||
ConnectionClient();
|
||||
~ConnectionClient();
|
||||
|
||||
void startProcessAndConnectToServerAsynchronously();
|
||||
@@ -72,14 +72,18 @@ public:
|
||||
bool waitForEcho();
|
||||
bool waitForConnected();
|
||||
|
||||
ClangCodeModelServerProxy &serverProxy();
|
||||
|
||||
QProcess *processForTestOnly() const;
|
||||
|
||||
signals:
|
||||
void connectedToLocalSocket();
|
||||
void processFinished();
|
||||
|
||||
protected:
|
||||
QIODevice *ioDevice();
|
||||
|
||||
virtual void sendEndCommand() = 0;
|
||||
virtual void resetCounter() = 0;
|
||||
|
||||
private:
|
||||
std::unique_ptr<QProcess> startProcess();
|
||||
void finishProcess(std::unique_ptr<QProcess> &&process);
|
||||
@@ -107,14 +111,13 @@ private:
|
||||
private:
|
||||
mutable std::unique_ptr<QProcess> process_;
|
||||
QLocalSocket localSocket;
|
||||
ClangCodeModelServerProxy serverProxy_;
|
||||
QTimer processAliveTimer;
|
||||
QString processPath_;
|
||||
bool isAliveTimerResetted = false;
|
||||
bool processIsStarting = false;
|
||||
|
||||
LinePrefixer stdErrPrefixer;
|
||||
LinePrefixer stdOutPrefixer;
|
||||
LinePrefixer stdErrPrefixer = QByteArrayLiteral("clangbackend.stderr: ");
|
||||
LinePrefixer stdOutPrefixer = QByteArrayLiteral("clangbackend.stdout: ");
|
||||
};
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
|
||||
Reference in New Issue
Block a user