2
0

accountmanager.cpp 822 B

1234567891011121314151617181920212223242526272829303132
  1. #include "accountmanager.h"
  2. QList<QSharedPointer<Account> > AccountManager::_accounts;
  3. AccountManager::AccountManager(QObject *parent) :
  4. QObject(parent)
  5. {
  6. connect(g_FSHost, SIGNAL(newEvent(QSharedPointer<switch_event_t>)), this, SLOT(newEventSlot(QSharedPointer<switch_event_t>)));
  7. }
  8. void AccountManager::newEventSlot(QSharedPointer<switch_event_t> e) {
  9. QString eName = switch_event_get_header_nil(e.data(), "Event-Name");
  10. QString eSub = e.data()->subclass_name;
  11. qDebug() << eName;
  12. switch(e.data()->event_id) {
  13. case SWITCH_EVENT_CUSTOM:
  14. {
  15. qDebug() << eName << eSub;
  16. break;
  17. }
  18. case SWITCH_EVENT_API:
  19. {
  20. /* Might not be necessary anymore */
  21. break;
  22. }
  23. default:
  24. {
  25. break;
  26. }
  27. }
  28. }