If we do not do this, QT will exit from event loop.
}
HEADERS += appsettings.h \
+ application.h \
alarmdbus.h \
alarmdbusadaptorp.h
SOURCES += main.cpp \
+ application.cpp \
appsettings.cpp \
alarmdbus.cpp \
alarmdbusadaptor.cpp
--- /dev/null
+/*
+ * Copyright (C) 2010 Ixonos Plc.
+ *
+ * This file is part of fosdem-schedule.
+ *
+ * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * fosdem-schedule is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * fosdem-schedule. If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "application.h"
+
+#include <ormrecord.h>
+
+// if the application uses exceptions,
+// there is always a possibility that some will leak uncached from event handler
+// crashing the application is too big punishment for it
+bool Application::notify(QObject* receiver, QEvent* event)
+{
+ try {
+ return QApplication::notify(receiver, event);
+ } catch (OrmException& e) {
+ qWarning() << "UNCAUGHT EXCEPTION: OrmException, text= " << e.text();
+ return false;
+ } catch (...) {
+ qWarning() << "UNCAUGHT EXCEPTION: unknown";
+ return false;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Ixonos Plc.
+ *
+ * This file is part of fosdem-schedule.
+ *
+ * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * fosdem-schedule is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * fosdem-schedule. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef APPLICATION_H
+#define APPLICATION_H
+
+#include <QApplication>
+
+class Application : public QApplication
+{
+ Q_OBJECT
+
+public:
+ Application(int& argc, char** argv)
+ : QApplication(argc, argv)
+ { }
+ virtual ~Application() { }
+
+ virtual bool notify(QObject* receiver, QEvent* event);
+};
+
+#endif
*/
#include <mainwindow.h>
-#include <QtGui/QApplication>
#include <sqlengine.h>
#include "eventdialog.h"
+#include "application.h"
#ifdef MAEMO
//#include <alarmdialog.h>
Q_INIT_RESOURCE(maps);
Q_INIT_RESOURCE(db);
- QApplication a(argc, argv);
- QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
+ Application a(argc, argv);
+ Application::setWindowIcon(QIcon(":/icons/fosdem.png"));
SqlEngine::initialize(); // creates "SQLITE" DB connection