Changeset View
Changeset View
Standalone View
Standalone View
plugins/statistics/statisticsplugin.cpp
Context not available. | |||||
60 | QAction *viewMetaContactStatistics = new QAction(QIcon::fromTheme(QStringLiteral("view-statistics")), i18n("View &Statistics"), | 60 | QAction *viewMetaContactStatistics = new QAction(QIcon::fromTheme(QStringLiteral("view-statistics")), i18n("View &Statistics"), | ||
---|---|---|---|---|---|
61 | this); | 61 | this); | ||
62 | actionCollection()->addAction(QStringLiteral("viewMetaContactStatistics"), viewMetaContactStatistics); | 62 | actionCollection()->addAction(QStringLiteral("viewMetaContactStatistics"), viewMetaContactStatistics); | ||
63 | connect(viewMetaContactStatistics, SIGNAL(triggered(bool)), this, SLOT(slotViewStatistics())); | 63 | connect(viewMetaContactStatistics, &QAction::triggered, this, &StatisticsPlugin::slotViewStatistics); | ||
64 | viewMetaContactStatistics->setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count() == 1); | 64 | viewMetaContactStatistics->setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count() == 1); | ||
65 | 65 | | |||
66 | connect(Kopete::ChatSessionManager::self(), SIGNAL(chatSessionCreated(Kopete::ChatSession *)), | 66 | connect(Kopete::ChatSessionManager::self(), &Kopete::ChatSessionManager::chatSessionCreated, this, &StatisticsPlugin::slotViewCreated); | ||
67 | this, SLOT(slotViewCreated(Kopete::ChatSession *))); | 67 | connect(Kopete::ChatSessionManager::self(), &Kopete::ChatSessionManager::aboutToReceive, this, &StatisticsPlugin::slotAboutToReceive); | ||
68 | connect(Kopete::ChatSessionManager::self(), SIGNAL(aboutToReceive(Kopete::Message&)), | | |||
69 | this, SLOT(slotAboutToReceive(Kopete::Message&))); | | |||
70 | 68 | | |||
71 | connect(Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)), | 69 | connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactSelected, viewMetaContactStatistics, &QAction::setEnabled); | ||
72 | viewMetaContactStatistics, SLOT(setEnabled(bool))); | 70 | connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactAdded, this, &StatisticsPlugin::slotMetaContactAdded); | ||
73 | connect(Kopete::ContactList::self(), SIGNAL(metaContactAdded(Kopete::MetaContact *)), | 71 | connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactRemoved, this, &StatisticsPlugin::slotMetaContactRemoved); | ||
74 | this, SLOT(slotMetaContactAdded(Kopete::MetaContact *))); | | |||
75 | connect(Kopete::ContactList::self(), SIGNAL(metaContactRemoved(Kopete::MetaContact *)), | | |||
76 | this, SLOT(slotMetaContactRemoved(Kopete::MetaContact *))); | | |||
77 | 72 | | |||
78 | setComponentName(QStringLiteral("kopete_statistics"), i18n("Kopete")); | 73 | setComponentName(QStringLiteral("kopete_statistics"), i18n("Kopete")); | ||
79 | setXMLFile(QStringLiteral("statisticsui.rc")); | 74 | setXMLFile(QStringLiteral("statisticsui.rc")); | ||
Context not available. | |||||
99 | slotMetaContactAdded(metaContact); | 94 | slotMetaContactAdded(metaContact); | ||
100 | slotOnlineStatusChanged(metaContact, metaContact->status()); | 95 | slotOnlineStatusChanged(metaContact, metaContact->status()); | ||
101 | } else { | 96 | } else { | ||
102 | connect(metaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this, | 97 | connect(metaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this, SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType))); | ||
103 | SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType))); | | |||
104 | } | 98 | } | ||
105 | } | 99 | } | ||
106 | } | 100 | } | ||
Context not available. | |||||
183 | 177 | | |||
184 | void StatisticsPlugin::slotMetaContactAdded(Kopete::MetaContact *mc) | 178 | void StatisticsPlugin::slotMetaContactAdded(Kopete::MetaContact *mc) | ||
185 | { | 179 | { | ||
186 | connect(mc, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this, | 180 | connect(mc, &Kopete::MetaContact::onlineStatusChanged, this, &StatisticsPlugin::slotOnlineStatusChanged); | ||
187 | SLOT(slotOnlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType))); | | |||
188 | 181 | | |||
189 | if (!statisticsContactMap.contains(mc)) { | 182 | if (!statisticsContactMap.contains(mc)) { | ||
190 | statisticsContactMap[mc] = new StatisticsContact(mc, db()); | 183 | statisticsContactMap[mc] = new StatisticsContact(mc, db()); | ||
Context not available. | |||||
194 | void StatisticsPlugin::slotDelayedMetaContactAdded(Kopete::MetaContact *mc, Kopete::OnlineStatus::StatusType status) | 187 | void StatisticsPlugin::slotDelayedMetaContactAdded(Kopete::MetaContact *mc, Kopete::OnlineStatus::StatusType status) | ||
195 | { | 188 | { | ||
196 | if (status != Kopete::OnlineStatus::Unknown) { | 189 | if (status != Kopete::OnlineStatus::Unknown) { | ||
197 | disconnect(mc, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this, | 190 | disconnect(mc, &Kopete::MetaContact::onlineStatusChanged, this, &StatisticsPlugin::slotDelayedMetaContactAdded); | ||
198 | SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType))); | | |||
199 | 191 | | |||
200 | slotMetaContactAdded(mc); | 192 | slotMetaContactAdded(mc); | ||
201 | slotOnlineStatusChanged(mc, status); | 193 | slotOnlineStatusChanged(mc, status); | ||
Context not available. |