refactor: Address (Windows) compile warnings (#840)

* Windows compile errors and (Qt 5.15 deprecation) warnings

* Usability - Enable/Disable Instance button

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
LordGrey
2020-06-28 23:05:32 +02:00
committed by GitHub
parent e365a2839d
commit bfb50b8d91
61 changed files with 530 additions and 365 deletions

View File

@@ -77,7 +77,12 @@ unsigned int getProcessIdsByProcessName(const char *processName, QStringList &li
if (bytes.isEmpty())
return 0;
listOfPids = QString(bytes).split("\n", QString::SkipEmptyParts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
listOfPids = QString(bytes).split("\n", Qt::SkipEmptyParts);
#else
listOfPids = QString(bytes).split("\n", QString::SkipEmptyParts);
#endif
return listOfPids.count();
#endif

View File

@@ -76,7 +76,7 @@ HyperionDaemon::HyperionDaemon(const QString rootPath, QObject *parent, const bo
, _osxGrabber(nullptr)
, _qtGrabber(nullptr)
, _ssdp(nullptr)
, _currVideoMode(VIDEO_2D)
, _currVideoMode(VideoMode::VIDEO_2D)
{
HyperionDaemon::daemon = this;
@@ -278,7 +278,7 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type &settingsType, co
if (level == "silent")
Logger::setLogLevel(Logger::OFF);
else if (level == "warn")
Logger::setLogLevel(Logger::WARNING);
Logger::setLogLevel(Logger::LogLevel::WARNING);
else if (level == "verbose")
Logger::setLogLevel(Logger::INFO);
else if (level == "debug")
@@ -325,15 +325,19 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type &settingsType, co
Error(_log, "grabber device '%s' for type amlogic not found!", QSTRING_CSTR(_grabber_device));
}
}
// x11 -> if DISPLAY is set
else if (getenv("DISPLAY") != NULL)
{
type = "x11";
}
// qt -> if nothing other applies
else
{
type = "qt";
// x11 -> if DISPLAY is set
QByteArray envDisplay = qgetenv("DISPLAY");
if ( !envDisplay.isEmpty() )
{
type = "x11";
}
// qt -> if nothing other applies
else
{
type = "qt";
}
}
}

View File

@@ -230,7 +230,7 @@ int main(int argc, char** argv)
if (parser.isSet(versionOption))
{
std::cout
<< "Hyperion Ambilight Deamon (" << getpid() << ")" << std::endl
<< "Hyperion Ambilight Deamon" << std::endl
<< "\tVersion : " << HYPERION_VERSION << " (" << HYPERION_BUILD_ID << ")" << std::endl
<< "\tBuild Time: " << __DATE__ << " " << __TIME__ << std::endl;