mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 21:14:33 -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user