mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 11:04:25 -04:00
Do not generate the qr code if the server is off
This commit is contained in:
@ -162,6 +162,15 @@ void YACReaderHttpServer::stop()
|
||||
}
|
||||
}
|
||||
|
||||
bool YACReaderHttpServer::isRunning()
|
||||
{
|
||||
if (listener == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return listener->isListening();
|
||||
}
|
||||
|
||||
YACReaderHttpServer::YACReaderHttpServer()
|
||||
: QObject(nullptr), listener(nullptr)
|
||||
{
|
||||
@ -169,5 +178,9 @@ YACReaderHttpServer::YACReaderHttpServer()
|
||||
|
||||
QString YACReaderHttpServer::getPort()
|
||||
{
|
||||
if (listener == nullptr) {
|
||||
return "-1";
|
||||
}
|
||||
|
||||
return QString("%1").arg(listener->serverPort());
|
||||
}
|
||||
|
@ -17,6 +17,8 @@ public:
|
||||
void start(quint16 port = 0);
|
||||
void stop();
|
||||
|
||||
bool isRunning();
|
||||
|
||||
QString getPort();
|
||||
|
||||
signals:
|
||||
|
Reference in New Issue
Block a user