diff --git a/plugins/highlight/highlightconfig.cpp b/plugins/highlight/highlightconfig.cpp --- a/plugins/highlight/highlightconfig.cpp +++ b/plugins/highlight/highlightconfig.cpp @@ -77,7 +77,7 @@ { 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::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.h b/plugins/statistics/statisticsdialog.h --- a/plugins/statistics/statisticsdialog.h +++ b/plugins/statistics/statisticsdialog.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include "kopetemetacontact.h" class QStringList; @@ -89,7 +89,7 @@ * We manage the openUrlRequestDelayed signal from the generalHTMLPart->browserExtension() in order to * generate requested pages on the fly. */ - void slotOpenURLRequest(const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &); + void slotOpenURLRequest(const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &); /** * Color the calendar cells to show statuses across entire months diff --git a/plugins/statistics/statisticsdialog.cpp b/plugins/statistics/statisticsdialog.cpp --- a/plugins/statistics/statisticsdialog.cpp +++ b/plugins/statistics/statisticsdialog.cpp @@ -56,8 +56,7 @@ KHBox *generalHBox = new KHBox(this); generalHTMLPart = new KHTMLPart(generalHBox); - connect(generalHTMLPart->browserExtension(), SIGNAL(openUrlRequestDelayed(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), - this, SLOT(slotOpenURLRequest(KUrl,KParts::OpenUrlArguments,KParts::BrowserArguments))); + connect(generalHTMLPart->browserExtension(), &KParts::BrowserExtension::openUrlRequestDelayed, this, &StatisticsDialog::slotOpenURLRequest); generalHTMLPart->setJScriptEnabled(false); generalHTMLPart->setJavaEnabled(false); generalHTMLPart->setMetaRefreshEnabled(false); @@ -91,8 +90,8 @@ 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); @@ -108,13 +107,13 @@ } // We only generate pages when the user clicks on a link -void StatisticsDialog::slotOpenURLRequest(const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &) +void StatisticsDialog::slotOpenURLRequest(const QUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &) { - if (url.protocol() == QLatin1String("main")) { + if (url.scheme() == QLatin1String("main")) { generatePageGeneral(); - } else if (url.protocol() == QLatin1String("dayofweek")) { + } else if (url.scheme() == QLatin1String("dayofweek")) { generatePageForDay(url.path().toInt()); - } else if (url.protocol() == QLatin1String("monthofyear")) { + } else if (url.scheme() == QLatin1String("monthofyear")) { generatePageForMonth(url.path().toInt()); } } diff --git a/plugins/statistics/statisticsplugin.cpp b/plugins/statistics/statisticsplugin.cpp --- a/plugins/statistics/statisticsplugin.cpp +++ b/plugins/statistics/statisticsplugin.cpp @@ -60,20 +60,15 @@ 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 @@ 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::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::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);