aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/squish/squishserverprocess.h
blob: 2be419c1e7590a3692339f7a8b2fe40df0cc63f8 (plain)
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
32
33
34
35
36
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "squishprocessbase.h"

#include <QObject>

namespace Squish::Internal {

class SquishServerProcess : public SquishProcessBase
{
    Q_OBJECT
public:
    explicit SquishServerProcess(QObject *parent = nullptr);
    ~SquishServerProcess() = default;

    int port() const { return m_serverPort; }

    void start(const Utils::CommandLine &commandLine,
               const Utils::Environment &environment) override;
    void stop();

signals:
    void portRetrieved();

private:
    void onStandardOutput();
    void onErrorOutput() override;
    void onDone() override;

    int m_serverPort = -1;
};

} // namespace Squish::Internal