diff -Nru kidentitymanagement-15.12.3/autotests/identitytest.cpp kidentitymanagement-16.04.3/autotests/identitytest.cpp --- kidentitymanagement-15.12.3/autotests/identitytest.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/autotests/identitytest.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -36,7 +36,6 @@ QStandardPaths::setTestModeEnabled(true); } - void IdentityTester::test_NullIdentity() { IdentityManager manager; @@ -49,7 +48,7 @@ // It is picking up identities from older tests somethimes, so cleanup while (manager.identities().size() > 1) { - manager.removeIdentity(manager.identities().first()); + manager.removeIdentity(manager.identities().at(0)); manager.commit(); } @@ -74,7 +73,7 @@ manager.commit(); // Remove the first identity, which we couldn't remove above - manager.removeIdentity(manager.identities().first()); + manager.removeIdentity(manager.identities().at(0)); manager.commit(); QCOMPARE(manager.allEmails().size(), 4); diff -Nru kidentitymanagement-15.12.3/autotests/identitytest.h kidentitymanagement-16.04.3/autotests/identitytest.h --- kidentitymanagement-15.12.3/autotests/identitytest.h 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/autotests/identitytest.h 2016-06-15 04:38:47.000000000 +0000 @@ -24,7 +24,7 @@ class IdentityTester : public QObject { - Q_OBJECT + Q_OBJECT private Q_SLOTS: void initTestCase(); diff -Nru kidentitymanagement-15.12.3/autotests/signaturetest.cpp kidentitymanagement-16.04.3/autotests/signaturetest.cpp --- kidentitymanagement-15.12.3/autotests/signaturetest.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/autotests/signaturetest.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -25,7 +25,6 @@ #include "signature.h" - #include #include #include @@ -65,7 +64,7 @@ QString fileContent = QString::fromUtf8(thisFile.readAll()); Signature sig3; - sig3.setUrl(QStringLiteral("cat ") + QStringLiteral(__FILE__), true); + sig3.setPath(QStringLiteral("cat ") + QStringLiteral(__FILE__), true); QCOMPARE(sig3.rawText(), fileContent); QVERIFY(!sig3.isInlinedHtml()); QVERIFY(sig3.text().isEmpty()); @@ -73,7 +72,7 @@ QCOMPARE(sig3.withSeparator(), QString(QStringLiteral("-- \n") + fileContent)); Signature sig4; - sig4.setUrl(QStringLiteral(__FILE__), false); + sig4.setPath(QStringLiteral(__FILE__), false); QCOMPARE(sig4.rawText(), fileContent); QVERIFY(!sig4.isInlinedHtml()); QVERIFY(sig4.text().isEmpty()); @@ -188,9 +187,9 @@ QImage image1, image2; QVERIFY(image1.load(image1Path)); QVERIFY(image2.load(image1Path)); - QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QStringLiteral("emailidentities/unittest/") ; + QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QStringLiteral("emailidentities/unittest/"); QDir().mkpath(path); - QString configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + QStringLiteral("signaturetest") ; + QString configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + QStringLiteral("signaturetest"); QDir().mkpath(configPath); KConfig config(configPath); KConfigGroup group1 = config.group("Signature1"); diff -Nru kidentitymanagement-15.12.3/CMakeLists.txt kidentitymanagement-16.04.3/CMakeLists.txt --- kidentitymanagement-15.12.3/CMakeLists.txt 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/CMakeLists.txt 2016-06-15 04:38:47.000000000 +0000 @@ -3,7 +3,7 @@ project(KIdentityManagement) # ECM setup -find_package(ECM 5.16.0 CONFIG REQUIRED) +find_package(ECM 5.19.0 CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(GenerateExportHeader) @@ -14,12 +14,12 @@ include(FeatureSummary) include(KDEInstallDirs) include(KDECMakeSettings) -include(KDEFrameworkCompilerSettings) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMQtDeclareLoggingCategory) -set(KF5_VERSION "5.16.0") -set(KIDENTITYMANAGEMENT_LIB_VERSION "4.82.0") -set(PIMTEXTEDIT_LIB_VERSION "4.86.0") +set(KF5_VERSION "5.19.0") +set(KIDENTITYMANAGEMENT_LIB_VERSION "5.2.3") +set(PIMTEXTEDIT_LIB_VERSION "5.2.0") ecm_setup_version(${KIDENTITYMANAGEMENT_LIB_VERSION} VARIABLE_PREFIX KIDENTITYMANAGEMENT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kidentitymanagement_version.h" diff -Nru kidentitymanagement-15.12.3/debian/changelog kidentitymanagement-16.04.3/debian/changelog --- kidentitymanagement-15.12.3/debian/changelog 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/changelog 2016-09-30 04:47:00.000000000 +0000 @@ -1,3 +1,24 @@ +kidentitymanagement (16.04.3-0ubuntu1) yakkety; urgency=medium + + [ Scarlett Clark ] + * New upstream release + + [ Philip Muškovac ] + * Update the Vcs URLs now that the repositories are hosted on + Launchpad + + [ Scarlett Clark ] + * BUmp dep versions. + * Bump SO version install file. + * New upstream bugfix release + * Refresh symbols. MISSING removed, rebuilds are necessary. + + [ Clive Johnston ] + * New upstream release (16.04.2) + * New upstream release (16.04.3) + + -- José Manuel Santamaría Lema Fri, 30 Sep 2016 06:47:00 +0200 + kidentitymanagement (15.12.3-0ubuntu1) xenial; urgency=medium * New upstream bugfix release @@ -13,11 +34,18 @@ -- Scarlett Clark Wed, 09 Mar 2016 10:45:46 +0100 -kidentitymanagement (15.12.0-1~) UNRELEASED; urgency=medium +kidentitymanagement (15.12.0-2) experimental; urgency=medium + + * Update build dependencies to follow the package version instead of + the libraries soversions. + + -- Maximiliano Curia Wed, 10 Feb 2016 21:27:21 +0100 + +kidentitymanagement (15.12.0-1) experimental; urgency=medium * New upstream release (15.12.0). - -- Maximiliano Curia Wed, 16 Dec 2015 16:22:00 +0100 + -- Maximiliano Curia Mon, 01 Feb 2016 10:24:29 +0100 kidentitymanagement (15.12.0-0ubuntu1) UNRELEASED; urgency=medium diff -Nru kidentitymanagement-15.12.3/debian/control kidentitymanagement-16.04.3/debian/control --- kidentitymanagement-15.12.3/debian/control 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/control 2016-09-30 04:47:00.000000000 +0000 @@ -5,32 +5,32 @@ Uploaders: Maximiliano Curia Build-Depends: cmake (>= 2.8.12~), debhelper (>= 9), - extra-cmake-modules (>= 5.16.0~), - kio-dev (>= 5.16.0~), - libkf5codecs-dev (>= 5.16.0~), - libkf5completion-dev (>= 5.16.0~), - libkf5config-dev (>= 5.16.0~), - libkf5coreaddons-dev (>= 5.16.0~), - libkf5emoticons-dev (>= 5.16.0~), - libkf5iconthemes-dev (>= 5.16.0~), - libkf5kdelibs4support-dev (>= 5.12.0~), - libkf5pimtextedit-dev (>= 15.12.1~), - libkf5textwidgets-dev (>= 5.16.0~), - libkf5xmlgui-dev (>= 5.16.0~), + extra-cmake-modules (>= 5.24.0~), + kio-dev (>= 5.24.0~), + libkf5codecs-dev (>= 5.24.0~), + libkf5completion-dev (>= 5.24.0~), + libkf5config-dev (>= 5.24.0~), + libkf5coreaddons-dev (>= 5.24.0~), + libkf5emoticons-dev (>= 5.24.0~), + libkf5iconthemes-dev (>= 5.24.0~), + libkf5kdelibs4support-dev (>= 5.24.0~), + libkf5pimtextedit-dev (>= 16.04.3~), + libkf5textwidgets-dev (>= 5.24.0~), + libkf5xmlgui-dev (>= 5.24.0~), pkg-kde-tools (>> 0.15.15), - qtbase5-dev (>= 5.2.0) + qtbase5-dev (>= 5.6.1~) Standards-Version: 3.9.6 Homepage: https://projects.kde.org/projects/kde/pim/kidentitymanagement -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/applications/kidentitymanagement.git -Vcs-Git: git://anonscm.debian.org/pkg-kde/applications/kidentitymanagement.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kidentitymanagement +Vcs-Git: git://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/kidentitymanagement Package: libkf5identitymanagement-dev Section: libdevel Architecture: any Multi-Arch: foreign -Depends: libkf5coreaddons-dev (>= 5.16.0~), +Depends: libkf5coreaddons-dev (>= 5.21.0~), libkf5identitymanagement5 (= ${binary:Version}), - libkf5pimtextedit-dev (>= 4.86.0~), + libkf5pimtextedit-dev (>= 16.04.3~), ${misc:Depends} Description: library for managing user identities - development files This library provides an API for managing user identities. @@ -45,14 +45,3 @@ This library provides an API for managing user identities. . This package is part of the KDE Development Platform PIM libraries module. - -Package: libkf5identitymanagement-dbg -Architecture: any -Multi-Arch: same -Depends: libkf5identitymanagement5 (= ${binary:Version}), ${misc:Depends} -Description: library for managing user identities - debug symbols - This library provides an API for managing user identities. - . - This package contains the debug symbols. -Section: debug -Priority: extra diff -Nru kidentitymanagement-15.12.3/debian/libkf5identitymanagement5.install kidentitymanagement-16.04.3/debian/libkf5identitymanagement5.install --- kidentitymanagement-15.12.3/debian/libkf5identitymanagement5.install 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/libkf5identitymanagement5.install 2016-09-30 04:47:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/*/libKF5IdentityManagement.so.4.* +usr/lib/*/libKF5IdentityManagement.so.5.* usr/lib/*/libKF5IdentityManagement.so.5 diff -Nru kidentitymanagement-15.12.3/debian/libkf5identitymanagement5.symbols kidentitymanagement-16.04.3/debian/libkf5identitymanagement5.symbols --- kidentitymanagement-15.12.3/debian/libkf5identitymanagement5.symbols 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/libkf5identitymanagement5.symbols 2016-09-30 04:47:00.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 15.12.0 amd64 +# SymbolsHelper-Confirmed: 16.04.1 amd64 i386 libKF5IdentityManagement.so.5 libkf5identitymanagement5 #MINVER# (optional=templinst)_ZN12KConfigGroup10writeEntryIbEEvPKcRKT_6QFlagsIN11KConfigBase15WriteConfigFlagEE@Base 15.07.90 _ZN19KIdentityManagement13IdentityCombo11qt_metacallEN11QMetaObject4CallEiPPv@Base 15.07.90 @@ -109,7 +109,7 @@ _ZN19KIdentityManagement9Signature16setImageLocationERK7QString@Base 15.07.90 _ZN19KIdentityManagement9Signature17setEmbeddedImagesERK5QListI14QSharedPointerINS0_13EmbeddedImageEEE@Base 15.07.90 _ZN19KIdentityManagement9Signature19setEnabledSignatureEb@Base 15.07.90 - _ZN19KIdentityManagement9Signature6setUrlERK7QStringb@Base 15.07.90 + _ZN19KIdentityManagement9Signature7setPathERK7QStringb@Base 16.04.1 _ZN19KIdentityManagement9Signature7setTextERK7QString@Base 15.07.90 _ZN19KIdentityManagement9Signature7setTypeENS0_4TypeE@Base 15.07.90 _ZN19KIdentityManagement9Signature8addImageERK6QImageRK7QString@Base 15.07.90 @@ -148,11 +148,11 @@ _ZNK19KIdentityManagement15IdentityManager8isUniqueERK7QString@Base 15.07.90 _ZNK19KIdentityManagement15IdentityManager8thatIsMeERK7QString@Base 15.07.90 _ZNK19KIdentityManagement15IdentityManager9allEmailsEv@Base 15.07.90 - _ZNK19KIdentityManagement21SignatureConfigurator10commandURLEv@Base 15.07.90 _ZNK19KIdentityManagement21SignatureConfigurator10metaObjectEv@Base 15.07.90 + _ZNK19KIdentityManagement21SignatureConfigurator11commandPathEv@Base 16.04.1 _ZNK19KIdentityManagement21SignatureConfigurator13signatureTypeEv@Base 15.07.90 _ZNK19KIdentityManagement21SignatureConfigurator18isSignatureEnabledEv@Base 15.07.90 - _ZNK19KIdentityManagement21SignatureConfigurator7fileURLEv@Base 15.07.90 + _ZNK19KIdentityManagement21SignatureConfigurator8filePathEv@Base 16.04.1 _ZNK19KIdentityManagement21SignatureConfigurator9signatureEv@Base 15.07.90 _ZNK19KIdentityManagement8Identity10dictionaryEv@Base 15.07.90 _ZNK19KIdentityManagement8Identity11attachVcardEv@Base 15.07.90 @@ -212,7 +212,7 @@ _ZNK19KIdentityManagement9Signature14embeddedImagesEv@Base 15.07.90 _ZNK19KIdentityManagement9Signature18insertIntoTextEditENS0_9PlacementE6QFlagsINS0_13AddedTextFlagEEPN12KPIMTextEdit16RichTextComposerEb@Base 15.12.0 _ZNK19KIdentityManagement9Signature18isEnabledSignatureEv@Base 15.07.90 - _ZNK19KIdentityManagement9Signature3urlEv@Base 15.07.90 + _ZNK19KIdentityManagement9Signature4pathEv@Base 16.04.1 _ZNK19KIdentityManagement9Signature4textEv@Base 15.07.90 _ZNK19KIdentityManagement9Signature4typeEv@Base 15.07.90 _ZNK19KIdentityManagement9Signature7rawTextEPb@Base 15.07.90 diff -Nru kidentitymanagement-15.12.3/debian/rules kidentitymanagement-16.04.3/debian/rules --- kidentitymanagement-15.12.3/debian/rules 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/rules 2016-09-30 04:47:00.000000000 +0000 @@ -3,7 +3,7 @@ include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk override_dh_strip: - $(overridden_command) --dbg-package=libkf5identitymanagement-dbg + $(overridden_command) --ddeb-migration='libkf5identitymanagement-dbg (<= 15.12.0-1~~)' override_dh_auto_test: # Disable auto test at build time, fakeroot breaks them diff -Nru kidentitymanagement-15.12.3/debian/tests/control kidentitymanagement-16.04.3/debian/tests/control --- kidentitymanagement-15.12.3/debian/tests/control 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/tests/control 2016-09-30 04:47:00.000000000 +0000 @@ -1,6 +1,6 @@ Tests: testsuite Depends: @, @builddeps@, build-essential, - dbus-x11, xvfb, xauth, oxygen-icon-theme + dbus-x11, xvfb, xauth, oxygen5-icon-theme, xserver-xephyr Restrictions: build-needed Tests: acc diff -Nru kidentitymanagement-15.12.3/debian/tests/testsuite kidentitymanagement-16.04.3/debian/tests/testsuite --- kidentitymanagement-15.12.3/debian/tests/testsuite 2016-04-14 22:24:37.000000000 +0000 +++ kidentitymanagement-16.04.3/debian/tests/testsuite 2016-09-30 04:47:00.000000000 +0000 @@ -1,4 +1,9 @@ #!/bin/sh xvfb-run -a --server-args="-screen 0 1024x768x24" \ - dbus-launch --exit-with-session dh_auto_test + Xephyr -reset -terminate -br -screen 1024x768 :2 & x_pid=$! + +DISPLAY=:2 dbus-launch --exit-with-session dh_auto_test +ret=$? +kill ${x_pid} +exit $ret diff -Nru kidentitymanagement-15.12.3/src/identity.cpp kidentitymanagement-16.04.3/src/identity.cpp --- kidentitymanagement-15.12.3/src/identity.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/identity.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -479,7 +479,7 @@ QString Identity::signatureFile() const { - return mSignature.url(); + return mSignature.path(); } QString Identity::autocorrectionLanguage() const @@ -566,7 +566,7 @@ void Identity::setSignatureFile(const QString &str) { - mSignature.setUrl(str, signatureIsCommand()); + mSignature.setPath(str, signatureIsCommand()); } void Identity::setSignatureInlineText(const QString &str) diff -Nru kidentitymanagement-15.12.3/src/identitymanager.cpp kidentitymanagement-16.04.3/src/identitymanager.cpp --- kidentitymanagement-15.12.3/src/identitymanager.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/identitymanager.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -29,6 +29,7 @@ #include #include "kidentitymanagement_debug.h" #include +#include #include #include #include @@ -66,6 +67,7 @@ { public: Private(KIdentityManagement::IdentityManager *); + ~Private(); void writeConfig() const; void readConfig(KConfig *config); void createDefaultIdentity(); @@ -288,9 +290,13 @@ : QObject(parent), d(new Private(this)) { - Kdelibs4ConfigMigrator migrate(QStringLiteral("identitymanager")); - migrate.setConfigFiles(QStringList() << QStringLiteral("emailidentities")); - migrate.migrate(); + static bool triedMigration = false; + if (!triedMigration) { + triedMigration = true; + Kdelibs4ConfigMigrator migrate(QStringLiteral("identitymanager")); + migrate.setConfigFiles(QStringList() << QStringLiteral("emailidentities")); + migrate.migrate(); + } setObjectName(QLatin1String(name)); new IdentityManagerAdaptor(this); @@ -312,11 +318,11 @@ commit(); } - KConfig kmailConf(QStringLiteral("kmail2rc")); + KSharedConfig::Ptr kmailConf(KSharedConfig::openConfig(QStringLiteral("kmail2rc"))); if (!d->mReadOnly) { bool needCommit = false; - if (kmailConf.hasGroup(QStringLiteral("Composer"))) { - KConfigGroup composerGroup = kmailConf.group(QStringLiteral("Composer")); + if (kmailConf->hasGroup(QStringLiteral("Composer"))) { + KConfigGroup composerGroup = kmailConf->group(QStringLiteral("Composer")); if (composerGroup.hasKey(QStringLiteral("pgp-auto-sign"))) { const bool pgpAutoSign = composerGroup.readEntry(QStringLiteral("pgp-auto-sign"), false); QList::iterator end = d->mIdentities.end(); @@ -328,8 +334,8 @@ needCommit = true; } } - if (kmailConf.hasGroup(QStringLiteral("General"))) { - KConfigGroup generalGroup = kmailConf.group(QStringLiteral("General")); + if (kmailConf->hasGroup(QStringLiteral("General"))) { + KConfigGroup generalGroup = kmailConf->group(QStringLiteral("General")); if (generalGroup.hasKey(QStringLiteral("Default domain"))) { QString defaultDomain = generalGroup.readEntry(QStringLiteral("Default domain")); if (defaultDomain.isEmpty()) { @@ -696,5 +702,10 @@ rollback(); } +IdentityManager::Private::~Private() +{ + delete mConfig; +} + } #include "moc_identitymanager.cpp" diff -Nru kidentitymanagement-15.12.3/src/signatureconfigurator.cpp kidentitymanagement-16.04.3/src/signatureconfigurator.cpp --- kidentitymanagement-15.12.3/src/signatureconfigurator.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/signatureconfigurator.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -330,7 +330,7 @@ d->mTextEdit->setTextOrHtml(text); } -QString SignatureConfigurator::fileURL() const +QString SignatureConfigurator::filePath() const { QString file = d->mFileRequester->url().path(); @@ -347,7 +347,7 @@ d->mFileRequester->setUrl(QUrl::fromLocalFile(url)); } -QString SignatureConfigurator::commandURL() const +QString SignatureConfigurator::commandPath() const { return d->mCommandEdit->text(); } @@ -376,10 +376,10 @@ } break; case Signature::FromCommand: - sig.setUrl(commandURL(), true); + sig.setPath(commandPath(), true); break; case Signature::FromFile: - sig.setUrl(fileURL(), false); + sig.setPath(filePath(), false); break; case Signature::Disabled: /* do nothing */ @@ -407,13 +407,13 @@ sig.insertIntoTextEdit(KIdentityManagement::Signature::Start, KIdentityManagement::Signature::AddNothing, d->mTextEdit, true); if (sig.type() == Signature::FromFile) { - setFileURL(sig.url()); + setFileURL(sig.path()); } else { setFileURL(QString()); } if (sig.type() == Signature::FromCommand) { - setCommandURL(sig.url()); + setCommandURL(sig.path()); } else { setCommandURL(QString()); } @@ -426,7 +426,7 @@ void SignatureConfigurator::slotEdit() { - QString url = fileURL(); + QString url = filePath(); // slotEnableEditButton should prevent this assert from being hit: assert(!url.isEmpty()); diff -Nru kidentitymanagement-15.12.3/src/signatureconfigurator.h kidentitymanagement-16.04.3/src/signatureconfigurator.h --- kidentitymanagement-15.12.3/src/signatureconfigurator.h 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/signatureconfigurator.h 2016-06-15 04:38:47.000000000 +0000 @@ -90,7 +90,7 @@ * Returns the file url which the user wants * to use as a signature. */ - QString fileURL() const; + QString filePath() const; /** * Set @p url for the file url part of the @@ -102,7 +102,7 @@ * Returns the url of the command which the * users wants to use as signature. */ - QString commandURL() const; + QString commandPath() const; /** * Sets @p url as the command to execute. diff -Nru kidentitymanagement-15.12.3/src/signature.cpp kidentitymanagement-16.04.3/src/signature.cpp --- kidentitymanagement-15.12.3/src/signature.cpp 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/signature.cpp 2016-06-15 04:38:47.000000000 +0000 @@ -64,7 +64,7 @@ /// The directory where the images will be saved to. QString saveLocation; bool enabled; - QString url; + QString path; QString text; Signature::Type type; bool inlinedHtml; @@ -184,7 +184,7 @@ void SignaturePrivate::assignFrom(const KIdentityManagement::Signature &that) { - url = that.url(); + path = that.path(); inlinedHtml = that.isInlinedHtml(); text = that.text(); type = that.type(); @@ -239,13 +239,9 @@ { assert(type == Signature::FromFile); - // TODO: Use KIO::NetAccess to download non-local files! - const QUrl u(url); - if (!u.isLocalFile() && !u.scheme().isEmpty() && - !(QFileInfo(url).isRelative() && - QFileInfo(url).exists())) { - qCDebug(KIDENTITYMANAGEMENT_LOG) << "Signature::textFromFile:" - << "non-local URLs are unsupported"; + QFile f(path); + if (!f.open(QIODevice::ReadOnly)) { + qCWarning(KIDENTITYMANAGEMENT_LOG) << "Failed to open" << path << ":" << f.errorString(); if (ok) { *ok = false; } @@ -255,13 +251,6 @@ if (ok) { *ok = true; } - - // TODO: hmm, should we allow other encodings, too? - QFile f(url); - if (!f.open(QIODevice::ReadOnly)) { - qCWarning(KIDENTITYMANAGEMENT_LOG) << "Failed to open" << url << ":" << f.errorString(); - return QString(); - } const QByteArray ba = f.readAll(); return QString::fromLocal8Bit(ba.data(), ba.size()); } @@ -271,7 +260,7 @@ assert(type == Signature::FromCommand); // handle pathological cases: - if (url.isEmpty()) { + if (path.isEmpty()) { if (ok) { *ok = true; } @@ -281,7 +270,7 @@ // create a shell process: KProcess proc; proc.setOutputChannelMode(KProcess::SeparateChannels); - proc.setShellCommand(url); + proc.setShellCommand(path); int rc = proc.execute(); // handle errors, if any: @@ -290,7 +279,7 @@ *ok = false; } const QString wmsg = i18n("Failed to execute signature script

%1:

" - "

%2

", url, QLatin1String(proc.readAllStandardError())); + "

%2

", path, QLatin1String(proc.readAllStandardError())); KMessageBox::error(Q_NULLPTR, wmsg); return QString(); } @@ -358,11 +347,11 @@ d->text = text; } -Signature::Signature(const QString &url, bool isExecutable) +Signature::Signature(const QString &path, bool isExecutable) : d(new SignaturePrivate(this)) { d->type = isExecutable ? FromCommand : FromFile; - d->url = url; + d->path = path; } Signature::Signature(const Signature &that) @@ -435,9 +424,9 @@ } } -void Signature::setUrl(const QString &url, bool isExecutable) +void Signature::setPath(const QString &path, bool isExecutable) { - d->url = url; + d->path = path; d->type = isExecutable ? FromCommand : FromFile; } @@ -472,10 +461,10 @@ d->inlinedHtml = config.readEntry(sigTypeInlinedHtmlKey, false); } else if (sigType == QLatin1String(sigTypeFileValue)) { d->type = FromFile; - d->url = config.readPathEntry(sigFileKey, QString()); + d->path = config.readPathEntry(sigFileKey, QString()); } else if (sigType == QLatin1String(sigTypeCommandValue)) { d->type = FromCommand; - d->url = config.readPathEntry(sigCommandKey, QString()); + d->path = config.readPathEntry(sigCommandKey, QString()); } else if (sigType == QLatin1String(sigTypeDisabledValue)) { d->enabled = false; } @@ -510,11 +499,11 @@ break; case FromFile: config.writeEntry(sigTypeKey, sigTypeFileValue); - config.writePathEntry(sigFileKey, d->url); + config.writePathEntry(sigFileKey, d->path); break; case FromCommand: config.writeEntry(sigTypeKey, sigTypeCommandValue); - config.writePathEntry(sigCommandKey, d->url); + config.writePathEntry(sigCommandKey, d->path); break; default: break; @@ -548,7 +537,7 @@ QDataStream &KIdentityManagement::operator<< (QDataStream &stream, const KIdentityManagement::Signature &sig) { - return stream << static_cast(sig.type()) << sig.url() << sig.text() + return stream << static_cast(sig.type()) << sig.path() << sig.text() << sig.imageLocation() << sig.embeddedImages() << sig.isEnabledSignature(); } @@ -556,14 +545,14 @@ (QDataStream &stream, KIdentityManagement::Signature &sig) { quint8 s; - QString url; + QString path; QString text; QString saveLocation; QList lst; bool enabled; - stream >> s >> url >> text >> saveLocation >> lst >> enabled; + stream >> s >> path >> text >> saveLocation >> lst >> enabled; sig.setText(text); - sig.setUrl(url); + sig.setPath(path); sig.setImageLocation(saveLocation); sig.setEmbeddedImages(lst); sig.setEnabledSignature(enabled); @@ -595,7 +584,7 @@ return d->text == other.text(); case FromFile: case FromCommand: - return d->url == other.url(); + return d->path == other.path(); default: case Disabled: return true; @@ -642,9 +631,9 @@ return d->text; } -QString Signature::url() const +QString Signature::path() const { - return d->url; + return d->path; } Signature::Type Signature::type() const diff -Nru kidentitymanagement-15.12.3/src/signature.h kidentitymanagement-16.04.3/src/signature.h --- kidentitymanagement-15.12.3/src/signature.h 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/signature.h 2016-06-15 04:38:47.000000000 +0000 @@ -125,7 +125,7 @@ /** Constructor for inline text */ Signature(const QString &text); /** Constructor for text from a file or from output of a command */ - Signature(const QString &url, bool isExecutable); + Signature(const QString &path, bool isExecutable); /** Copy constructor */ Signature(const Signature &that); /** Assignment operator */ @@ -158,8 +158,8 @@ /** Set the signature URL and mark this signature as being of "from file" resp. "from output of command" type. */ - void setUrl(const QString &url, bool isExecutable = false); - QString url() const; + void setPath(const QString &path, bool isExecutable = false); + QString path() const; /// @return the type of signature (ie. way to obtain the signature text) Type type() const; diff -Nru kidentitymanagement-15.12.3/src/utils.h kidentitymanagement-16.04.3/src/utils.h --- kidentitymanagement-15.12.3/src/utils.h 2015-11-07 18:06:23.000000000 +0000 +++ kidentitymanagement-16.04.3/src/utils.h 2016-06-15 04:38:47.000000000 +0000 @@ -27,19 +27,19 @@ namespace KIdentityManagement { - /* - * Very fast version of IdentityManager::thatIsMe, that is using an internal cache (allEmails) - * - make sure that only an email address is used as parameter and NO name - * - emails are tested with email.toLower(), so no need to lower them before. - */ - KIDENTITYMANAGEMENT_EXPORT bool thatIsMe(const QString &email); +/* +* Very fast version of IdentityManager::thatIsMe, that is using an internal cache (allEmails) +* - make sure that only an email address is used as parameter and NO name +* - emails are tested with email.toLower(), so no need to lower them before. +*/ +KIDENTITYMANAGEMENT_EXPORT bool thatIsMe(const QString &email); - /* - * Very fast version of IdentityManager::allEmails , that is using an internal cache. - * The cache is updated with IdentityManager::changed signal. - * All email addresses + alias of the identities. The email addresses are all lowered. - */ - KIDENTITYMANAGEMENT_EXPORT const QSet &allEmails(); +/* +* Very fast version of IdentityManager::allEmails , that is using an internal cache. +* The cache is updated with IdentityManager::changed signal. +* All email addresses + alias of the identities. The email addresses are all lowered. +*/ +KIDENTITYMANAGEMENT_EXPORT const QSet &allEmails(); } #endif