/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
// We catch SIGTERM and SIGINT (caused by Ctrl+C) to graceful shutdown Quassel.
signal(SIGTERM, handleSignal);
signal(SIGINT, handleSignal);
+#ifndef Q_OS_WIN
+ // SIGHUP is used to reload configuration (i.e. SSL certificates)
+ // Windows does not support SIGHUP
+ signal(SIGHUP, handleSignal);
+#endif
}
qRegisterMetaType<MsgId>("MsgId");
qRegisterMetaType<QHostAddress>("QHostAddress");
+ qRegisterMetaTypeStreamOperators<QHostAddress>("QHostAddress");
qRegisterMetaType<QUuid>("QUuid");
+ qRegisterMetaTypeStreamOperators<QUuid>("QUuid");
qRegisterMetaTypeStreamOperators<IdentityId>("IdentityId");
qRegisterMetaTypeStreamOperators<BufferId>("BufferId");
_buildInfo.baseVersion = QUASSEL_VERSION_STRING;
_buildInfo.generatedVersion = GIT_DESCRIBE;
- // This will be imprecise for incremental builds not touching this file, but we really don't want to always recompile
- _buildInfo.buildDate = QString("%1 %2").arg(__DATE__, __TIME__);
-
// Check if we got a commit hash
- if (!QString(GIT_HEAD).isEmpty())
+ if (!QString(GIT_HEAD).isEmpty()) {
_buildInfo.commitHash = GIT_HEAD;
+ QDateTime date;
+ date.setTime_t(GIT_COMMIT_DATE);
+ _buildInfo.commitDate = date.toString();
+ }
else if (!QString(DIST_HASH).contains("Format")) {
_buildInfo.commitHash = DIST_HASH;
- _buildInfo.commitDate = QString(DIST_DATE).toUInt();
+ _buildInfo.commitDate = QString(DIST_DATE);
}
// create a nice version string
else
QCoreApplication::quit();
break;
+#ifndef Q_OS_WIN
+// Windows does not support SIGHUP
+ case SIGHUP:
+ // Most applications use this as the 'configuration reload' command, e.g. nginx uses it for
+ // graceful reloading of processes.
+ if (_instance) {
+ // If the instance exists, reload the configuration
+ quInfo() << "Caught signal" << SIGHUP <<"- reloading configuration";
+ if (_instance->reloadConfig()) {
+ quInfo() << "Successfully reloaded configuration";
+ }
+ }
+ break;
+#endif
case SIGABRT:
case SIGSEGV:
#ifndef Q_OS_WIN