Changeset View
Changeset View
Standalone View
Standalone View
plugins/history/historyplugin.cpp
Context not available. | |||||
28 | #include <kdeversion.h> | 28 | #include <kdeversion.h> | ||
---|---|---|---|---|---|
29 | #include <QIcon> | 29 | #include <QIcon> | ||
30 | #include <kactioncollection.h> | 30 | #include <kactioncollection.h> | ||
31 | #include <KLocalizedString> | ||||
31 | 32 | | |||
32 | #include "kopetechatsessionmanager.h" | 33 | #include "kopetechatsessionmanager.h" | ||
33 | #include "kopetemetacontact.h" | 34 | #include "kopetemetacontact.h" | ||
Context not available. | |||||
52 | QAction *viewMetaContactHistory = new QAction(QIcon::fromTheme(QStringLiteral("view-history")), i18n("View &History"), this); | 53 | QAction *viewMetaContactHistory = new QAction(QIcon::fromTheme(QStringLiteral("view-history")), i18n("View &History"), this); | ||
53 | actionCollection()->addAction("viewMetaContactHistory", viewMetaContactHistory); | 54 | actionCollection()->addAction("viewMetaContactHistory", viewMetaContactHistory); | ||
54 | viewMetaContactHistory->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); | 55 | viewMetaContactHistory->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); | ||
55 | connect(viewMetaContactHistory, SIGNAL(triggered(bool)), this, SLOT(slotViewHistory())); | 56 | connect(viewMetaContactHistory, &QAction::triggered, this, &HistoryPlugin::slotViewHistory); | ||
56 | viewMetaContactHistory->setEnabled( | 57 | viewMetaContactHistory->setEnabled( | ||
57 | Kopete::ContactList::self()->selectedMetaContacts().count() == 1); | 58 | Kopete::ContactList::self()->selectedMetaContacts().count() == 1); | ||
58 | 59 | | |||
59 | connect(Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)), | 60 | connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactSelected, viewMetaContactHistory, &QAction::setEnabled); | ||
60 | viewMetaContactHistory, SLOT(setEnabled(bool))); | | |||
61 | 61 | | |||
62 | connect(Kopete::ChatSessionManager::self(), SIGNAL(viewCreated(KopeteView *)), | 62 | connect(Kopete::ChatSessionManager::self(), &Kopete::ChatSessionManager::viewCreated, this, &HistoryPlugin::slotViewCreated); | ||
63 | this, SLOT(slotViewCreated(KopeteView *))); | | |||
64 | 63 | | |||
65 | connect(this, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged())); | 64 | connect(this, &HistoryPlugin::settingsChanged, this, &HistoryPlugin::slotSettingsChanged); | ||
66 | 65 | | |||
66 | setComponentName(QStringLiteral("kopete_history"), i18n("Kopete")); | ||||
67 | setXMLFile("historyui.rc"); | 67 | setXMLFile("historyui.rc"); | ||
68 | if (detectOldHistory()) { | 68 | if (detectOldHistory()) { | ||
69 | if ( | 69 | if ( | ||
Context not available. | |||||
81 | for (QList<Kopete::ChatSession *>::Iterator it = sessions.begin(); it != sessions.end(); ++it) { | 81 | for (QList<Kopete::ChatSession *>::Iterator it = sessions.begin(); it != sessions.end(); ++it) { | ||
82 | if (!m_loggers.contains(*it)) { | 82 | if (!m_loggers.contains(*it)) { | ||
83 | m_loggers.insert(*it, new HistoryGUIClient(*it)); | 83 | m_loggers.insert(*it, new HistoryGUIClient(*it)); | ||
84 | connect(*it, SIGNAL(closing(Kopete::ChatSession *)), | 84 | connect(*it, &Kopete::ChatSession::closing, this, &HistoryPlugin::slotKMMClosed); | ||
85 | this, SLOT(slotKMMClosed(Kopete::ChatSession *))); | | |||
86 | } | 85 | } | ||
87 | } | 86 | } | ||
88 | } | 87 | } | ||
Context not available. | |||||
109 | 108 | | |||
110 | if (!m_loggers.contains(m.manager())) { | 109 | if (!m_loggers.contains(m.manager())) { | ||
111 | m_loggers.insert(m.manager(), new HistoryGUIClient(m.manager())); | 110 | m_loggers.insert(m.manager(), new HistoryGUIClient(m.manager())); | ||
112 | connect(m.manager(), SIGNAL(closing(Kopete::ChatSession *)), | 111 | connect(m.manager(), &Kopete::ChatSession::closing, this, &HistoryPlugin::slotKMMClosed); | ||
113 | this, SLOT(slotKMMClosed(Kopete::ChatSession *))); | | |||
114 | } | 112 | } | ||
115 | 113 | | |||
116 | HistoryLogger *l = m_loggers[m.manager()]->logger(); | 114 | HistoryLogger *l = m_loggers[m.manager()]->logger(); | ||
Context not available. | |||||
153 | 151 | | |||
154 | if (!m_loggers.contains(m_currentChatSession)) { | 152 | if (!m_loggers.contains(m_currentChatSession)) { | ||
155 | m_loggers.insert(m_currentChatSession, new HistoryGUIClient(m_currentChatSession)); | 153 | m_loggers.insert(m_currentChatSession, new HistoryGUIClient(m_currentChatSession)); | ||
156 | connect(m_currentChatSession, SIGNAL(closing(Kopete::ChatSession *)), | 154 | connect(m_currentChatSession, &Kopete::ChatSession::closing, this, &HistoryPlugin::slotKMMClosed); | ||
157 | this, SLOT(slotKMMClosed(Kopete::ChatSession *))); | | |||
158 | } | 155 | } | ||
159 | 156 | | |||
160 | if (!autoChatWindow || nbAutoChatWindow == 0) { | 157 | if (!autoChatWindow || nbAutoChatWindow == 0) { | ||
Context not available. | |||||
186 | 183 | | |||
187 | void HistoryPlugin::slotSettingsChanged() | 184 | void HistoryPlugin::slotSettingsChanged() | ||
188 | { | 185 | { | ||
189 | kDebug(14310) << "RELOADING CONFIG"; | 186 | // kDebug(14310) << "RELOADING CONFIG"; | ||
190 | HistoryConfig::self()->load(); | 187 | HistoryConfig::self()->load(); | ||
191 | } | 188 | } | ||
192 | 189 | | |||
Context not available. |