Commit 2675dd32 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Port all Frameworks away from KPimUtils

All KPimUtils code used from various kdepimlibs Frameworks has been moved
to KCoreAddons or KCodecs, so we are now KPimUtils-free.
parent 183ec6cf
......@@ -38,10 +38,10 @@ find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Emoticons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${KIdentityManagement_SOURCE_DIR}")
find_package(KF5PimTextEdit ${KDEPIMLIBS_VERSION} CONFIG REQUIRED)
find_package(KF5PimUtils ${KDEPIMLIBS_VERSION} CONFIG REQUIRED)
endif()
add_definitions(-DTRANSLATION_DOMAIN=\"libkpimidentities5\")
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
......
......@@ -22,7 +22,7 @@ PUBLIC
KF5::CoreAddons
KF5::PimTextEdit
PRIVATE
KF5::PimUtils
KF5::Codecs
Qt5::Network
KF5::Completion
KF5::I18n
......
......@@ -23,7 +23,7 @@
#include <qdebug.h>
#include <kconfiggroup.h>
#include <kpimutils/email.h>
#include <kemailaddress.h>
#include <QMimeData>
#include <QByteArray>
......@@ -643,7 +643,7 @@ void Identity::setSignature(const Signature &sig)
bool Identity::matchesEmailAddress(const QString &addr) const
{
const QString addrSpec = KPIMUtils::extractEmailAddress(addr).toLower();
const QString addrSpec = KEmailAddress::extractEmailAddress(addr).toLower();
if (addrSpec == primaryEmailAddress().toLower()) {
return true;
}
......
......@@ -23,7 +23,7 @@ static const char configKeyDefaultIdentity[] = "Default Identity";
#include "identitymanager.h"
#include "identity.h" // for IdentityList::{export,import}Data
#include <kpimutils/email.h> // for static helper functions
#include <kemailaddress.h> // for static helper functions
#include <kemailsettings.h> // for IdentityEntry::fromControlCenter()
#include <klocalizedstring.h>
......@@ -518,9 +518,9 @@ const Identity &IdentityManager::identityForUoidOrDefault(uint uoid) const
const Identity &IdentityManager::identityForAddress(
const QString &addresses) const
{
const QStringList addressList = KPIMUtils::splitAddressList(addresses);
const QStringList addressList = KEmailAddress::splitAddressList(addresses);
foreach (const QString &fullAddress, addressList) {
const QString addrSpec = KPIMUtils::extractEmailAddress(fullAddress).toLower();
const QString addrSpec = KEmailAddress::extractEmailAddress(fullAddress).toLower();
for (ConstIterator it = begin(); it != end(); ++it) {
const Identity &identity = *it;
if (identity.matchesEmailAddress(addrSpec)) {
......
......@@ -28,7 +28,6 @@
#include <QUrl>
#include <kprocess.h>
#include <KRichTextEdit>
#include <kpimutils/kfileio.h>
#include <QFileInfo>
#include <QSharedPointer>
......@@ -261,7 +260,12 @@ QString Signature::Private::textFromFile(bool *ok) const
}
// TODO: hmm, should we allow other encodings, too?
const QByteArray ba = KPIMUtils::kFileToByteArray(url, false);
QFile f(url);
if (!f.open(QIODevice::ReadOnly)) {
qWarning() << "Failed to open" << url << ":" << f.errorString();
return QString();
}
const QByteArray ba = f.readAll();
return QString::fromLocal8Bit(ba.data(), ba.size());
}
......
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