Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KAlarm
Commits
20f14c79
Commit
20f14c79
authored
Jun 01, 2015
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to migrate ics file
parent
233c966a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
0 deletions
+97
-0
CMakeLists.txt
CMakeLists.txt
+2
-0
kalarmmigrateapplication.cpp
kalarmmigrateapplication.cpp
+60
-0
kalarmmigrateapplication.h
kalarmmigrateapplication.h
+35
-0
No files found.
CMakeLists.txt
View file @
20f14c79
...
...
@@ -101,6 +101,7 @@ set(kalarm_bin_SRCS ${libkalarm_SRCS}
wakedlg.cpp
)
set
(
kalarm_bin_SRCS
${
kalarm_bin_SRCS
}
kalarmmigrateapplication.cpp
akonadimodel.cpp
akonadiresourcecreator.cpp
collectionmodel.cpp
...
...
@@ -155,6 +156,7 @@ KF5::KCMUtils
Phonon::phonon4qt5
KF5::Auth
KF5::DBusAddons
pimcommon
)
if
(
Qt5X11Extras_FOUND
)
...
...
kalarmmigrateapplication.cpp
0 → 100644
View file @
20f14c79
/*
Copyright (c) 2015 Montel Laurent <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
*/
#include "kalarmmigrateapplication.h"
#include <Kdelibs4ConfigMigrator>
KAlarmMigrateApplication
::
KAlarmMigrateApplication
()
{
initializeMigrator
();
}
void
KAlarmMigrateApplication
::
migrate
()
{
// Migrate to xdg.
Kdelibs4ConfigMigrator
migrate
(
QStringLiteral
(
"kalarm"
));
migrate
.
setConfigFiles
(
QStringList
()
<<
QStringLiteral
(
"kalarmrc"
));
migrate
.
setUiFiles
(
QStringList
()
<<
QStringLiteral
(
"kalarmui.rc"
));
migrate
.
migrate
();
// Migrate folders and files.
if
(
mMigrator
.
checkIfNecessary
())
{
mMigrator
.
start
();
}
}
void
KAlarmMigrateApplication
::
initializeMigrator
()
{
const
int
currentVersion
=
2
;
mMigrator
.
setApplicationName
(
QStringLiteral
(
"kalarm"
));
mMigrator
.
setConfigFileName
(
QStringLiteral
(
"kalarmrc"
));
// To migrate we need a version > currentVersion
const
int
initialVersion
=
currentVersion
+
1
;
// ics file
PimCommon
::
MigrateFileInfo
migrateInfoIcs
;
migrateInfoIcs
.
setFolder
(
false
);
migrateInfoIcs
.
setType
(
QStringLiteral
(
"data"
));
migrateInfoIcs
.
setPath
(
QStringLiteral
(
"kalarm/"
));
migrateInfoIcs
.
setVersion
(
initialVersion
);
migrateInfoIcs
.
setFilePatterns
(
QStringList
()
<<
QStringLiteral
(
"*.ics"
));
mMigrator
.
insertMigrateInfo
(
migrateInfoIcs
);
}
kalarmmigrateapplication.h
0 → 100644
View file @
20f14c79
/*
Copyright (c) 2015 Montel Laurent <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 <migration/migrateapplicationfiles.h>
class
KAlarmMigrateApplication
{
public:
KAlarmMigrateApplication
();
void
migrate
();
private:
void
initializeMigrator
();
PimCommon
::
MigrateApplicationFiles
mMigrator
;
};
#endif // KALARMMIGRATEAPPLICATION_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment