X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=23b838ff4b08495a7d38c41b9f1fe8206051416e;hb=6fd69e84e6c395a108e6b2620c6428907b7d7efd;hp=32f599d379ba88ce290286e5684370169f7609ed;hpb=e375f7a6a6de045735a897ef05bf6dcc82770ff5;p=quassel.git diff --git a/src/client/client.cpp b/src/client/client.cpp index 32f599d3..23b838ff 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -114,8 +114,7 @@ Client::Client(QObject *parent) _messageProcessor(0), _coreAccountModel(new CoreAccountModel(this)), _coreConnection(new CoreConnection(this)), - _connected(false), - _debugLog(&_debugLogBuffer) + _connected(false) { _signalProxy->synchronize(_ircListHelper); } @@ -215,6 +214,16 @@ void Client::onDbUpgradeInProgress(bool inProgress) } +void Client::onExitRequested(int exitCode, const QString &reason) +{ + if (!reason.isEmpty()) { + qCritical() << reason; + emit exitRequested(reason); + } + QCoreApplication::exit(exitCode); +} + + /*** Network handling ***/ QList Client::networkIds() @@ -753,48 +762,3 @@ void Client::corePasswordChanged(PeerPtr, bool success) coreAccountModel()->save(); emit passwordChanged(success); } - - -#if QT_VERSION < 0x050000 -void Client::logMessage(QtMsgType type, const char *msg) -{ - fprintf(stderr, "%s\n", msg); - fflush(stderr); - if (type == QtFatalMsg) { - Quassel::logFatalMessage(msg); - } - else { - QString msgString = QString("%1\n").arg(msg); - - //Check to see if there is an instance around, else we risk recursions - //when calling instance() and creating new ones. - if (!instanceExists()) - return; - - instance()->_debugLog << msgString; - emit instance()->logUpdated(msgString); - } -} -#else -void Client::logMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) -{ - Q_UNUSED(context); - - fprintf(stderr, "%s\n", msg.toLocal8Bit().constData()); - fflush(stderr); - if (type == QtFatalMsg) { - Quassel::logFatalMessage(msg.toLocal8Bit().constData()); - } - else { - QString msgString = QString("%1\n").arg(msg); - - //Check to see if there is an instance around, else we risk recursions - //when calling instance() and creating new ones. - if (!instanceExists()) - return; - - instance()->_debugLog << msgString; - emit instance()->logUpdated(msgString); - } -} -#endif