Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Data Exporter
Commits
966e0241
Commit
966e0241
authored
Apr 27, 2022
by
Laurent Montel
😁
Browse files
Now korgac is remplaced by kalendaracrc
parent
926d000d
Pipeline
#169019
passed with stage
in 2 minutes and 41 seconds
Changes
18
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
core/autotests/calendar/data/export/calendarconfigandresources/config/kalendaracrc
0 → 100644
View file @
966e0241
[Alarms]
CalendarsLastChecked=2022,4,27,12,39,0.161
[General]
Autostart=true
Enabled=true
[Suspended][45bfaf0e-5335-479d-a56a-7db0f0509794]
Occurrence=0,0,0,-1,-1,-1.001
RemindAt=2022,1,7,10,45,0.128
Text=REMINDER
UID=45bfaf0e-5335-479d-a56a-7db0f0509794
core/autotests/calendar/data/export/calendarconfigandresources/config/korgacrc
deleted
100644 → 0
View file @
926d000d
This diff is collapsed.
Click to expand it.
core/autotests/calendar/data/export/calendarconfigandresources/list.txt
View file @
966e0241
...
...
@@ -5,7 +5,7 @@ calendar/akonadi_ical_resource_2/akonadi_ical_resource_2rc
calendar/akonadi_ical_resource_2/std.ics
configs/calendar_printing.rc
configs/eventviewsrc
configs/k
org
acrc
configs/k
alendar
acrc
configs/korganizerrc
information/VERSION_2
information/exportdatatype.xml
core/autotests/calendar/data/export/calendarconfigandresources/references/config/kalendaracrc
0 → 100644
View file @
966e0241
[Alarms]
CalendarsLastChecked=foo/bla bla/bli2022,foo/bla bla/bli4,foo/bla bla/bli27,foo/bla bla/bli12,foo/bla bla/bli39
[General]
Autostart=true
Enabled=true
[Suspended][45bfaf0e-5335-479d-a56a-7db0f0509794]
Occurrence=0,0,0,-1,-1,-1.001
RemindAt=2022,1,7,10,45,0.128
Text=REMINDER
UID=45bfaf0e-5335-479d-a56a-7db0f0509794
core/autotests/calendar/data/export/calendarconfigandresources/references/config/korgacrc
deleted
100644 → 0
View file @
926d000d
This diff is collapsed.
Click to expand it.
core/autotests/calendar/data/export/calendaronlyconfig/config/kalendaracrc
0 → 100644
View file @
966e0241
[Alarms]
CalendarsLastChecked=2022,4,27,12,41,0.167
[General]
Autostart=true
Enabled=true
[Suspended][45bfaf0e-5335-479d-a56a-7db0f0509794]
Occurrence=0,0,0,-1,-1,-1.001
RemindAt=2022,1,7,10,45,0.128
Text=REMINDER
UID=45bfaf0e-5335-479d-a56a-7db0f0509794
core/autotests/calendar/data/export/calendaronlyconfig/config/korgacrc
deleted
100644 → 0
View file @
926d000d
This diff is collapsed.
Click to expand it.
core/autotests/calendar/data/export/calendaronlyconfig/list.txt
View file @
966e0241
configs/korganizerrc
configs/eventviewsrc
configs/k
org
acrc
configs/k
alendar
acrc
configs/calendar_printing.rc
information/VERSION_2
information/exportdatatype.xml
core/autotests/calendar/data/export/calendaronlyconfig/references/config/kalendaracrc
0 → 100644
View file @
966e0241
[Alarms]
CalendarsLastChecked=foo/bla bla/bli2022,foo/bla bla/bli4,foo/bla bla/bli27,foo/bla bla/bli12,foo/bla bla/bli41
[General]
Autostart=true
Enabled=true
[Suspended][45bfaf0e-5335-479d-a56a-7db0f0509794]
Occurrence=0,0,0,-1,-1,-1.001
RemindAt=2022,1,7,10,45,0.128
Text=REMINDER
UID=45bfaf0e-5335-479d-a56a-7db0f0509794
core/autotests/calendar/data/export/calendaronlyconfig/references/config/korgacrc
deleted
100644 → 0
View file @
926d000d
This diff is collapsed.
Click to expand it.
core/autotests/calendar/data/import/calendarconfigandresource/archive.zip
View file @
966e0241
No preview for this file type
core/autotests/calendar/data/import/calendarconfigandresource/list.txt
View file @
966e0241
...
...
@@ -5,7 +5,7 @@ calendar/akonadi_ical_resource_2/akonadi_ical_resource_2rc
calendar/akonadi_ical_resource_2/std.ics
configs/calendar_printing.rc
configs/eventviewsrc
configs/k
org
acrc
configs/k
alendar
acrc
configs/korganizerrc
information/VERSION_2
information/exportdatatype.xml
core/autotests/calendar/data/import/calendaronlyconfig/list.txt
View file @
966e0241
configs/korganizerrc
configs/eventviewsrc
configs/k
org
acrc
configs/k
alendar
acrc
configs/calendar_printing.rc
information/VERSION_2
information/exportdatatype.xml
core/calendar/exportcalendarjobinterface.cpp
View file @
966e0241
...
...
@@ -113,10 +113,68 @@ void ExportCalendarJobInterface::slotCheckBackupConfig()
Q_EMIT
jobFinished
();
}
void
ExportCalendarJobInterface
::
backup
Config
()
void
ExportCalendarJobInterface
::
exportEventView
Config
()
{
setProgressDialogLabel
(
i18n
(
"Backing up config..."
));
const
QString
eventviewsrcStr
(
QStringLiteral
(
"eventviewsrc"
));
const
QString
eventviewsrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
eventviewsrcStr
;
if
(
QFileInfo
::
exists
(
eventviewsrc
))
{
KSharedConfigPtr
eventviews
=
KSharedConfig
::
openConfig
(
eventviewsrc
);
QTemporaryFile
tmp
;
tmp
.
open
();
KConfig
*
eventviewConfig
=
eventviews
->
copyTo
(
tmp
.
fileName
());
const
QString
resourceColorStr
(
QStringLiteral
(
"Resources Colors"
));
if
(
eventviewConfig
->
hasGroup
(
resourceColorStr
))
{
KConfigGroup
group
=
eventviewConfig
->
group
(
resourceColorStr
);
const
QStringList
keyList
=
group
.
keyList
();
bool
found
=
false
;
for
(
const
QString
&
key
:
keyList
)
{
const
int
collectionValue
=
key
.
toInt
(
&
found
);
if
(
found
&&
collectionValue
!=
-
1
)
{
const
QString
realPath
=
convertToFullCollectionPath
(
collectionValue
);
const
QColor
color
=
group
.
readEntry
(
key
,
QColor
());
group
.
writeEntry
(
realPath
,
color
);
group
.
deleteEntry
(
key
);
}
}
}
eventviewConfig
->
sync
();
backupFile
(
tmp
.
fileName
(),
Utils
::
configsPath
(),
eventviewsrcStr
);
delete
eventviewConfig
;
}
}
void
ExportCalendarJobInterface
::
exportReminderAgentConfig
()
{
const
QString
kalendarcStr
(
QStringLiteral
(
"kalendaracrc"
));
const
QString
kalendarcrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
kalendarcStr
;
if
(
QFileInfo
::
exists
(
kalendarcrc
))
{
KSharedConfigPtr
kalendarc
=
KSharedConfig
::
openConfig
(
kalendarcrc
);
QTemporaryFile
tmp
;
tmp
.
open
();
tmp
.
setAutoRemove
(
false
);
KConfig
*
kalendarcConfig
=
kalendarc
->
copyTo
(
tmp
.
fileName
());
const
QString
globalCollectionsStr
(
QStringLiteral
(
"Alarms"
));
if
(
kalendarcConfig
->
hasGroup
(
globalCollectionsStr
))
{
KConfigGroup
group
=
kalendarcConfig
->
group
(
globalCollectionsStr
);
const
QString
selectionKey
(
QStringLiteral
(
"CalendarsLastChecked"
));
convertCollectionListToRealPath
(
group
,
selectionKey
);
}
kalendarcConfig
->
sync
();
backupFile
(
tmp
.
fileName
(),
Utils
::
configsPath
(),
kalendarcStr
);
delete
kalendarcConfig
;
}
}
void
ExportCalendarJobInterface
::
exportKorganizerConfig
()
{
const
QString
korganizerStr
(
QStringLiteral
(
"korganizerrc"
));
const
QString
korganizerrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
korganizerStr
;
if
(
QFileInfo
::
exists
(
korganizerrc
))
{
...
...
@@ -152,40 +210,17 @@ void ExportCalendarJobInterface::backupConfig()
backupFile
(
tmp
.
fileName
(),
Utils
::
configsPath
(),
korganizerStr
);
delete
korganizerConfig
;
}
const
QString
eventviewsrcStr
(
QStringLiteral
(
"eventviewsrc"
));
const
QString
eventviewsrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
eventviewsrcStr
;
if
(
QFileInfo
::
exists
(
eventviewsrc
))
{
KSharedConfigPtr
eventviews
=
KSharedConfig
::
openConfig
(
eventviewsrc
);
QTemporaryFile
tmp
;
tmp
.
open
();
KConfig
*
eventviewConfig
=
eventviews
->
copyTo
(
tmp
.
fileName
());
const
QString
resourceColorStr
(
QStringLiteral
(
"Resources Colors"
));
if
(
eventviewConfig
->
hasGroup
(
resourceColorStr
))
{
KConfigGroup
group
=
eventviewConfig
->
group
(
resourceColorStr
);
}
const
QStringList
keyList
=
group
.
keyList
();
bool
found
=
false
;
for
(
const
QString
&
key
:
keyList
)
{
const
int
collectionValue
=
key
.
toInt
(
&
found
);
if
(
found
&&
collectionValue
!=
-
1
)
{
const
QString
realPath
=
convertToFullCollectionPath
(
collectionValue
);
const
QColor
color
=
group
.
readEntry
(
key
,
QColor
());
group
.
writeEntry
(
realPath
,
color
);
group
.
deleteEntry
(
key
);
}
}
}
void
ExportCalendarJobInterface
::
backupConfig
()
{
setProgressDialogLabel
(
i18n
(
"Backing up config..."
));
eventviewConfig
->
sync
();
backupFile
(
tmp
.
fileName
(),
Utils
::
configsPath
(),
eventviewsrcStr
);
delete
eventviewConfig
;
}
exportKorganizerConfig
();
exportEventViewConfig
();
exportReminderAgentConfig
();
backupConfigFile
(
QStringLiteral
(
"calendar_printing.rc"
));
backupConfigFile
(
QStringLiteral
(
"korgacrc"
));
const
QString
freebusyurlsStr
(
QStringLiteral
(
"korganizer/freebusyurls"
));
const
QString
freebusyurls
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QLatin1Char
(
'/'
)
+
freebusyurlsStr
;
...
...
core/calendar/exportcalendarjobinterface.h
View file @
966e0241
...
...
@@ -32,6 +32,9 @@ protected:
private:
void
slotCheckBackupResource
();
void
exportEventViewConfig
();
void
exportKorganizerConfig
();
void
exportReminderAgentConfig
();
void
backupConfig
();
int
mIndexIdentifier
=
0
;
...
...
core/calendar/importcalendarjobinterface.cpp
View file @
966e0241
...
...
@@ -146,17 +146,17 @@ void ImportCalendarJobInterface::restoreConfig()
}
}
const
QString
k
org
acStr
(
QStringLiteral
(
"k
org
acrc"
));
const
KArchiveEntry
*
k
orgacr
centry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
k
org
acStr
);
if
(
k
orgacr
centry
&&
k
orgacr
centry
->
isFile
())
{
const
auto
k
orgacr
cFile
=
static_cast
<
const
KArchiveFile
*>
(
k
orgacr
centry
);
const
QString
k
org
acrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
k
org
acStr
;
if
(
QFileInfo
::
exists
(
k
org
acrc
))
{
if
(
overwriteConfigMessageBox
(
k
org
acStr
))
{
copyToFile
(
korgacrcFile
,
korgacrc
,
korg
acStr
,
Utils
::
configsPath
());
const
QString
k
alendar
acStr
(
QStringLiteral
(
"k
alendar
acrc"
));
const
KArchiveEntry
*
k
alendara
centry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
k
alendar
acStr
);
if
(
k
alendara
centry
&&
k
alendara
centry
->
isFile
())
{
const
auto
k
alendara
cFile
=
static_cast
<
const
KArchiveFile
*>
(
k
alendara
centry
);
const
QString
k
alendar
acrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
k
alendar
acStr
;
if
(
QFileInfo
::
exists
(
k
alendar
acrc
))
{
if
(
overwriteConfigMessageBox
(
k
alendar
acStr
))
{
importReminderAgentConfig
(
kalendaracFile
,
kalendaracrc
,
kalendar
acStr
,
Utils
::
configsPath
());
}
}
else
{
copyToFile
(
korgacrcFile
,
korgacrc
,
korg
acStr
,
Utils
::
configsPath
());
importReminderAgentConfig
(
kalendaracFile
,
kalendaracrc
,
kalendar
acStr
,
Utils
::
configsPath
());
}
}
...
...
@@ -217,6 +217,14 @@ void ImportCalendarJobInterface::importkorganizerConfig(const KArchiveFile *file
korganizerConfig
->
sync
();
}
void
ImportCalendarJobInterface
::
importReminderAgentConfig
(
const
KArchiveFile
*
file
,
const
QString
&
config
,
const
QString
&
filename
,
const
QString
&
prefix
)
{
copyToFile
(
file
,
config
,
filename
,
prefix
);
KSharedConfig
::
Ptr
reminderAgentConfig
=
KSharedConfig
::
openConfig
(
config
);
convertCollectionListStrToAkonadiId
(
reminderAgentConfig
,
QStringLiteral
(
"Alarms"
),
QStringLiteral
(
"CalendarsLastChecked"
),
false
);
reminderAgentConfig
->
sync
();
}
void
ImportCalendarJobInterface
::
importeventViewConfig
(
const
KArchiveFile
*
file
,
const
QString
&
config
,
const
QString
&
filename
,
const
QString
&
prefix
)
{
copyToFile
(
file
,
config
,
filename
,
prefix
);
...
...
core/calendar/importcalendarjobinterface.h
View file @
966e0241
...
...
@@ -31,6 +31,7 @@ private:
Q_REQUIRED_RESULT
bool
isAConfigFile
(
const
QString
&
name
)
const
override
;
void
importkorganizerConfig
(
const
KArchiveFile
*
file
,
const
QString
&
config
,
const
QString
&
filename
,
const
QString
&
prefix
);
void
importeventViewConfig
(
const
KArchiveFile
*
file
,
const
QString
&
config
,
const
QString
&
filename
,
const
QString
&
prefix
);
void
importReminderAgentConfig
(
const
KArchiveFile
*
file
,
const
QString
&
config
,
const
QString
&
filename
,
const
QString
&
prefix
);
void
restoreResources
();
void
restoreConfig
();
void
addSpecificResourceSettings
(
const
KSharedConfig
::
Ptr
&
resourceConfig
,
const
QString
&
resourceName
,
QMap
<
QString
,
QVariant
>
&
settings
)
override
;
...
...
gui/backup-structure.txt
View file @
966e0241
20
19-11-04
:
20
22-04-22
:
-----------
2015-1-29: New VERSION for archive => VERSION_2 => knote-akonadi
...
...
@@ -59,7 +59,7 @@ Root
| |---------kalarmrc
| |---------korganizerrc
| |---------calendar_printing.rc
| |---------k
org
acrc
| |---------k
alendar
acrc
| |---------kaddressbookrc
| |---------akonadi_mailfilter_agent.notifyrc
| |---------akonadi_sendlater_agent.notifyrc
...
...
Write
Preview
Supports
Markdown
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