summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Krishnavanshi <[email protected]>2017-08-26 12:50:08 +0530
committerPali Roh├ír <[email protected]>2017-12-22 09:10:31 +0100
commit8f128012564d44b94923bbfc1649582df0150a75 (patch)
tree4e404b445d308556f1f7013958ef364cdad872ad
parent522df83279641e1526c3315f1cd15608de109fe7 (diff)
Adapted solts and signals of highlight plugin to Qt5
-rw-r--r--plugins/highlight/highlightconfig.cpp4
-rw-r--r--plugins/statistics/statisticsdialog.cpp4
-rw-r--r--plugins/statistics/statisticsplugin.cpp26
3 files changed, 13 insertions, 21 deletions
diff --git a/plugins/highlight/highlightconfig.cpp b/plugins/highlight/highlightconfig.cpp
index 707983c..ff78da8 100644
--- a/plugins/highlight/highlightconfig.cpp
+++ b/plugins/highlight/highlightconfig.cpp
@@ -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)) {
diff --git a/plugins/statistics/statisticsdialog.cpp b/plugins/statistics/statisticsdialog.cpp
index 4075ebd..01ec637 100644
--- a/plugins/statistics/statisticsdialog.cpp
+++ b/plugins/statistics/statisticsdialog.cpp
@@ -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);
diff --git a/plugins/statistics/statisticsplugin.cpp b/plugins/statistics/statisticsplugin.cpp
index a0e0971..b25a094 100644
--- a/plugins/statistics/statisticsplugin.cpp
+++ b/plugins/statistics/statisticsplugin.cpp
@@ -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);