[-]
[+]
|
Changed |
kwallet.spec
|
|
[-]
[+]
|
Changed |
kwallet-5.10.0.tar.xz/CMakeLists.txt
^
|
@@ -3,15 +3,15 @@
project(KWallet)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
-find_package(ECM 5.9.0 REQUIRED NO_MODULE)
+find_package(ECM 5.10.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(REQUIRED_QT_VERSION 5.2.0)
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus)
-set(KF5_VERSION "5.9.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.9.0") # handled by release scripts
+set(KF5_VERSION "5.10.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.10.0") # handled by release scripts
include(KDEInstallDirs)
include(KDEFrameworkCompilerSettings)
include(KDECMakeSettings)
|
[-]
[+]
|
Changed |
kwallet-5.10.0.tar.xz/src/runtime/kwalletd/migrationagent.cpp
^
|
@@ -55,10 +55,15 @@
qDebug() << "Migration agent starting...";
if (!isAlreadyMigrated()) {
if (connectOldDaemon()) {
- if (isMigrationWizardOk()) {
- setAlreadyMigrated();
+ if (!isEmptyOldWallet()) {
+ if (isMigrationWizardOk()) {
+ setAlreadyMigrated();
+ } else {
+ qDebug() << "Migration wizard returned an error or has been canceled. The migration agent will resume upon next daemon start";
+ }
} else {
- qDebug() << "Migration wizard returned an error or has been canceled. The migration agent will resume upon next daemon start";
+ qDebug() << "Old wallet is empty. No need to migrate.";
+ setAlreadyMigrated();
}
} else {
qDebug() << "KDE4 kwalletd not present, stopping migration agent";
@@ -104,7 +109,7 @@
qDebug() << "The kwalletd service has been registered";
}
}
-
+
_kde4_daemon = new org::kde::KWallet(QString::fromLatin1(SERVICE_KWALLETD4), "/modules/kwalletd", QDBusConnection::sessionBus());
return _kde4_daemon->isValid();
}
@@ -112,14 +117,14 @@
bool MigrationAgent::isMigrationWizardOk()
{
bool ok = false;
-
+
MigrationWizard *wizard = new MigrationWizard(this);
int result = wizard->exec();
if (QDialog::Accepted == result) {
// the user either migrated the wallets, or choose not to be prompted again
ok = true;
}
-
+
return ok;
}
@@ -145,48 +150,61 @@
}
return reply.value();
}
-
+
+bool MigrationAgent::isEmptyOldWallet() const {
+ QStringList wallets;
+ try {
+ wallets = invokeAndCheck<QStringList>(
+ [this] { return _kde4_daemon->wallets(); },
+ i18n("Cannot read old wallet list. Aborting."));
+ } catch (MigrationException ex) {
+ return true;
+ }
+
+ return wallets.length() == 0;
+}
+
bool MigrationAgent::performMigration(WId wid)
{
auto appId = i18n("KDE Wallet Migration Agent");
try {
migrationAgent = this;
QStringList wallets = invokeAndCheck<QStringList>(
- [this] { return _kde4_daemon->wallets(); },
+ [this] { return _kde4_daemon->wallets(); },
i18n("Cannot read old wallet list. Aborting."));
foreach (const QString &wallet, wallets) {
emit progressMessage(i18n("Migrating wallet: %1", wallet));
emit progressMessage(i18n("* Creating KF5 wallet: %1", wallet));
-
+
int handle5 = _kf5_daemon->internalOpen(appId, wallet, false, 0, true, QString());
if (handle5 <0) {
emit progressMessage(i18n("ERROR when attempting new wallet creation. Aborting."));
return false;
}
-
+
int handle4 = invokeAndCheck<int>(
[this, wallet, wid, appId] { return _kde4_daemon->open(wallet, wid, appId); },
i18n("Cannot open KDE4 wallet named: %1", wallet));
emit progressMessage(i18n("* Opened KDE4 wallet: %1", wallet));
-
+
const QStringList folders = invokeAndCheck<QStringList>(
[this, handle4, appId] { return _kde4_daemon->folderList(handle4, appId); },
i18n("Cannot retrieve folder list. Aborting."));
-
+
foreach (const QString &folder, folders) {
emit progressMessage(i18n("* Migrating folder %1", folder));
QStringList entries = invokeAndCheck<QStringList>(
[this, handle4, folder, appId] { return _kde4_daemon->entryList(handle4, folder, appId); },
i18n("Cannot retrieve folder %1 entries. Aborting.", folder));
-
+
foreach (const QString &key, entries) {
int entryType = invokeAndCheck<int>(
[this, handle4, folder, key, appId] { return _kde4_daemon->entryType(handle4, folder, key, appId); },
i18n("Cannot retrieve key %1 info. Aborting.", key));
-
+
// handle the case where the entries are already there
if (_kf5_daemon->hasEntry(handle5, folder, key, appId)) {
emit progressMessage(i18n("* SKIPPING entry %1 in folder %2 as it seems already migrated", key, folder));
@@ -202,7 +220,7 @@
}
}
}
-
+
//_kde4_daemon->close(handle4, false, appId);
//_kf5_daemon->close(handle5, true, appId);
_kf5_daemon->sync(handle5, appId);
|
[-]
[+]
|
Changed |
kwallet-5.10.0.tar.xz/src/runtime/kwalletd/migrationagent.h
^
|
@@ -34,6 +34,7 @@
public:
MigrationAgent(KWalletD* kd);
+ bool isEmptyOldWallet() const;
bool performMigration(WId wid);
private Q_SLOTS:
|
[-]
[+]
|
Changed |
kwallet-5.10.0.tar.xz/src/runtime/kwalletd/migrationwizard.cpp
^
|
@@ -1,23 +1,23 @@
/*
* This file is part of the KDE Frameworks
- *
+ *
* Copyright (c) 2014 Valentin Rusu <kde@rusu.info>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
- *
+ *
*/
#include "migrationwizard.h"
@@ -27,8 +27,8 @@
class MigrationPage1 : public QWizardPage {
public:
- MigrationPage1(QWidget *wizard)
- : QWizardPage(wizard)
+ MigrationPage1(QWidget *wizard)
+ : QWizardPage(wizard)
{
_ui.setupUi(this);
connect(_ui._optionNo, SIGNAL(toggled(bool)), wizard, SLOT(page1Updated()));
@@ -38,7 +38,7 @@
emit this->completeChanged();
});
}
-
+
virtual bool isComplete() const {
return !_ui._optionNo->isChecked();
}
@@ -55,17 +55,17 @@
{
_ui.setupUi(this);
}
-
+
virtual void initializePage() {
connect(_agent, SIGNAL(progressMessage(QString)), _ui._report, SLOT(append(QString)));
_migrationCompleted = _agent->performMigration(winId());
emit completeChanged();
}
-
+
virtual bool isComplete() const {
return _migrationCompleted;
}
-
+
Ui::MigrationPage2 _ui;
MigrationAgent *_agent;
bool _migrationCompleted;
@@ -74,13 +74,13 @@
MigrationPage1 *page1 = NULL;
MigrationPage2 *page2 = NULL;
-MigrationWizard::MigrationWizard(MigrationAgent *agent)
+MigrationWizard::MigrationWizard(MigrationAgent *agent)
: _agent(agent)
{
setOption(HaveFinishButtonOnEarlyPages);
page1 = new MigrationPage1(this);
addPage(page1);
-
+
page2 = new MigrationPage2(this);
addPage(page2);
}
|
[-]
[+]
|
Changed |
kwallet-5.10.0.tar.xz/src/runtime/kwalletd/migrationwizard.h
^
|
@@ -1,23 +1,23 @@
/*
* This file is part of the KDE Frameworks
- *
+ *
* Copyright (c) 2014 Valentin Rusu <kde@rusu.info>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
- *
+ *
*/
#ifndef _MIGRATIONWIZARD_H_
#define _MIGRATIONWIZARD_H_
@@ -31,12 +31,12 @@
public:
MigrationWizard(MigrationAgent *agent);
~MigrationWizard();
-
+
MigrationAgent *agent() const { return _agent; }
public Q_SLOTS:
void page1Updated();
-
+
private:
MigrationAgent *_agent;
};
|
[-]
[+]
|
Changed |
kwallet.yaml
^
|
@@ -1,5 +1,5 @@
Name : kwallet
-Version : 5.9.0
+Version : 5.10.0
Release : 1
Group : System/Base
License : GPLv2+
|