Commit aec1b4a5 authored by David Jarvie's avatar David Jarvie
Browse files

Clarify KDE4 file location migration

parent 22cea7ed
Pipeline #25355 passed with stage
in 26 minutes and 48 seconds
......@@ -11,15 +11,14 @@ add_subdirectory(kconf_update)
set(libkalarm_common_SRCS)
ecm_qt_declare_logging_category(libkalarm_common_SRCS
HEADER kalarm_debug.h
IDENTIFIER KALARM_LOG
CATEGORY_NAME org.kde.pim.kalarm
DEFAULT_SEVERITY Warning
DESCRIPTION "kalarm (kalarm)"
OLD_CATEGORY_NAMES log_kalarm
EXPORT KALARM
)
HEADER kalarm_debug.h
IDENTIFIER KALARM_LOG
CATEGORY_NAME org.kde.pim.kalarm
DEFAULT_SEVERITY Warning
DESCRIPTION "kalarm (kalarm)"
OLD_CATEGORY_NAMES log_kalarm
EXPORT KALARM
)
########### next target ###############
set(libkalarm_SRCS
......@@ -78,7 +77,6 @@ set(resources_SRCS
resources/singlefileresource.cpp
resources/singlefileresourceconfigdialog.cpp
resources/dirresourceimportdialog.cpp
eventid.cpp
)
set(kalarm_bin_SRCS ${libkalarm_SRCS} ${resources_SRCS}
......@@ -103,6 +101,7 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS} ${resources_SRCS}
dbushandler.cpp
recurrenceedit.cpp
deferdlg.cpp
eventid.cpp
functions.cpp
fontcolour.cpp
fontcolourbutton.cpp
......@@ -128,7 +127,7 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS} ${resources_SRCS}
templatedlg.cpp
templatemenuaction.cpp
wakedlg.cpp
kalarmmigrateapplication.cpp
migratekde4files.cpp
akonadicollectionsearch.cpp
)
......
......@@ -28,7 +28,7 @@
#include "kamail.h"
#include "mainwindow.h"
#include "messagewin.h"
#include "kalarmmigrateapplication.h"
#include "migratekde4files.h"
#include "preferences.h"
#include "prefdlg.h"
#include "resourcescalendar.h"
......@@ -144,7 +144,8 @@ KAlarmApp* KAlarmApp::create(int& argc, char** argv)
*/
void KAlarmApp::initialise()
{
KAlarmMigrateApplication migrate;
// Migrate config and data files from KDE4 locations.
MigrateKde4Files migrate;
migrate.migrate();
#ifndef NDEBUG
......
/*
Copyright (c) 2015-2020 Laurent Montel <montel@kde.org>
based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KALARMMIGRATEAPPLICATION_H
#define KALARMMIGRATEAPPLICATION_H
#include <PimCommon/MigrateApplicationFiles>
class KAlarmMigrateApplication
{
public:
KAlarmMigrateApplication();
void migrate();
private:
void initializeMigrator();
PimCommon::MigrateApplicationFiles mMigrator;
};
#endif // KALARMMIGRATEAPPLICATION_H
// vim: et sw=4:
/*
Copyright (c) 2015-2020 Laurent Montel <montel@kde.org>
Copyright © 2019 David Jarvie <djarvie@kde.org>
based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* migratekde4files.cpp - migrate KDE4 config and data file locations
* Program: kalarm
* Copyright (c) 2015-2020 Laurent Montel <montel@kde.org>
* Copyright © 2019 David Jarvie <djarvie@kde.org>
*
* based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "kalarmmigrateapplication.h"
#include "migratekde4files.h"
#include "kalarm_debug.h"
#include <Kdelibs4ConfigMigrator>
KAlarmMigrateApplication::KAlarmMigrateApplication()
MigrateKde4Files::MigrateKde4Files()
{
initializeMigrator();
}
void KAlarmMigrateApplication::migrate()
void MigrateKde4Files::migrate()
{
// Migrate to xdg.
// Migrate config and ui files to Qt5 locations.
Kdelibs4ConfigMigrator migrate(QStringLiteral("kalarm"));
migrate.setConfigFiles({QStringLiteral("kalarmrc")});
migrate.setUiFiles({QStringLiteral("kalarmui.rc")});
migrate.migrate();
// Migrate folders and files.
// Migrate data files to Qt5 locations.
if (mMigrator.checkIfNecessary())
{
// When done, this will add a [Migratekde4] entry to kalarmrc.
if (!mMigrator.start())
qCCritical(KALARM_LOG) << "Error migrating config files";
}
}
void KAlarmMigrateApplication::initializeMigrator()
void MigrateKde4Files::initializeMigrator()
{
const int currentVersion = 2;
mMigrator.setApplicationName(QStringLiteral("kalarm"));
......
/*
* migratekde4files.h - migrate KDE4 config and data file locations
* Program: kalarm
* Copyright (c) 2015-2020 Laurent Montel <montel@kde.org>
*
* based on code from Sune Vuorela <sune@vuorela.dk> (Rawatar source code)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MIGRATEKDE4FILES_H
#define MIGRATEKDE4FILES_H
#include <PimCommon/MigrateApplicationFiles>
/** Class to migrate KAlarm config and data files from KDE4 locations to Qt5
* locations. The migration will be recorded by a [Migratekde4] entry in
* kalarmrc.
*/
class MigrateKde4Files
{
public:
MigrateKde4Files();
void migrate();
private:
void initializeMigrator();
PimCommon::MigrateApplicationFiles mMigrator;
};
#endif // MIGRATEKDE4FILES_H
// vim: et sw=4:
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