#include <signal.h>
-#ifndef Q_OS_WIN32
+#if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC)
#include <execinfo.h>
#include <dlfcn.h>
#include <cxxabi.h>
QCoreApplication::quit();
}
-#ifndef Q_OS_WIN32
+#if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC)
void handle_crash(int sig) {
+ Q_UNUSED(sig)
void* callstack[128];
int i, frames = backtrace(callstack, 128);
dumpFile.close();
exit(27);
}
-#endif // ifndef Q_OS_WIN32
+#endif // #if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC)
int main(int argc, char **argv) {
signal(SIGTERM, handle_signal);
signal(SIGINT, handle_signal);
-#ifndef Q_OS_WIN32
+#if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC)
signal(SIGABRT, handle_crash);
signal(SIGBUS, handle_crash);
signal(SIGSEGV, handle_crash);
-#endif // ndef Q_OS_WIN32
-
+#endif // #if defined(HAVE_EXECINFO) and not defined(Q_OS_MAC)
+
Global::registerMetaTypes();
Global::setupVersion();
-/*
-#if defined BUILD_CORE
- Global::runMode = Global::CoreOnly;
- QCoreApplication app(argc, argv);
-#elif defined BUILD_QTUI
- Global::runMode = Global::ClientOnly;
- QApplication app(argc, argv);
-#else
- Global::runMode = Global::Monolithic;
- QApplication app(argc, argv);
-#endif
-*/
#if defined BUILD_CORE
Global::runMode = Global::CoreOnly;
QCoreApplication app(argc, argv);
QtUiApplication app(argc, argv);
#endif
-
-
Global::parser = CliParser(QCoreApplication::arguments());
#ifndef BUILD_QTUI
QCoreApplication::setApplicationName("Quassel IRC");
QCoreApplication::setOrganizationName("Quassel Project");
-
+
#ifndef BUILD_QTUI
Core::instance(); // create and init the core
#endif
}
#endif
-#ifndef BUILD_CORE
+#ifndef BUILD_CORE
app.resumeSessionIfPossible();
#endif
-
+
int exitCode = app.exec();
#ifndef BUILD_QTUI