Commit 391cd520 authored by Shashwat Jolly's avatar Shashwat Jolly
Browse files

Merge branch 'master' of https://invent.kde.org/pim/kdepim-runtime into etesyncResource

parents 75dba6e0 486384be
......@@ -48,7 +48,7 @@ set(KDEPIM_RUNTIME_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}${KDEPIM_DEV_VERSION
configure_file(kdepim-runtime-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-runtime-version.h @ONLY)
set(KF5_MIN_VERSION "5.72.0")
set(KF5_MIN_VERSION "5.73.0")
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${kdepim-runtime_SOURCE_DIR}/cmake/ ${ECM_MODULE_PATH})
......@@ -149,7 +149,7 @@ option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE)
option(NO_REGENERATE_MIME "Don't regenerate mime file (developer-only option)" FALSE )
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054900)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
add_definitions(-DQT_NO_EMIT)
......
The KDE project kdepim-runtime contains the Akonadi resources from kdepim which can be used without the applications in kdepim.
Here is the online code-repostitory of kdepim-runtime: https://cgit.kde.org/kdepim-runtime.git/log/
Here is the online code-repository of kdepim-runtime: https://invent.kde.org/pim/kdepim-runtime
......@@ -300,7 +300,7 @@ KCalendarCore::Event::Ptr BirthdaysResource::createAnniversary(const Akonadi::It
return KCalendarCore::Event::Ptr();
}
KCalendarCore::Event::Ptr BirthdaysResource::createEvent(const QDate &date)
KCalendarCore::Event::Ptr BirthdaysResource::createEvent(QDate date)
{
Event::Ptr event(new Event());
event->setDtStart(QDateTime(date, {}));
......
......@@ -38,7 +38,7 @@ private:
KCalendarCore::Event::Ptr createBirthday(const Akonadi::Item &contactItem);
KCalendarCore::Event::Ptr createAnniversary(const Akonadi::Item &contactItem);
KCalendarCore::Event::Ptr createEvent(const QDate &date);
KCalendarCore::Event::Ptr createEvent(QDate date);
private Q_SLOTS:
void doFullSearch();
......
......@@ -65,9 +65,10 @@ void DavFreeBusyHandler::retrieveFreeBusy(const QString &email, const QDateTime
fb->addAttendee(att);
KCalendarCore::ICalFormat formatter;
QByteArray fbData = formatter.createScheduleMessage(fb, KCalendarCore::iTIPRequest).toUtf8();
const QByteArray fbData = formatter.createScheduleMessage(fb, KCalendarCore::iTIPRequest).toUtf8();
foreach (const QString &outbox, mPrincipalScheduleOutbox[email]) {
const QStringList principalScheduleOutboxFromEmail = mPrincipalScheduleOutbox[email];
for (const QString &outbox : principalScheduleOutboxFromEmail) {
++mRequestsTracker[email].retrievalJobCount;
uint requestId = mNextRequestId++;
......
......@@ -201,10 +201,10 @@ KDAV::DavUrl Settings::davUrlFromCollectionUrl(const QString &collectionUrl, con
}
KDAV::DavUrl davUrl;
QString targetUrl = finalUrl.isEmpty() ? collectionUrl : finalUrl;
const QString targetUrl = finalUrl.isEmpty() ? collectionUrl : finalUrl;
if (mCollectionsUrlsMapping.contains(collectionUrl)) {
QStringList split = mCollectionsUrlsMapping[ collectionUrl ].split(QLatin1Char(','));
const QStringList split = mCollectionsUrlsMapping.value(collectionUrl).split(QLatin1Char(','));
if (split.size() == 2) {
davUrl = configuredDavUrl(KDAV::ProtocolInfo::protocolByName(split.at(1)), split.at(0), targetUrl);
}
......@@ -219,7 +219,7 @@ void Settings::addCollectionUrlMapping(KDAV::Protocol proto, const QString &coll
loadMappings();
}
QString value = configuredUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString value = configuredUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
mCollectionsUrlsMapping.insert(collectionUrl, value);
// Update the cache now
......@@ -244,7 +244,7 @@ QStringList Settings::mappedCollections(KDAV::Protocol proto, const QString &con
loadMappings();
}
QString value = configuredUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString value = configuredUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
return mCollectionsUrlsMapping.keys(value);
}
......@@ -257,7 +257,7 @@ void Settings::reloadConfig()
void Settings::newUrlConfiguration(Settings::UrlConfiguration *urlConfig)
{
QString key = urlConfig->mUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(KDAV::Protocol(urlConfig->mProtocol));
const QString key = urlConfig->mUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(KDAV::Protocol(urlConfig->mProtocol));
if (mUrls.contains(key)) {
removeUrlConfiguration(KDAV::Protocol(urlConfig->mProtocol), urlConfig->mUrl);
......@@ -272,7 +272,7 @@ void Settings::newUrlConfiguration(Settings::UrlConfiguration *urlConfig)
void Settings::removeUrlConfiguration(KDAV::Protocol proto, const QString &url)
{
QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
if (!mUrls.contains(key)) {
return;
......@@ -285,7 +285,7 @@ void Settings::removeUrlConfiguration(KDAV::Protocol proto, const QString &url)
Settings::UrlConfiguration *Settings::urlConfiguration(KDAV::Protocol proto, const QString &url)
{
QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
UrlConfiguration *ret = nullptr;
if (mUrls.contains(key)) {
......@@ -305,7 +305,7 @@ Settings::UrlConfiguration *Settings::urlConfiguration(KDAV::Protocol proto, con
QString Settings::username(KDAV::Protocol proto, const QString &url) const
{
QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
if (mUrls.contains(key)) {
if (mUrls[ key ]->mUser == QLatin1String("$default$")) {
......@@ -320,7 +320,7 @@ QString Settings::username(KDAV::Protocol proto, const QString &url) const
QString Settings::password(KDAV::Protocol proto, const QString &url)
{
QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
const QString key = url + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(proto);
if (mUrls.contains(key)) {
if (mUrls[ key ]->mUser == QLatin1String("$default$")) {
......@@ -356,8 +356,8 @@ void Settings::buildUrlsList()
{
foreach (const QString &serializedUrl, remoteUrls()) {
UrlConfiguration *urlConfig = new UrlConfiguration(serializedUrl);
QString key = urlConfig->mUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(KDAV::Protocol(urlConfig->mProtocol));
QString pass = loadPassword(key, urlConfig->mUser);
const QString key = urlConfig->mUrl + QLatin1Char(',') + KDAV::ProtocolInfo::protocolName(KDAV::Protocol(urlConfig->mProtocol));
const QString pass = loadPassword(key, urlConfig->mUser);
if (!pass.isNull()) {
urlConfig->mPassword = pass;
mUrls[ key ] = urlConfig;
......@@ -369,7 +369,7 @@ void Settings::buildUrlsList()
void Settings::loadMappings()
{
QString collectionsMappingCacheBase = QStringLiteral("akonadi-davgroupware/%1_c2u.dat").arg(QCoreApplication::applicationName());
const QString collectionsMappingCacheBase = QStringLiteral("akonadi-davgroupware/%1_c2u.dat").arg(QCoreApplication::applicationName());
mCollectionsUrlsMappingCache = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + collectionsMappingCacheBase;
QFile collectionsMappingsCache(mCollectionsUrlsMappingCache);
......@@ -403,7 +403,7 @@ void Settings::updateRemoteUrls()
void Settings::savePassword(const QString &key, const QString &user, const QString &password)
{
QString entry = key + QLatin1Char(',') + user;
const QString entry = key + QLatin1Char(',') + user;
mPasswordsCache[entry] = password;
KWallet::Wallet *wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), mWinId);
......@@ -515,7 +515,7 @@ void Settings::updateToV2()
return;
}
QString urlConfigStr = urls.at(0);
const QString urlConfigStr = urls.at(0);
UrlConfiguration urlConfig(urlConfigStr);
const QRegularExpression regexp(QStringLiteral("^") + urlConfig.mUser);
......@@ -544,7 +544,7 @@ void Settings::updateToV3()
QStringList splitUrl = url.split(QLatin1Char('|'));
if (splitUrl.size() == 3) {
KDAV::Protocol protocol = Utils::protocolByTranslatedName(splitUrl.at(1));
const KDAV::Protocol protocol = Utils::protocolByTranslatedName(splitUrl.at(1));
splitUrl[1] = KDAV::ProtocolInfo::protocolName(protocol);
updatedUrls << splitUrl.join(QLatin1Char('|'));
}
......
......@@ -137,7 +137,8 @@ QByteArray EwsPKeyAuthJob::buildAuthResponse(const QMap<QString, QString> &param
}
QCA::Certificate cert;
for (const auto &c : certs.certificates()) {
const auto certificates = certs.certificates();
for (const auto &c : certificates) {
if (c.issuerInfo() == authoritiesInfo) {
cert = c;
break;
......
......@@ -20,7 +20,7 @@ class QXmlStreamReader;
class EwsAttendee
{
public:
typedef QList<EwsAttendee> List;
typedef QVector<EwsAttendee> List;
EwsAttendee();
explicit EwsAttendee(QXmlStreamReader &reader);
......
......@@ -123,7 +123,7 @@ EwsSubscribeRequest::Response::Response(QXmlStreamReader &reader)
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != ewsMsgNsUri && reader.namespaceUri() != ewsTypeNsUri) {
setErrorMsg(QStringLiteral("Unexpected namespace in %1 element: %2")
.arg(QStringLiteral("ResponseMessage")).arg(reader.namespaceUri().toString()));
.arg(QStringLiteral("ResponseMessage"), reader.namespaceUri().toString()));
return;
}
......
......@@ -29,7 +29,7 @@ public:
class Change
{
public:
typedef QList<Change> List;
typedef QVector<Change> List;
ChangeType type() const
{
......
......@@ -144,10 +144,10 @@ EwsConfigDialog::EwsConfigDialog(EwsResource *parentResource, EwsClient &client,
QIcon ewsIcon = QIcon::fromTheme(QStringLiteral("akonadi-ews"));
mUi->aboutIconLabel->setPixmap(ewsIcon.pixmap(96, 96, QIcon::Normal, QIcon::On));
mUi->aboutTextLabel->setText(i18nc("@info", "Akonadi Resource for Microsoft Exchange Web Services (EWS)"));
mUi->aboutCopyrightLabel->setText(i18nc("@info", "Copyright (c) Krzysztof Nowicki 2015-2017"));
mUi->aboutCopyrightLabel->setText(i18nc("@info", "Copyright (c) Krzysztof Nowicki 2015-2020"));
mUi->aboutVersionLabel->setText(i18nc("@info", "Version %1", QStringLiteral(AKONADI_EWS_VERSION)));
mUi->aboutLicenseLabel->setText(i18nc("@info", "Distributed under the GNU Library General Public License version 2.0 or later."));
mUi->aboutUrlLabel->setText(QStringLiteral("<a href=\"https://github.com/KrissN/akonadi-ews\">https://github.com/KrissN/akonadi-ews</a>"));
mUi->aboutUrlLabel->setText(QStringLiteral("<a href=\"https://invent.kde.org/pim/kdepim-runtime/-/tree/master/resources/ews\">https://invent.kde.org/pim/kdepim-runtime/-/tree/master/resources/ews</a>"));
mUi->pkeyAuthCert->setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
mUi->pkeyAuthKey->setMode(KFile::File | KFile::ExistingOnly | KFile::LocalOnly);
......
......@@ -7,7 +7,6 @@
#ifndef EWSMTARESOURCE_H
#define EWSMTARESOURCE_H
#include <akonadi_version.h>
#include <AkonadiAgentBase/ResourceBase>
#include <AkonadiAgentBase/TransportResourceBase>
#include <AkonadiCore/Item>
......
......@@ -11,7 +11,6 @@
#include <AkonadiAgentBase/ResourceBase>
#include <AkonadiAgentBase/TransportResourceBase>
#include <akonadi_version.h>
#include "ewsclient.h"
#include "ewsfetchitemsjob.h"
......
......@@ -400,7 +400,7 @@ void ContactHandler::itemsLinked(const Item::List &items, const Collection &coll
ContactsList contacts;
contacts.reserve(items.count());
std::transform(items.cbegin(), items.cend(), std::back_inserter(contacts),
[this, &collection](const Item &item){
[&collection](const Item &item){
ContactPtr contact(new Contact(item.payload<KContacts::Addressee>()));
contact->addGroup(collection.remoteId());
return contact;
......
......@@ -273,6 +273,15 @@ void SessionPool::cancelSessionCreation(KIMAP::Session *session, int errorCode,
void SessionPool::processPendingRequests()
{
if (!m_account) {
// The connection to the server is lost; no point processing pending requests
for (int request : qAsConst(m_pendingRequests)) {
Q_EMIT sessionRequestDone(request, nullptr,
LoginFailError, i18n("Disconnected from server during login."));
}
return;
}
if (!m_unusedPool.isEmpty()) {
// We have a session ready to give out
KIMAP::Session *session = m_unusedPool.takeFirst();
......
......@@ -154,7 +154,7 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
m_ui->checkInterval->setSingleStep(1);
// regex for evaluating a valid server name/ip
mValidator.setRegExp(QRegExp(QLatin1String("[A-Za-z0-9-_:.]*")));
mValidator.setRegularExpression(QRegularExpression(QStringLiteral("[A-Za-z0-9_:.-]*")));
m_ui->imapServer->setValidator(&mValidator);
m_ui->folderRequester->setMimeTypeFilter(
......
......@@ -14,7 +14,7 @@
#include <collection.h>
#include <KJob>
#include <QRegExpValidator>
#include <QRegularExpressionValidator>
class QPushButton;
class QComboBox;
namespace Ui {
......@@ -76,7 +76,7 @@ private:
QString m_vacationFileName;
KIdentityManagement::IdentityCombo *m_identityCombobox = nullptr;
QString m_oldResourceName;
QRegExpValidator mValidator;
QRegularExpressionValidator mValidator;
Akonadi::Collection mOldTrash;
FolderArchiveSettingPage *m_folderArchiveSettingPage = nullptr;
QPushButton *mOkButton = nullptr;
......
......@@ -489,12 +489,12 @@ Kolab::RecurrenceRule::Frequency fromRecurrenceType(KCalendarCore::RecurrenceRul
return Kolab::RecurrenceRule::FreqNone;
}
KCalendarCore::RecurrenceRule::WDayPos toWeekDayPos(const Kolab::DayPos &dp)
KCalendarCore::RecurrenceRule::WDayPos toWeekDayPos(Kolab::DayPos dp)
{
return KCalendarCore::RecurrenceRule::WDayPos(dp.occurence(), toWeekDay(dp.weekday()));
}
Kolab::DayPos fromWeekDayPos(const KCalendarCore::RecurrenceRule::WDayPos &dp)
Kolab::DayPos fromWeekDayPos(KCalendarCore::RecurrenceRule::WDayPos dp)
{
return Kolab::DayPos(dp.pos(), fromWeekDay(dp.day()));
}
......
......@@ -5,7 +5,7 @@
*/
#include "timezoneconverter.h"
#include <QRegExp>
#include <QRegularExpression>
#include <QTimeZone>
#include "pimkolab_debug.h"
......@@ -46,14 +46,11 @@ QString TimezoneConverter::fromCityName(const QString &tz)
countryMap.insert(cityName, QString::fromUtf8(zone));
}
QRegExp locationFinder(QLatin1String("\\b([a-zA-Z])+\\b"), Qt::CaseSensitive, QRegExp::RegExp2);
int pos = 0;
while (pos >= 0) {
pos = locationFinder.indexIn(tz, pos);
if (pos >= 0) {
++pos;
}
const QString location = locationFinder.capturedTexts().first();
const QRegularExpression locationFinder(QStringLiteral("\\b([a-zA-Z])+\\b"));
QRegularExpressionMatchIterator iter = locationFinder.globalMatch(tz);
while (iter.hasNext()) {
QRegularExpressionMatch match = iter.next();
const QString location = match.captured(0);
qCDebug(PIMKOLAB_LOG) << "location " << location;
if (countryMap.contains(location)) {
qCDebug(PIMKOLAB_LOG) << "found match " << countryMap.value(location);
......
......@@ -54,6 +54,7 @@ void getAttachments(KCalendarCore::Incidence::Ptr incidence, const QStringList &
template<typename IncidencePtr, typename Converter>
static inline IncidencePtr incidenceFromKolabImpl(const KMime::Message::Ptr &data, const QByteArray &mimetype, const QString &timezoneId)
{
Q_UNUSED(timezoneId)
KMime::Content *xmlContent = Mime::findContentByType(data, mimetype);
if (!xmlContent) {
Critical() << "couldn't find part";
......
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