defines GUH_* -> NYMEA_*

pull/135/head
Michael Zanetti 2018-01-29 15:59:15 +01:00
parent 22533fb23c
commit 39fc071ed6
18 changed files with 44 additions and 43 deletions

View File

@ -189,7 +189,7 @@ QByteArray DebugServerHandler::createDebugXmlDocument()
writer.writeStartElement("tr");
//: The server version description in the server infromation section of the debug interface
writer.writeTextElement("th", QCoreApplication::translate("main", "Server version"));
writer.writeTextElement("td", GUH_VERSION_STRING);
writer.writeTextElement("td", NYMEA_VERSION_STRING);
writer.writeEndElement(); // tr
writer.writeStartElement("tr");

View File

@ -163,7 +163,7 @@ void UpnpDiscoveryImplementation::respondToSearchRequest(QHostAddress host, int
"EXT:\r\n"
"CONTENT-LENGTH:0\r\n"
"LOCATION: " + locationString.toUtf8() + "\r\n"
"SERVER: guh/" + QByteArray(GUH_VERSION_STRING) + " UPnP/1.1 \r\n"
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
"ST:upnp:rootdevice\r\n"
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
"\r\n");
@ -381,7 +381,7 @@ void UpnpDiscoveryImplementation::sendByeByeMessage()
"NT:urn:schemas-upnp-org:device:Basic:1\r\n"
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
"NTS: ssdp:byebye\r\n"
"SERVER: guh/" + QByteArray(GUH_VERSION_STRING) + " UPnP/1.1 \r\n"
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
"\r\n");
sendToMulticast(byebyeMessage);
@ -427,7 +427,7 @@ void UpnpDiscoveryImplementation::sendAliveMessage()
"NT:urn:schemas-upnp-org:device:Basic:1\r\n"
"USN:uuid:" + uuid + "::urn:schemas-upnp-org:device:Basic:1\r\n"
"NTS: ssdp:alive\r\n"
"SERVER: guh/" + QByteArray(GUH_VERSION_STRING) + " UPnP/1.1 \r\n"
"SERVER: guh/" + QByteArray(NYMEA_VERSION_STRING) + " UPnP/1.1 \r\n"
"\r\n");
sendToMulticast(aliveMessage);

View File

@ -156,7 +156,7 @@ HttpReply::HttpReply(QObject *parent) :
// set known headers
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(GUH_VERSION_STRING));
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(NYMEA_VERSION_STRING));
setHeader(HttpHeaderType::DateHeader, GuhCore::instance()->timeManager()->currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8());
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");
@ -179,7 +179,7 @@ HttpReply::HttpReply(const HttpReply::HttpStatusCode &statusCode, const HttpRepl
// set known / default headers
setHeader(HttpReply::ContentTypeHeader, "text/plain; charset=\"utf-8\";");
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(GUH_VERSION_STRING));
setHeader(HttpHeaderType::ServerHeader, "guh/" + QByteArray(NYMEA_VERSION_STRING));
setHeader(HttpHeaderType::DateHeader, GuhCore::instance()->timeManager()->currentDateTime().toString("ddd, dd MMM yyyy hh:mm:ss").toUtf8());
setHeader(HttpHeaderType::CacheControlHeader, "no-cache");
setHeader(HttpHeaderType::ConnectionHeader, "Keep-Alive");

View File

@ -243,7 +243,7 @@ JsonReply* JsonRPCServer::Version(const QVariantMap &params) const
Q_UNUSED(params)
QVariantMap data;
data.insert("version", GUH_VERSION_STRING);
data.insert("version", NYMEA_VERSION_STRING);
data.insert("protocol version", JSON_PROTOCOL_VERSION);
return createReply(data);
}
@ -432,7 +432,7 @@ QVariantMap JsonRPCServer::createWelcomeMessage(TransportInterface *interface) c
handshake.insert("id", 0);
handshake.insert("server", "guhIO");
handshake.insert("name", GuhCore::instance()->configuration()->serverName());
handshake.insert("version", GUH_VERSION_STRING);
handshake.insert("version", NYMEA_VERSION_STRING);
handshake.insert("uuid", GuhCore::instance()->configuration()->serverUuid().toString());
handshake.insert("language", GuhCore::instance()->configuration()->locale().name());
handshake.insert("protocol version", JSON_PROTOCOL_VERSION);

View File

@ -134,7 +134,7 @@ void TcpServer::resetAvahiService()
// Note: reversed order
QHash<QString, QString> txt;
txt.insert("jsonrpcVersion", JSON_PROTOCOL_VERSION);
txt.insert("serverVersion", GUH_VERSION_STRING);
txt.insert("serverVersion", NYMEA_VERSION_STRING);
txt.insert("manufacturer", "guh GmbH");
txt.insert("uuid", GuhCore::instance()->configuration()->serverUuid().toString());
txt.insert("name", GuhCore::instance()->configuration()->serverName());

View File

@ -529,7 +529,7 @@ void WebServer::resetAvahiService()
// Note: reversed order
QHash<QString, QString> txt;
txt.insert("jsonrpcVersion", JSON_PROTOCOL_VERSION);
txt.insert("serverVersion", GUH_VERSION_STRING);
txt.insert("serverVersion", NYMEA_VERSION_STRING);
txt.insert("manufacturer", "guh GmbH");
txt.insert("uuid", GuhCore::instance()->configuration()->serverUuid().toString());
txt.insert("name", GuhCore::instance()->configuration()->serverName());
@ -667,7 +667,7 @@ QByteArray WebServer::createServerXmlDocument(QHostAddress address)
writer.writeTextElement("manufacturerURL", "http://guh.io");
writer.writeTextElement("modelDescription", "IoT server");
writer.writeTextElement("modelName", "nymead");
writer.writeTextElement("modelNumber", GUH_VERSION_STRING);
writer.writeTextElement("modelNumber", NYMEA_VERSION_STRING);
writer.writeTextElement("modelURL", "http://guh.io"); // (optional)
writer.writeTextElement("UDN", "uuid:" + uuid);

View File

@ -114,7 +114,7 @@ QHash<QString, QString> WebSocketServer::createTxtRecord()
// Note: reversed order
QHash<QString, QString> txt;
txt.insert("jsonrpcVersion", JSON_PROTOCOL_VERSION);
txt.insert("serverVersion", GUH_VERSION_STRING);
txt.insert("serverVersion", NYMEA_VERSION_STRING);
txt.insert("manufacturer", "guh GmbH");
txt.insert("uuid", GuhCore::instance()->configuration()->serverUuid().toString());
txt.insert("name", GuhCore::instance()->configuration()->serverName());

View File

@ -221,17 +221,17 @@ DeviceManager::~DeviceManager()
QStringList DeviceManager::pluginSearchDirs()
{
QStringList searchDirs;
QByteArray envPath = qgetenv("GUH_PLUGINS_PATH");
QByteArray envPath = qgetenv("NYMEA_PLUGINS_PATH");
if (!envPath.isEmpty()) {
searchDirs << QString(envPath).split(':');
}
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/guh/plugins";
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
searchDirs << QString("%1").arg(GUH_PLUGINS_PATH);
searchDirs << QString("%1").arg(NYMEA_PLUGINS_PATH);
QString snapDir = QString::fromUtf8(qgetenv("SNAP"));
if (!snapDir.isEmpty()) {
searchDirs << QString("%1%2").arg(snapDir).arg(GUH_PLUGINS_PATH);
searchDirs << QString("%1%2").arg(snapDir).arg(NYMEA_PLUGINS_PATH);
}
return searchDirs;
}

View File

@ -25,7 +25,7 @@
#include <QtCore/QtGlobal>
#if defined(LIBGUH_LIBRARY)
#if defined(LIBNYMEA_LIBRARY)
# define LIBGUH_EXPORT Q_DECL_EXPORT
#else
# define LIBGUH_EXPORT Q_DECL_IMPORT

View File

@ -4,7 +4,7 @@ TARGET = nymea
TEMPLATE = lib
QT += network bluetooth
DEFINES += LIBGUH_LIBRARY
DEFINES += LIBNYMEA_LIBRARY
QMAKE_LFLAGS += -fPIC
@ -128,7 +128,7 @@ SOURCES += devicemanager.cpp \
plugintimer.cpp \
hardwaremanager.cpp \
# install plugininfo python script for libguh-dev
# install plugininfo python script for libnymea-dev
generateplugininfo.files = $$top_srcdir/plugins/guh-generateplugininfo
generateplugininfo.path = /usr/bin
@ -136,7 +136,7 @@ INSTALLS += generateplugininfo
# install header file with relative subdirectory
for(header, HEADERS) {
path = /usr/include/guh/$${dirname(header)}
path = /usr/include/nymea/$${dirname(header)}
eval(headers_$${path}.files += $${header})
eval(headers_$${path}.path = $${path})
eval(INSTALLS *= headers_$${path})

View File

@ -1,18 +1,18 @@
# Parse and export GUH_VERSION_STRING
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
# Parse and export NYMEA_VERSION_STRING
NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
# Install path for plugins
GUH_PLUGINS_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/guh/plugins/
NYMEA_PLUGINS_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/
# define protocol versions
JSON_PROTOCOL_VERSION_MAJOR=1
JSON_PROTOCOL_VERSION_MINOR=2
REST_API_VERSION=1
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
DEFINES += NYMEA_VERSION_STRING=\\\"$${NYMEA_VERSION_STRING}\\\" \
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
GUH_PLUGINS_PATH=\\\"$${GUH_PLUGINS_PATH}\\\"
NYMEA_PLUGINS_PATH=\\\"$${NYMEA_PLUGINS_PATH}\\\"
QT *= network websockets bluetooth dbus
@ -62,9 +62,9 @@ coverage {
generate-coverage-html.commands = \
"@echo Collecting coverage data"; \
"lcov --directory $${top_srcdir} --capture --output-file coverage.info --no-checksum --compat-libtool"; \
"lcov --extract coverage.info \"*/server/*.cpp\" --extract coverage.info \"*/libguh-core/*.cpp\" --extract coverage.info \"*/libguh/*.cpp\" -o coverage.info"; \
"lcov --extract coverage.info \"*/server/*.cpp\" --extract coverage.info \"*/libnymea-core/*.cpp\" --extract coverage.info \"*/libnymea/*.cpp\" -o coverage.info"; \
"lcov --remove coverage.info \"moc_*.cpp\" --remove coverage.info \"*/test/*\" -o coverage.info"; \
"LANG=C genhtml --prefix $${top_srcdir} --output-directory coverage-html --title \"guh coverage\" --legend --show-details coverage.info"
"LANG=C genhtml --prefix $${top_srcdir} --output-directory coverage-html --title \"nymea coverage\" --legend --show-details coverage.info"
clean-coverage-html.depends = clean-gcda
clean-coverage-html.commands = \

View File

@ -33,20 +33,20 @@ lrelease.commands = lrelease $$_FILE_; \
rsync -a $$top_srcdir/translations/*.qm $$top_builddir/translations/;
# Install translation files
translations.path = /usr/share/guh/translations
translations.path = /usr/share/nymea/translations
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
translations.depends = lrelease
INSTALLS += translations
QMAKE_EXTRA_TARGETS += licensecheck doc test lupdate lrelease
# Inform about guh build
# Inform about nymea build
message(============================================)
message("Qt version:" $$[QT_VERSION])
message("Building guh version $${GUH_VERSION_STRING}")
message("Building nymea version $${NYMEA_VERSION_STRING}")
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}")
message("REST API version $${REST_API_VERSION}")
message("Plugin path $${GUH_PLUGINS_PATH}")
message("Plugin path $${NYMEA_PLUGINS_PATH}")
message("Source directory: $${top_srcdir}")
message("Build directory: $${top_builddir}")
@ -69,8 +69,8 @@ ccache {
# Build tests
disabletesting {
message("Building guh without tests")
message("Building nymea without tests")
} else {
message("Building guh with tests")
message("Building nymea with tests")
SUBDIRS += tests
}

View File

@ -34,5 +34,5 @@ PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_al
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
# Install plugin
target.path = $$GUH_PLUGINS_PATH
target.path = $$NYMEA_PLUGINS_PATH
INSTALLS += target

View File

@ -49,7 +49,7 @@ GuhService::GuhService(int argc, char **argv):
{
application()->setOrganizationName("guh");
application()->setApplicationName("nymead");
application()->setApplicationVersion(GUH_VERSION_STRING);
application()->setApplicationVersion(NYMEA_VERSION_STRING);
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
@ -71,7 +71,8 @@ void GuhService::start()
exit(EXIT_FAILURE);
}
qCDebug(dcApplication) << "=====================================";
qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started as daemon.";
qCDebug(dcApplication) << "nymead" << NYMEA_VERSION_STRING << "started as daemon.";
qCDebug(dcApplication) << "=====================================";
GuhCore::instance();
}

View File

@ -106,7 +106,7 @@ int main(int argc, char *argv[])
GuhApplication application(argc, argv);
application.setOrganizationName("guh");
application.setApplicationName("nymead");
application.setApplicationVersion(GUH_VERSION_STRING);
application.setApplicationVersion(NYMEA_VERSION_STRING);
// logging filers for core and libnymea
s_loggingFilters.insert("Application", true);
@ -167,7 +167,7 @@ int main(int argc, char *argv[])
applicationDescription.append(QString("nymead %1 %2 2014-2018 guh GmbH\n"
"Released under the GNU GENERAL PUBLIC LICENSE Version 2.\n\n"
"API version: %3\n").arg(GUH_VERSION_STRING).arg(QChar(0xA9)).arg(JSON_PROTOCOL_VERSION));
"API version: %3\n").arg(NYMEA_VERSION_STRING).arg(QChar(0xA9)).arg(JSON_PROTOCOL_VERSION));
parser.setApplicationDescription(applicationDescription);
@ -257,11 +257,11 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
qCDebug(dcApplication) << "=====================================";
qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started with user ID" << userId;
qCDebug(dcApplication) << "nymead" << NYMEA_VERSION_STRING << "started with user ID" << userId;
qCDebug(dcApplication) << "=====================================";
} else {
qCDebug(dcApplication) << "=====================================";
qCDebug(dcApplication) << "nymead" << GUH_VERSION_STRING << "started as root.";
qCDebug(dcApplication) << "nymead" << NYMEA_VERSION_STRING << "started as root.";
qCDebug(dcApplication) << "=====================================";
}

View File

@ -140,7 +140,7 @@ void TestJSONRPC::testHandshake()
QJsonDocument jsonDoc = QJsonDocument::fromJson(spy.first().at(1).toByteArray());
QVariantMap handShake = jsonDoc.toVariant().toMap();
QString guhVersionString(GUH_VERSION_STRING);
QString guhVersionString(NYMEA_VERSION_STRING);
QVERIFY2(handShake.value("version").toString() == guhVersionString, "Handshake version doesn't match Guh version.");
// Check whether pushButtonAuth is disabled

View File

@ -48,10 +48,10 @@ void TestVersioning::version()
QString version = response.toMap().value("params").toMap().value("version").toString();
QVariant protocolVersion = response.toMap().value("params").toMap().value("protocol version");
qDebug() << "Got version:" << version << "( Expected:" << GUH_VERSION_STRING << ")";
qDebug() << "Got version:" << version << "( Expected:" << NYMEA_VERSION_STRING << ")";
QVERIFY2(!version.isEmpty(), "Version is empty.");
QCOMPARE(version, QString(GUH_VERSION_STRING));
QCOMPARE(version, QString(NYMEA_VERSION_STRING));
QVERIFY2(!protocolVersion.toString().isEmpty(), "Protocol version is empty.");
QVERIFY2(protocolVersion.canConvert(QVariant::Int), "Protocol version is not an integer.");

View File

@ -98,7 +98,7 @@ void TestWebSocketServer::testHandshake()
QJsonDocument jsonDoc = QJsonDocument::fromJson(spy.first().first().toByteArray());
QVariantMap handShake = jsonDoc.toVariant().toMap();
QString guhVersionString(GUH_VERSION_STRING);
QString guhVersionString(NYMEA_VERSION_STRING);
QString jsonProtocolVersionString(JSON_PROTOCOL_VERSION);
QCOMPARE(handShake.value("version").toString(), guhVersionString);
QCOMPARE(handShake.value("protocol version").toString(), jsonProtocolVersionString);