jRoster::~jRoster() { this->setOffline(); TreeModelItem contact; contact.m_protocol_name = "Jabber"; contact.m_account_name = m_account_name; contact.m_item_name = m_account_name; contact.m_item_type = TreeModelItem::Account; emit removeItemFromContactList(contact); delete m_my_connections; qDeleteAll(m_roster); }
jAccount::jAccount(const QString &account_name, const QString &profile_name, QObject *parent) : QObject(parent), m_jabber_plugin_system(jPluginSystem::instance()) { m_status_icon = m_jabber_plugin_system.getStatusIcon("offline", "jabber"); m_account_name = account_name; m_profile_name = profile_name; QSettings account_settings(QSettings::NativeFormat, QSettings::UserScope, "qutim/qutim."+m_profile_name/*+"/jabber."+m_account_name*/, "jabbericons"); m_path_to_avatars = account_settings.fileName(); m_path_to_avatars.truncate(m_path_to_avatars.length()-4); m_jabber_slotsignal = new jSlotSignal(this); m_jabber_roster = new jRoster(account_name, profile_name, this); m_jabber_protocol = new jProtocol(m_account_name, m_profile_name, m_jabber_roster, this); m_conference_management_object = m_jabber_protocol->getConferenceManagmentObject(); createStatusMenu(); m_status = Presence::Unavailable; connect(m_jabber_roster, SIGNAL(addItemToContactList(const TreeModelItem &, QString)), m_jabber_slotsignal, SLOT(addItemToContactList(const TreeModelItem &, QString))); connect(m_jabber_roster, SIGNAL(removeItemFromContactList(TreeModelItem)), m_jabber_slotsignal, SLOT(removeItemFromContactList(TreeModelItem))); connect(m_jabber_roster, SIGNAL(setContactItemStatus(const TreeModelItem &, QString, int)), m_jabber_slotsignal, SLOT(setContactItemStatus(const TreeModelItem &, QString, int))); connect(m_jabber_roster, SIGNAL(setItemInvisible(const TreeModelItem &, bool)), m_jabber_slotsignal, SLOT(setItemInvisible(const TreeModelItem &, bool))); connect(m_jabber_protocol, SIGNAL(setRealStatus(int)), this, SLOT(setRealStatus(int))); connect(m_jabber_protocol, SIGNAL(setClientCustomIcon(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomIcon(const TreeModelItem &, const QString &, int))); connect(m_jabber_protocol, SIGNAL(setClientCustomText(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomText(const TreeModelItem &, const QString &, int))); connect(m_jabber_protocol, SIGNAL(addMessageFrom(const TreeModelItem &, const QDateTime &, const QString &)), m_jabber_slotsignal, SLOT(addMessageFrom(const TreeModelItem &, const QDateTime &, const QString &))); connect(m_jabber_roster, SIGNAL(addServiceMessage(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(addServiceMessage(const TreeModelItem &, const QString &))); connect(m_jabber_protocol, SIGNAL(messageDelievered(const TreeModelItem &, int)), m_jabber_slotsignal, SLOT(messageDelievered(const TreeModelItem &, int))); connect(m_jabber_protocol, SIGNAL(sendTypingNotification(const TreeModelItem &, bool)), m_jabber_slotsignal, SLOT(sendTypingNotification(const TreeModelItem &, bool))); connect(m_conference_management_object, SIGNAL(addConferenceItem(const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(addConferenceItem(const QString &,const QString &,const QString &,const QString &))); connect(m_conference_management_object, SIGNAL(removeConferenceItem(const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(removeConferenceItem(const QString &,const QString &,const QString &,const QString &))); connect(m_conference_management_object, SIGNAL(renameConferenceItem(const QString &,const QString &,const QString &,const QString &,const QString &)), m_jabber_slotsignal, SLOT(renameConferenceItem(const QString &,const QString &,const QString &,const QString &,const QString &))); connect(m_conference_management_object, SIGNAL(setConferenceItemStatus(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemStatus(const QString &,const QString &,const QString &,const QString &,const QString &, int))); connect(m_conference_management_object, SIGNAL(setConferenceItemRole(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemRole(const QString &,const QString &,const QString &,const QString &,const QString &, int))); connect(m_conference_management_object, SIGNAL(setConferenceItemIcon(const QString &,const QString &,const QString &,const QString &,const QString &, int)), m_jabber_slotsignal, SLOT(setConferenceItemIcon(const QString &,const QString &,const QString &,const QString &,const QString &, int))); connect(m_conference_management_object, SIGNAL(addMessageToConference(const QString &, const QString &,const QString &, const QString &, const QDateTime &, bool)), m_jabber_slotsignal, SLOT(addMessageToConference(const QString &, const QString &,const QString &, const QString &, const QDateTime &, bool))); connect(m_conference_management_object, SIGNAL(changeOwnConferenceNickName(const QString &,const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(changeOwnConferenceNickName(const QString &,const QString &, const QString &, const QString &))); connect(m_conference_management_object, SIGNAL(createConference(const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(createConference(const QString &, const QString &, const QString &))); connect(m_jabber_roster, SIGNAL(clientVersion(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(clientVersion(const TreeModelItem &, const QString &))); connect(m_jabber_protocol, SIGNAL(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)), m_jabber_slotsignal, SLOT(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &))); connect(m_conference_management_object, SIGNAL(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &)), m_jabber_slotsignal, SLOT(conferenceClientVersion(const QString &,const QString &,const QString &,const QString &, const QString &))); connect(m_jabber_protocol, SIGNAL(systemNotification(const QString &, const QString &)), m_jabber_slotsignal, SLOT(systemNotification(const QString &, const QString &))); connect(m_jabber_protocol, SIGNAL(onFetchVCard(const QString&, const VCard*, const QString&)), m_jabber_slotsignal, SLOT(s_onFetchVCard(const QString&, const VCard*, const QString&))); //connect(m_jabber_protocol, SIGNAL(receiveSDisco(const JID&, const Disco::Items&, QString&)), m_jabber_slotsignal, SLOT(s_receiveSDisco(const JID&, const Disco::Items&, QString&))); //connect(m_jabber_protocol, SIGNAL(receiveSDiscoInfo(const JID&, const Disco::Info&, QString&)), m_jabber_slotsignal, SLOT(s_receiveSDiscoInfo(const JID&, const Disco::Info&, QString&))); connect(m_jabber_roster, SIGNAL(setItemIcon(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomIcon(const TreeModelItem &, const QString &, int))); connect(m_jabber_roster, SIGNAL(setItemCustomText(const TreeModelItem &, const QString &, int)), m_jabber_slotsignal, SLOT(setClientCustomText(const TreeModelItem &, const QString &, int))); connect(m_conference_management_object, SIGNAL(setConferenceTopic(const QString &, const QString &, const QString &, const QString &)), m_jabber_slotsignal, SLOT(setConferenceTopic(const QString &, const QString &, const QString &, const QString &))); connect(m_conference_management_object, SIGNAL(addSystemMessageToConference(const QString &, const QString &, const QString &, const QString &, const QDateTime &, bool)), m_jabber_slotsignal, SLOT(addSystemMessageToConference(const QString &, const QString &, const QString &, const QString &, const QDateTime &, bool))); connect(m_jabber_protocol, SIGNAL(createAcceptAuthDialog(const QString &, const JID &, Client *)), m_jabber_slotsignal, SLOT(createAcceptAuthDialog(const QString &, const JID &, Client *))); connect(m_jabber_roster, SIGNAL(s_customNotification(const TreeModelItem &, const QString &)), m_jabber_slotsignal, SLOT(customNotification(const TreeModelItem &, const QString &))); connect(m_jabber_roster, SIGNAL(moveItemInContactList(TreeModelItem, TreeModelItem)), m_jabber_slotsignal, SLOT(moveItemInContactList(TreeModelItem, TreeModelItem))); connect(m_jabber_roster, SIGNAL(setContactItemName(TreeModelItem, QString)), m_jabber_slotsignal, SLOT(setContactItemName(TreeModelItem, QString))); connect(m_jabber_protocol, SIGNAL(bookmarksHandled(const BookmarkList &, const ConferenceList &)), m_jabber_slotsignal, SLOT(bookmarksHandled(const BookmarkList &, const ConferenceList &))); connect(m_jabber_protocol, SIGNAL(tagHandled(const QString &, bool)), m_jabber_slotsignal, SLOT(tagHandled(const QString &, bool))); connect(m_jabber_protocol, SIGNAL(conferenceInvite(const JID&, const JID&, const QString&, const QString&)), m_conference_management_object, SLOT(s_conferenceInvite(const JID&, const JID&, const QString&, const QString&))); // connect(m_jabber_roster, SIGNAL(), m_jabber_slotsignal, SLOT()); m_jabber_roster->constr(); m_jabber_roster->loadSettings(); m_jabber_roster->loadRosterFromSettings(); }