Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8f128012 authored by Vijay Krishnavanshi's avatar Vijay Krishnavanshi Committed by Pali Rohár

Adapted solts and signals of highlight plugin to Qt5

parent 522df832
......@@ -77,7 +77,7 @@ void HighlightConfig::load()
{
m_filters.clear(); //clear filters
const QString filename = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("highlight.xml");
const QString filename = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + QStringLiteral("highlight.xml");
if (filename.isEmpty()) {
return;
}
......@@ -135,7 +135,7 @@ void HighlightConfig::load()
void HighlightConfig::save()
{
const QString fileName = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + QStringLiteral("highlight.xml");
const QString fileName = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1Char('/') + QStringLiteral("highlight.xml");
QSaveFile file(fileName);
if (file.open(QIODevice::WriteOnly)) {
......
......@@ -91,8 +91,8 @@ StatisticsDialog::StatisticsDialog (StatisticsContact *contact, StatisticsDB *db
m_offlineColor.name()));
dialogUi->datePicker->setDate(QDate::currentDate());
connect(dialogUi->datePicker, SIGNAL(dateChanged(QDate)), this, SLOT(fillCalendarCells()));
connect(dialogUi->datePicker, SIGNAL(dateChanged(QDate)), this, SLOT(generateOneDayStats()));
connect(dialogUi->datePicker, &KDatePicker::dateChanged, this, &StatisticsDialog::fillCalendarCells);
connect(dialogUi->datePicker, &KDatePicker::dateChanged, this, &StatisticsDialog::generateOneDayStats);
setFocus();
setEscapeButton(Close);
......
......@@ -60,20 +60,15 @@ StatisticsPlugin::StatisticsPlugin(QObject *parent, const QVariantList & /*args*
QAction *viewMetaContactStatistics = new QAction(QIcon::fromTheme(QStringLiteral("view-statistics")), i18n("View &Statistics"),
this);
actionCollection()->addAction(QStringLiteral("viewMetaContactStatistics"), viewMetaContactStatistics);
connect(viewMetaContactStatistics, SIGNAL(triggered(bool)), this, SLOT(slotViewStatistics()));
connect(viewMetaContactStatistics, &QAction::triggered, this, &StatisticsPlugin::slotViewStatistics);
viewMetaContactStatistics->setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count() == 1);
connect(Kopete::ChatSessionManager::self(), SIGNAL(chatSessionCreated(Kopete::ChatSession *)),
this, SLOT(slotViewCreated(Kopete::ChatSession *)));
connect(Kopete::ChatSessionManager::self(), SIGNAL(aboutToReceive(Kopete::Message&)),
this, SLOT(slotAboutToReceive(Kopete::Message&)));
connect(Kopete::ChatSessionManager::self(), &Kopete::ChatSessionManager::chatSessionCreated, this, &StatisticsPlugin::slotViewCreated);
connect(Kopete::ChatSessionManager::self(), &Kopete::ChatSessionManager::aboutToReceive, this, &StatisticsPlugin::slotAboutToReceive);
connect(Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)),
viewMetaContactStatistics, SLOT(setEnabled(bool)));
connect(Kopete::ContactList::self(), SIGNAL(metaContactAdded(Kopete::MetaContact *)),
this, SLOT(slotMetaContactAdded(Kopete::MetaContact *)));
connect(Kopete::ContactList::self(), SIGNAL(metaContactRemoved(Kopete::MetaContact *)),
this, SLOT(slotMetaContactRemoved(Kopete::MetaContact *)));
connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactSelected, viewMetaContactStatistics, &QAction::setEnabled);
connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactAdded, this, &StatisticsPlugin::slotMetaContactAdded);
connect(Kopete::ContactList::self(), &Kopete::ContactList::metaContactRemoved, this, &StatisticsPlugin::slotMetaContactRemoved);
setComponentName(QStringLiteral("kopete_statistics"), i18n("Kopete"));
setXMLFile(QStringLiteral("statisticsui.rc"));
......@@ -99,8 +94,7 @@ void StatisticsPlugin::slotInitialize()
slotMetaContactAdded(metaContact);
slotOnlineStatusChanged(metaContact, metaContact->status());
} else {
connect(metaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this,
SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)));
connect(metaContact, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this, SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)));
}
}
}
......@@ -183,8 +177,7 @@ void StatisticsPlugin::slotOnlineStatusChanged(Kopete::MetaContact *metaContact,
void StatisticsPlugin::slotMetaContactAdded(Kopete::MetaContact *mc)
{
connect(mc, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this,
SLOT(slotOnlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)));
connect(mc, &Kopete::MetaContact::onlineStatusChanged, this, &StatisticsPlugin::slotOnlineStatusChanged);
if (!statisticsContactMap.contains(mc)) {
statisticsContactMap[mc] = new StatisticsContact(mc, db());
......@@ -194,8 +187,7 @@ void StatisticsPlugin::slotMetaContactAdded(Kopete::MetaContact *mc)
void StatisticsPlugin::slotDelayedMetaContactAdded(Kopete::MetaContact *mc, Kopete::OnlineStatus::StatusType status)
{
if (status != Kopete::OnlineStatus::Unknown) {
disconnect(mc, SIGNAL(onlineStatusChanged(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)), this,
SLOT(slotDelayedMetaContactAdded(Kopete::MetaContact *,Kopete::OnlineStatus::StatusType)));
disconnect(mc, &Kopete::MetaContact::onlineStatusChanged, this, &StatisticsPlugin::slotDelayedMetaContactAdded);
slotMetaContactAdded(mc);
slotOnlineStatusChanged(mc, status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment