Remove meegotouch dependency in eventhandler

MGConfItem was used to monitor for theme changes, supposedly a
deprecated feature for meegotouch only. It's entirely unnecessary now.
pull/1/head
John Brooks 13 years ago
parent 593ea85036
commit 66b8b75e08

@ -11,7 +11,8 @@
int EventHandler::m_sighupFd[2];
struct sigaction EventHandler::m_oldSigAction;
EventHandler::EventHandler(Booster* parent, EventHandlerType type) : m_item(0), m_parent(parent), m_type(type)
EventHandler::EventHandler(Booster* parent)
: m_parent(parent)
{
m_sighupFd[0] = -1;
m_sighupFd[1] = -1;
@ -32,13 +33,6 @@ void EventHandler::runEventLoop()
connect(this, SIGNAL(connectionAccepted()), QApplication::instance(), SLOT(quit()));
connect(this, SIGNAL(connectionRejected()), QApplication::instance(), SLOT(quit()));
if (m_type == MEventHandler)
{
// Enable theme change handler
m_item = new MGConfItem(MEEGOTOUCH_THEME_GCONF_KEY, 0);
connect(m_item, SIGNAL(valueChanged()), this, SLOT(notifyThemeChange()));
}
// Start another thread to listen connection from invoker
QtConcurrent::run(this, &EventHandler::accept);
@ -64,11 +58,6 @@ void EventHandler::runEventLoop()
// Run event loop so application instance can receive notifications
QApplication::exec();
// Disable theme change handler
disconnect(m_item, 0, this, 0);
delete m_item;
m_item = NULL;
// Restore signal handlers to previous values
if (handlerIsSet)
{
@ -88,17 +77,6 @@ void EventHandler::accept()
}
}
void EventHandler::notifyThemeChange()
{
#ifdef WITH_COVERAGE
__gcov_flush();
#endif
// only MApplication is connected to this signal
QApplication::quit();
_exit(EXIT_SUCCESS);
}
//
// All this signal handling code is taken from Qt's Best Practices:
// http://doc.qt.nokia.com/latest/unix-signals.html

@ -2,7 +2,6 @@
#include <QSocketNotifier>
#include <signal.h>
#include <tr1/memory>
#include <MGConfItem>
using std::tr1::shared_ptr;
@ -14,15 +13,8 @@ class EventHandler : public QObject
Q_OBJECT
public:
enum EventHandlerType
{
QEventHandler,
MEventHandler
};
//! \brief Constructor
EventHandler(Booster* parent, EventHandlerType type);
EventHandler(Booster* parent);
//! \brief Destructor
virtual ~EventHandler();
@ -52,24 +44,14 @@ private:
//! Old sigaction struct
static struct sigaction m_oldSigAction;
//! GConf item to listen theme change
MGConfItem* m_item;
// Parent object
Booster* m_parent;
// type of application's event loop
const EventHandlerType m_type;
private slots:
//! Qt signal handler for SIGHUP.
void handleSigHup();
//! Qt signal handler for theme change
//! Deprecated in MeeGo 1.2 Harmattan
void notifyThemeChange();
signals:
void connectionAccepted();
void connectionRejected();

@ -69,7 +69,7 @@ bool QDeclarativeBooster::receiveDataFromInvoker(int socketFd)
// Setup the conversation channel with the invoker.
setConnection(new Connection(socketFd));
EventHandler handler(this, EventHandler::QEventHandler);
EventHandler handler(this);
handler.runEventLoop();
if (!connection()->connected())

Loading…
Cancel
Save