Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
PIM Data Exporter
Commits
8006ba87
Commit
8006ba87
authored
Nov 04, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernize code
parent
a70daa23
Pipeline
#39508
passed with stage
in 23 minutes and 20 seconds
Changes
52
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
166 additions
and
166 deletions
+166
-166
console/main.cpp
console/main.cpp
+1
-1
console/pimdataexporterconsole.cpp
console/pimdataexporterconsole.cpp
+1
-1
core/abstractimportexportjob.cpp
core/abstractimportexportjob.cpp
+14
-14
core/addressbook/exportaddressbookjobinterfaceimpl.cpp
core/addressbook/exportaddressbookjobinterfaceimpl.cpp
+1
-1
core/addressbook/importaddressbookjobinterface.cpp
core/addressbook/importaddressbookjobinterface.cpp
+6
-6
core/alarm/exportalarmjobinterfaceimpl.cpp
core/alarm/exportalarmjobinterfaceimpl.cpp
+1
-1
core/alarm/importalarmjobinterface.cpp
core/alarm/importalarmjobinterface.cpp
+4
-4
core/autotests/addressbook/exportaddressbookjobinterfacetest.cpp
...totests/addressbook/exportaddressbookjobinterfacetest.cpp
+2
-2
core/autotests/addressbook/exportaddressbookjobinterfacetestimpl.cpp
...sts/addressbook/exportaddressbookjobinterfacetestimpl.cpp
+1
-1
core/autotests/addressbook/importaddressbookjobinterfacetest.cpp
...totests/addressbook/importaddressbookjobinterfacetest.cpp
+1
-1
core/autotests/akregator/exportakregatorjobinterfacetest.cpp
core/autotests/akregator/exportakregatorjobinterfacetest.cpp
+2
-2
core/autotests/akregator/importakregatorjobinterfacetest.cpp
core/autotests/akregator/importakregatorjobinterfacetest.cpp
+1
-1
core/autotests/alarm/exportalarmjobinterfacetest.cpp
core/autotests/alarm/exportalarmjobinterfacetest.cpp
+2
-2
core/autotests/alarm/exportalarmjobinterfacetestimpl.cpp
core/autotests/alarm/exportalarmjobinterfacetestimpl.cpp
+1
-1
core/autotests/alarm/importalarmjobinterfacetest.cpp
core/autotests/alarm/importalarmjobinterfacetest.cpp
+2
-2
core/autotests/backupresourcefilejobimpltest.cpp
core/autotests/backupresourcefilejobimpltest.cpp
+1
-1
core/autotests/calendar/exportcalendarsjobinterfacetest.cpp
core/autotests/calendar/exportcalendarsjobinterfacetest.cpp
+2
-2
core/autotests/calendar/exportcalendarsjobinterfacetestimpl.cpp
...utotests/calendar/exportcalendarsjobinterfacetestimpl.cpp
+1
-1
core/autotests/calendar/importcalendarjobinterfacetest.cpp
core/autotests/calendar/importcalendarjobinterfacetest.cpp
+2
-2
core/autotests/compareexportfile.cpp
core/autotests/compareexportfile.cpp
+1
-1
core/autotests/generatelistfilefromarchive.cpp
core/autotests/generatelistfilefromarchive.cpp
+3
-3
core/autotests/mail/exportmailjobinterfacetest.cpp
core/autotests/mail/exportmailjobinterfacetest.cpp
+2
-2
core/autotests/mail/exportmailjobinterfacetestimpl.cpp
core/autotests/mail/exportmailjobinterfacetestimpl.cpp
+1
-1
core/autotests/mail/importmailjobinterfacetest.cpp
core/autotests/mail/importmailjobinterfacetest.cpp
+2
-2
core/autotests/notes/exportnotesjobinterfacetest.cpp
core/autotests/notes/exportnotesjobinterfacetest.cpp
+2
-2
core/autotests/notes/importnotesjobinterfacetest.cpp
core/autotests/notes/importnotesjobinterfacetest.cpp
+1
-1
core/backupresourcefilejobbase.cpp
core/backupresourcefilejobbase.cpp
+1
-1
core/calendar/exportcalendarjobinterfaceimpl.cpp
core/calendar/exportcalendarjobinterfaceimpl.cpp
+1
-1
core/calendar/importcalendarjobinterface.cpp
core/calendar/importcalendarjobinterface.cpp
+11
-11
core/exportresourcearchivejob.cpp
core/exportresourcearchivejob.cpp
+1
-1
core/mail/exportmailjobinterfaceimpl.cpp
core/mail/exportmailjobinterfaceimpl.cpp
+1
-1
core/mail/importmailjobinterface.cpp
core/mail/importmailjobinterface.cpp
+23
-23
core/notes/exportnotesjobinterfaceimpl.cpp
core/notes/exportnotesjobinterfaceimpl.cpp
+1
-1
core/notes/importnotesjobinterface.cpp
core/notes/importnotesjobinterface.cpp
+4
-4
core/pimdataimportdatainfofile.cpp
core/pimdataimportdatainfofile.cpp
+1
-1
core/synchronizeresourcejob.cpp
core/synchronizeresourcejob.cpp
+2
-2
gui/autotests/pimdataexporterconfigurewidgettest.cpp
gui/autotests/pimdataexporterconfigurewidgettest.cpp
+4
-4
gui/autotests/selectiontypedialogtest.cpp
gui/autotests/selectiontypedialogtest.cpp
+15
-15
gui/autotests/synchronizeresourcedialogtest.cpp
gui/autotests/synchronizeresourcedialogtest.cpp
+7
-7
gui/dialog/backupfilestructureinfodialog.cpp
gui/dialog/backupfilestructureinfodialog.cpp
+1
-1
gui/dialog/pimdataexporterconfiguredialog.cpp
gui/dialog/pimdataexporterconfiguredialog.cpp
+2
-2
gui/dialog/selectiontypedialog.cpp
gui/dialog/selectiontypedialog.cpp
+2
-2
gui/dialog/showarchivestructuredialog.cpp
gui/dialog/showarchivestructuredialog.cpp
+10
-10
gui/dialog/synchronizeresourcedialog.cpp
gui/dialog/synchronizeresourcedialog.cpp
+4
-4
gui/job/fullsynchronizeresourcesjob.cpp
gui/job/fullsynchronizeresourcesjob.cpp
+1
-1
gui/main.cpp
gui/main.cpp
+2
-2
gui/pimdataexporterwindow.cpp
gui/pimdataexporterwindow.cpp
+3
-3
gui/tests/selectiontreewidget_gui.cpp
gui/tests/selectiontreewidget_gui.cpp
+1
-1
gui/tests/showarchivestructuredialog_gui.cpp
gui/tests/showarchivestructuredialog_gui.cpp
+1
-1
gui/widgets/logwidget.cpp
gui/widgets/logwidget.cpp
+1
-1
gui/widgets/pimdataexporterconfigurewidget.cpp
gui/widgets/pimdataexporterconfigurewidget.cpp
+2
-2
gui/widgets/selectiontypetreewidget.cpp
gui/widgets/selectiontypetreewidget.cpp
+6
-6
No files found.
console/main.cpp
View file @
8006ba87
...
...
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
qCDebug
(
PIMDATAEXPORTERCONSOLE_LOG
)
<<
"Log file "
<<
logFile
;
}
PimDataExporterConsole
*
console
=
new
PimDataExporterConsole
;
auto
*
console
=
new
PimDataExporterConsole
;
if
(
!
importFile
.
isEmpty
())
{
console
->
setMode
(
PimDataExporterConsole
::
Import
);
qCDebug
(
PIMDATAEXPORTERCONSOLE_LOG
)
<<
"Import Mode"
<<
importFile
;
...
...
console/pimdataexporterconsole.cpp
View file @
8006ba87
...
...
@@ -23,7 +23,7 @@ PimDataExporterConsole::PimDataExporterConsole(QObject *parent)
{
//Initialize filtermanager
(
void
)
MailCommon
::
FilterManager
::
instance
();
PimDataExporterKernel
*
kernel
=
new
PimDataExporterKernel
(
this
);
auto
*
kernel
=
new
PimDataExporterKernel
(
this
);
CommonKernel
->
registerKernelIf
(
kernel
);
//register KernelIf early, it is used by the Filter classes
CommonKernel
->
registerSettingsIf
(
kernel
);
//SettingsIf is used in FolderTreeWidget
...
...
core/abstractimportexportjob.cpp
View file @
8006ba87
...
...
@@ -136,13 +136,13 @@ void AbstractImportExportJob::overwriteDirectory(const QString &path, const KArc
{
if
(
QDir
(
path
).
exists
())
{
if
(
overwriteDirectoryMessageBox
(
path
))
{
const
KArchiveDirectory
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
if
(
!
dirEntry
->
copyTo
(
path
))
{
qCWarning
(
PIMDATAEXPORTERCORE_LOG
)
<<
"directory cannot overwrite to "
<<
path
;
}
}
}
else
{
const
KArchiveDirectory
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
if
(
dirEntry
->
copyTo
(
path
))
{
qCWarning
(
PIMDATAEXPORTERCORE_LOG
)
<<
"directory cannot overwrite to "
<<
path
;
}
...
...
@@ -171,7 +171,7 @@ void AbstractImportExportJob::storeArchiveInfoResources(const KArchiveDirectory
for
(
const
QString
&
entryName
:
lst
)
{
const
KArchiveEntry
*
entry
=
dir
->
entry
(
entryName
);
if
(
entry
&&
entry
->
isDirectory
())
{
const
KArchiveDirectory
*
resourceDir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
resourceDir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
QStringList
lst
=
resourceDir
->
entries
();
if
(
lst
.
count
()
>=
2
)
{
...
...
@@ -261,7 +261,7 @@ void AbstractImportExportJob::initializeImportJob()
void
AbstractImportExportJob
::
copyToDirectory
(
const
KArchiveEntry
*
entry
,
const
QString
&
dest
)
{
const
KArchiveDirectory
*
subfolderDir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
subfolderDir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
if
(
!
subfolderDir
->
copyTo
(
dest
))
{
qCDebug
(
PIMDATAEXPORTERCORE_LOG
)
<<
"directory cannot copy to "
<<
dest
;
}
...
...
@@ -302,7 +302,7 @@ void AbstractImportExportJob::copyToFile(const KArchiveFile *archivefile, const
void
AbstractImportExportJob
::
backupResourceFile
(
const
QString
&
identifier
,
const
QString
&
defaultPath
)
{
BackupResourceFileJobImpl
*
job
=
new
BackupResourceFileJobImpl
(
this
);
auto
*
job
=
new
BackupResourceFileJobImpl
(
this
);
job
->
setDefaultPath
(
defaultPath
);
job
->
setIdentifier
(
identifier
);
job
->
setZip
(
archive
());
...
...
@@ -327,7 +327,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if
(
value
.
akonadiConfigFile
.
contains
(
resourceBaseName
+
QLatin1Char
(
'_'
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
if
(
!
file
->
copyTo
(
copyToDirName
))
{
qCWarning
(
PIMDATAEXPORTERCORE_LOG
)
<<
"file "
<<
value
.
akonadiConfigFile
<<
" can not copy to "
<<
copyToDirName
;
}
...
...
@@ -343,7 +343,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
const
QString
dataFile
=
value
.
akonadiResources
;
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
if
(
!
file
->
copyTo
(
newUrl
))
{
qCWarning
(
PIMDATAEXPORTERCORE_LOG
)
<<
"file "
<<
dataFile
<<
" can not copy to "
<<
newUrl
;
}
...
...
@@ -354,7 +354,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if
(
!
agentConfigFile
.
isEmpty
())
{
const
KArchiveEntry
*
akonadiAgentConfigEntry
=
mArchiveDirectory
->
entry
(
agentConfigFile
);
if
(
akonadiAgentConfigEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
file
->
copyTo
(
copyToDirName
);
resourceName
=
file
->
name
();
const
QString
configPath
=
copyToDirName
+
QLatin1Char
(
'/'
)
+
resourceName
;
...
...
@@ -412,10 +412,10 @@ void AbstractImportExportJob::extractZipFile(const KArchiveFile *file, const QSt
const
KArchiveEntry
*
entry
=
zipDir
->
entry
(
entryName
);
if
(
entry
)
{
if
(
entry
->
isDirectory
())
{
const
KArchiveDirectory
*
dir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
dir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
dir
->
copyTo
(
destination
+
QLatin1Char
(
'/'
)
+
dir
->
name
(),
true
);
}
else
if
(
entry
->
isFile
())
{
const
KArchiveFile
*
dir
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
const
auto
*
dir
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
dir
->
copyTo
(
destination
);
}
}
...
...
@@ -437,7 +437,7 @@ void AbstractImportExportJob::restoreUiRcFile(const QString &configNameStr, cons
{
const
KArchiveEntry
*
configNameentry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
configNameStr
);
if
(
configNameentry
&&
configNameentry
->
isFile
())
{
const
KArchiveFile
*
configNameconfiguration
=
static_cast
<
const
KArchiveFile
*>
(
configNameentry
);
const
auto
*
configNameconfiguration
=
static_cast
<
const
KArchiveFile
*>
(
configNameentry
);
const
QString
configNamerc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QLatin1String
(
"/kxmlgui5/"
)
+
applicationName
+
QLatin1Char
(
'/'
)
+
configNameStr
;
if
(
QFileInfo
::
exists
(
configNamerc
))
{
if
(
overwriteConfigMessageBox
(
configNameStr
))
{
...
...
@@ -453,7 +453,7 @@ void AbstractImportExportJob::restoreConfigFile(const QString &configNameStr)
{
const
KArchiveEntry
*
configNameentry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
configNameStr
);
if
(
configNameentry
&&
configNameentry
->
isFile
())
{
const
KArchiveFile
*
configNameconfiguration
=
static_cast
<
const
KArchiveFile
*>
(
configNameentry
);
const
auto
*
configNameconfiguration
=
static_cast
<
const
KArchiveFile
*>
(
configNameentry
);
const
QString
configNamerc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
configNameStr
;
if
(
QFileInfo
::
exists
(
configNamerc
))
{
//TODO 4.12 allow to merge config.
...
...
@@ -506,7 +506,7 @@ void AbstractImportExportJob::slotNextStep()
void
AbstractImportExportJob
::
startSynchronizeResources
(
const
QStringList
&
listResourceToSync
)
{
Q_EMIT
info
(
i18n
(
"Start synchronizing..."
));
SynchronizeResourceJob
*
job
=
new
SynchronizeResourceJob
(
this
);
auto
*
job
=
new
SynchronizeResourceJob
(
this
);
job
->
setListResources
(
listResourceToSync
);
connect
(
job
,
&
SynchronizeResourceJob
::
synchronizationFinished
,
this
,
&
AbstractImportExportJob
::
slotAllResourceSynchronized
);
connect
(
job
,
&
SynchronizeResourceJob
::
synchronizationInstanceDone
,
this
,
&
AbstractImportExportJob
::
slotSynchronizeInstanceDone
);
...
...
@@ -553,7 +553,7 @@ void AbstractImportExportJob::importDataSubdirectory(const QString &subdirectory
{
const
KArchiveEntry
*
themeEntry
=
mArchiveDirectory
->
entry
(
Utils
::
dataPath
()
+
subdirectoryRelativePath
);
if
(
themeEntry
&&
themeEntry
->
isDirectory
())
{
const
KArchiveDirectory
*
themeDir
=
static_cast
<
const
KArchiveDirectory
*>
(
themeEntry
);
const
auto
*
themeDir
=
static_cast
<
const
KArchiveDirectory
*>
(
themeEntry
);
const
QStringList
lst
=
themeDir
->
entries
();
for
(
const
QString
&
entryName
:
lst
)
{
const
KArchiveEntry
*
entry
=
themeDir
->
entry
(
entryName
);
...
...
core/addressbook/exportaddressbookjobinterfaceimpl.cpp
View file @
8006ba87
...
...
@@ -49,7 +49,7 @@ Akonadi::Collection::Id ExportAddressbookJobInterfaceImpl::convertFolderPathToCo
void
ExportAddressbookJobInterfaceImpl
::
exportResourceToArchive
(
const
QString
&
archivePath
,
const
QString
&
url
,
const
QString
&
identifier
)
{
ExportResourceArchiveJob
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
auto
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
resourceJob
->
setArchivePath
(
archivePath
);
resourceJob
->
setUrl
(
url
);
resourceJob
->
setIdentifier
(
identifier
);
...
...
core/addressbook/importaddressbookjobinterface.cpp
View file @
8006ba87
...
...
@@ -92,7 +92,7 @@ void ImportAddressbookJobInterface::restoreConfig()
const
QString
kaddressbookStr
(
QStringLiteral
(
"kaddressbookrc"
));
const
KArchiveEntry
*
kaddressbookrcentry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
kaddressbookStr
);
if
(
kaddressbookrcentry
&&
kaddressbookrcentry
->
isFile
())
{
const
KArchiveFile
*
kaddressbookrcFile
=
static_cast
<
const
KArchiveFile
*>
(
kaddressbookrcentry
);
const
auto
*
kaddressbookrcFile
=
static_cast
<
const
KArchiveFile
*>
(
kaddressbookrcentry
);
const
QString
searchExistingFilerc
=
configLocation
()
+
kaddressbookStr
;
const
QString
installPathFilerc
=
installConfigLocation
()
+
kaddressbookStr
;
...
...
@@ -131,12 +131,12 @@ void ImportAddressbookJobInterface::importkaddressBookConfig(const KArchiveFile
const
QString
cvsTemplateDirName
=
QStringLiteral
(
"/kaddressbook/csv-templates/"
);
const
KArchiveEntry
*
csvtemplateEntry
=
mArchiveDirectory
->
entry
(
Utils
::
dataPath
()
+
cvsTemplateDirName
);
if
(
csvtemplateEntry
&&
csvtemplateEntry
->
isDirectory
())
{
const
KArchiveDirectory
*
csvTemplateDir
=
static_cast
<
const
KArchiveDirectory
*>
(
csvtemplateEntry
);
const
auto
*
csvTemplateDir
=
static_cast
<
const
KArchiveDirectory
*>
(
csvtemplateEntry
);
const
QStringList
lst
=
csvTemplateDir
->
entries
();
for
(
const
QString
&
entryName
:
lst
)
{
const
KArchiveEntry
*
entry
=
csvTemplateDir
->
entry
(
entryName
);
if
(
entry
&&
entry
->
isFile
())
{
const
KArchiveFile
*
csvTemplateFile
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
const
auto
*
csvTemplateFile
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
const
QString
name
=
csvTemplateFile
->
name
();
QString
autocorrectionPath
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
cvsTemplateDirName
;
if
(
QFileInfo
::
exists
(
autocorrectionPath
))
{
...
...
@@ -178,7 +178,7 @@ void ImportAddressbookJobInterface::restoreResources()
||
value
.
akonadiConfigFile
.
contains
(
QLatin1String
(
"akonadi_contacts_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
copyArchiveFileTo
(
file
,
copyToDirName
);
QString
resourceName
(
file
->
name
());
...
...
@@ -191,7 +191,7 @@ void ImportAddressbookJobInterface::restoreResources()
const
QString
dataFile
=
value
.
akonadiResources
;
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
//TODO adapt directory name too
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
value
.
akonadiConfigFile
.
contains
(
QLatin1String
(
"akonadi_contacts_resource_"
)));
}
...
...
@@ -201,7 +201,7 @@ void ImportAddressbookJobInterface::restoreResources()
if
(
!
agentConfigFile
.
isEmpty
())
{
const
KArchiveEntry
*
akonadiAgentConfigEntry
=
mArchiveDirectory
->
entry
(
agentConfigFile
);
if
(
akonadiAgentConfigEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
copyArchiveFileTo
(
file
,
copyToDirName
);
resourceName
=
file
->
name
();
filename
=
Utils
::
akonadiAgentName
(
copyToDirName
+
QLatin1Char
(
'/'
)
+
resourceName
);
...
...
core/alarm/exportalarmjobinterfaceimpl.cpp
View file @
8006ba87
...
...
@@ -36,7 +36,7 @@ Akonadi::Collection::Id ExportAlarmJobInterfaceImpl::convertFolderPathToCollecti
void
ExportAlarmJobInterfaceImpl
::
exportResourceToArchive
(
const
QString
&
archivePath
,
const
QString
&
url
,
const
QString
&
identifier
)
{
ExportResourceArchiveJob
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
auto
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
resourceJob
->
setArchivePath
(
archivePath
);
resourceJob
->
setUrl
(
url
);
resourceJob
->
setIdentifier
(
identifier
);
...
...
core/alarm/importalarmjobinterface.cpp
View file @
8006ba87
...
...
@@ -80,7 +80,7 @@ void ImportAlarmJobInterface::restoreConfig()
const
QString
kalarmStr
(
QStringLiteral
(
"kalarmrc"
));
const
KArchiveEntry
*
kalarmrcentry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
kalarmStr
);
if
(
kalarmrcentry
&&
kalarmrcentry
->
isFile
())
{
const
KArchiveFile
*
kalarmrcFile
=
static_cast
<
const
KArchiveFile
*>
(
kalarmrcentry
);
const
auto
*
kalarmrcFile
=
static_cast
<
const
KArchiveFile
*>
(
kalarmrcentry
);
const
QString
searchExistingkalarmrc
=
configLocation
()
+
kalarmStr
;
const
QString
installPathkalarmrc
=
installConfigLocation
()
+
kalarmStr
;
if
(
QFileInfo
::
exists
(
searchExistingkalarmrc
))
{
...
...
@@ -127,7 +127,7 @@ void ImportAlarmJobInterface::restoreResources()
||
value
.
akonadiConfigFile
.
contains
(
QLatin1String
(
"akonadi_kalarm_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
copyArchiveFileTo
(
file
,
copyToDirName
);
QString
resourceName
(
file
->
name
());
...
...
@@ -143,7 +143,7 @@ void ImportAlarmJobInterface::restoreResources()
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
bool
isDirResource
=
value
.
akonadiConfigFile
.
contains
(
QLatin1String
(
"akonadi_kalarm_dir_resource_"
));
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
//TODO adapt directory name too
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
isDirResource
);
}
...
...
@@ -153,7 +153,7 @@ void ImportAlarmJobInterface::restoreResources()
if
(
!
agentConfigFile
.
isEmpty
())
{
const
KArchiveEntry
*
akonadiAgentConfigEntry
=
mArchiveDirectory
->
entry
(
agentConfigFile
);
if
(
akonadiAgentConfigEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
akonadiAgentConfigEntry
);
copyArchiveFileTo
(
file
,
copyToDirName
);
resourceName
=
file
->
name
();
filename
=
Utils
::
akonadiAgentName
(
copyToDirName
+
QLatin1Char
(
'/'
)
+
resourceName
);
...
...
core/autotests/addressbook/exportaddressbookjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -31,7 +31,7 @@ void ExportAddressbookJobInterfaceTest::exportAddressBook()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
QVector
<
Utils
::
AkonadiInstanceInfo
>
lstInfo
;
Utils
::
AkonadiInstanceInfo
info
;
...
...
@@ -46,7 +46,7 @@ void ExportAddressbookJobInterfaceTest::exportAddressBook()
info
.
identifier
=
QStringLiteral
(
"akonadi_kolab_resource_2"
);
lstInfo
<<
info
;
ExportAddressbookJobInterfaceTestImpl
*
exportNote
=
new
ExportAddressbookJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportNote
=
new
ExportAddressbookJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
exportNote
->
setListOfResource
(
lstInfo
);
exportNote
->
setPathConfig
(
QLatin1String
(
configpath
));
file
->
setAbstractImportExportJob
(
exportNote
);
...
...
core/autotests/addressbook/exportaddressbookjobinterfacetestimpl.cpp
View file @
8006ba87
...
...
@@ -76,7 +76,7 @@ QString ExportAddressbookJobInterfaceTestImpl::resourcePath(const QString &agent
void
ExportAddressbookJobInterfaceTestImpl
::
backupAddressBookResourceFile
(
const
QString
&
agentIdentifier
,
const
QString
&
defaultPath
)
{
TestBackupResourceFileJob
*
job
=
new
TestBackupResourceFileJob
(
this
);
auto
*
job
=
new
TestBackupResourceFileJob
(
this
);
job
->
setDefaultPath
(
defaultPath
);
job
->
setIdentifier
(
agentIdentifier
);
job
->
setTestPath
(
mPathConfig
);
...
...
core/autotests/addressbook/importaddressbookjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -38,7 +38,7 @@ void ImportAddressbookJobInterfaceTest::importAddressbook()
file
->
setPathConfig
(
zipFilePath
+
testPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
testPath
);
file
->
setExcludePath
(
Utils
::
addressbookPath
());
ImportAddressbookJobInterfaceTestImpl
*
impl
=
new
ImportAddressbookJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportAddressbookJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
impl
->
setTempDirName
(
file
->
extractPath
());
...
...
core/autotests/akregator/exportakregatorjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -32,10 +32,10 @@ void ExportAkregatorJobInterfaceTest::exportAkregator()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
ExportAkregatorJobInterfaceTestImpl
*
exportAkregator
=
new
ExportAkregatorJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportAkregator
=
new
ExportAkregatorJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
file
->
setAbstractImportExportJob
(
exportAkregator
);
file
->
start
();
delete
exportAkregator
;
...
...
core/autotests/akregator/importakregatorjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -36,7 +36,7 @@ void ImportAkregatorJobInterfaceTest::importAkegator()
TestImportFile
*
file
=
new
TestImportFile
(
zipFilePath
+
testPath
,
this
);
file
->
setPathConfig
(
zipFilePath
+
testPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
testPath
);
ImportAkregatorJobInterfaceTestImpl
*
impl
=
new
ImportAkregatorJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportAkregatorJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
file
->
setAbstractImportExportJob
(
impl
);
file
->
start
();
delete
impl
;
...
...
core/autotests/alarm/exportalarmjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -32,7 +32,7 @@ void ExportAlarmJobInterfaceTest::exportAlarm()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
QVector
<
Utils
::
AkonadiInstanceInfo
>
lstInfo
;
Utils
::
AkonadiInstanceInfo
info
;
...
...
@@ -44,7 +44,7 @@ void ExportAlarmJobInterfaceTest::exportAlarm()
info
.
identifier
=
QStringLiteral
(
"akonadi_kolab_resource_2"
);
lstInfo
<<
info
;
ExportAlarmJobInterfaceTestImpl
*
exportNote
=
new
ExportAlarmJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportNote
=
new
ExportAlarmJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
exportNote
->
setListOfResource
(
lstInfo
);
exportNote
->
setPathConfig
(
QLatin1String
(
configpath
));
file
->
setAbstractImportExportJob
(
exportNote
);
...
...
core/autotests/alarm/exportalarmjobinterfacetestimpl.cpp
View file @
8006ba87
...
...
@@ -49,7 +49,7 @@ QString ExportAlarmJobInterfaceTestImpl::resourcePath(const QString &identifier)
void
ExportAlarmJobInterfaceTestImpl
::
backupAlarmResourceFile
(
const
QString
&
agentIdentifier
,
const
QString
&
defaultPath
)
{
TestBackupResourceFileJob
*
job
=
new
TestBackupResourceFileJob
(
this
);
auto
*
job
=
new
TestBackupResourceFileJob
(
this
);
job
->
setDefaultPath
(
defaultPath
);
job
->
setIdentifier
(
agentIdentifier
);
job
->
setTestPath
(
mPathConfig
);
...
...
core/autotests/alarm/importalarmjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -34,11 +34,11 @@ void ImportAlarmJobInterfaceTest::importAlarmConfig()
QFETCH
(
QString
,
testPath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
const
QString
fullTestPath
=
zipFilePath
+
testPath
;
TestImportFile
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
auto
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
file
->
setPathConfig
(
fullTestPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
testPath
);
file
->
setExcludePath
(
Utils
::
alarmPath
());
ImportAlarmJobInterfaceTestImpl
*
impl
=
new
ImportAlarmJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportAlarmJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
impl
->
setTempDirName
(
file
->
extractPath
());
...
...
core/autotests/backupresourcefilejobimpltest.cpp
View file @
8006ba87
...
...
@@ -15,7 +15,7 @@ BackupResourceFileJobImplTest::BackupResourceFileJobImplTest(QObject *parent)
void
BackupResourceFileJobImplTest
::
shouldHaveDefaultValue
()
{
BackupResourceFileJobImpl
*
job
=
new
BackupResourceFileJobImpl
;
auto
*
job
=
new
BackupResourceFileJobImpl
;
QVERIFY
(
!
job
->
canStart
());
QVERIFY
(
job
->
identifier
().
isEmpty
());
QVERIFY
(
!
job
->
zip
());
...
...
core/autotests/calendar/exportcalendarsjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -32,7 +32,7 @@ void ExportCalendarsJobInterfaceTest::exportCalendar()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
QVector
<
Utils
::
AkonadiInstanceInfo
>
lstInfo
;
Utils
::
AkonadiInstanceInfo
info
;
...
...
@@ -46,7 +46,7 @@ void ExportCalendarsJobInterfaceTest::exportCalendar()
info
.
identifier
=
QStringLiteral
(
"akonadi_kontact_resource_2"
);
lstInfo
<<
info
;
ExportCalendarsJobInterfaceTestImpl
*
exportNote
=
new
ExportCalendarsJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportNote
=
new
ExportCalendarsJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
exportNote
->
setListOfResource
(
lstInfo
);
exportNote
->
setPathConfig
(
QLatin1String
(
configpath
));
file
->
setAbstractImportExportJob
(
exportNote
);
...
...
core/autotests/calendar/exportcalendarsjobinterfacetestimpl.cpp
View file @
8006ba87
...
...
@@ -65,7 +65,7 @@ QString ExportCalendarsJobInterfaceTestImpl::resourcePath(const QString &identif
void
ExportCalendarsJobInterfaceTestImpl
::
backupCalendarResourceFile
(
const
QString
&
agentIdentifier
,
const
QString
&
defaultPath
)
{
TestBackupResourceFileJob
*
job
=
new
TestBackupResourceFileJob
(
this
);
auto
*
job
=
new
TestBackupResourceFileJob
(
this
);
job
->
setDefaultPath
(
defaultPath
);
job
->
setIdentifier
(
agentIdentifier
);
job
->
setTestPath
(
mPathConfig
);
...
...
core/autotests/calendar/importcalendarjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -36,11 +36,11 @@ void ImportCalendarJobInterfaceTest::importCalendar()
QFETCH
(
Utils
::
StoredTypes
,
options
);
const
QString
fullTestPath
=
zipFilePath
+
testPath
;
TestImportFile
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
auto
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
file
->
setPathConfig
(
fullTestPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
testPath
);
file
->
setExcludePath
(
Utils
::
calendarPath
());
ImportCalendarJobInterfaceTestImpl
*
impl
=
new
ImportCalendarJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportCalendarJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
impl
->
setTempDirName
(
file
->
extractPath
());
...
...
core/autotests/compareexportfile.cpp
View file @
8006ba87
...
...
@@ -58,7 +58,7 @@ void CompareExportFile::compareFiles()
mTempDir
->
setAutoRemove
(
false
);
#endif
}
const
KArchiveFile
*
currentFile
=
static_cast
<
const
KArchiveFile
*>
(
currentEntry
);
const
auto
*
currentFile
=
static_cast
<
const
KArchiveFile
*>
(
currentEntry
);
QString
adaptFile
=
file
;
//We store in zip as configs, but we extract in config/
...
...
core/autotests/generatelistfilefromarchive.cpp
View file @
8006ba87
...
...
@@ -62,18 +62,18 @@ bool GenerateListFileFromArchive::searchArchiveElement(const QString &path, cons
void
GenerateListFileFromArchive
::
addSubItems
(
const
QString
&
topLevelPath
,
const
KArchiveEntry
*
entry
,
int
indent
,
const
QString
&
fullpath
)
{
const
KArchiveDirectory
*
dir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
dir
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
QString
space
=
QString
(
indent
*
2
,
QLatin1Char
(
' '
));
const
QStringList
lst
=
dir
->
entries
();
for
(
const
QString
&
entryName
:
lst
)
{
const
KArchiveEntry
*
entry
=
dir
->
entry
(
entryName
);
if
(
entry
)
{
if
(
entry
->
isDirectory
())
{
const
KArchiveDirectory
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
const
auto
*
dirEntry
=
static_cast
<
const
KArchiveDirectory
*>
(
entry
);
//mListFile += space + dirEntry->name();
addSubItems
(
topLevelPath
,
entry
,
indent
,
(
fullpath
.
isEmpty
()
?
QString
()
:
fullpath
+
QLatin1Char
(
'/'
))
+
dirEntry
->
name
());
}
else
if
(
entry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
const
auto
*
file
=
static_cast
<
const
KArchiveFile
*>
(
entry
);
const
QString
fileFullPath
=
topLevelPath
+
(
fullpath
.
isEmpty
()
?
QString
()
:
fullpath
+
QLatin1Char
(
'/'
))
+
file
->
name
();
mListFile
+=
space
+
fileFullPath
;
}
...
...
core/autotests/mail/exportmailjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -43,7 +43,7 @@ void ExportMailJobInterfaceTest::exportMail()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
QVector
<
Utils
::
AkonadiInstanceInfo
>
lstInfo
;
Utils
::
AkonadiInstanceInfo
info
;
...
...
@@ -83,7 +83,7 @@ void ExportMailJobInterfaceTest::exportMail()
info
.
identifier
=
QStringLiteral
(
"akonadi_kalarm_dir_resource_2"
);
lstInfo
<<
info
;
ExportMailJobInterfaceTestImpl
*
exportMail
=
new
ExportMailJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportMail
=
new
ExportMailJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
exportMail
->
setListOfResource
(
lstInfo
);
exportMail
->
setPathConfig
(
QLatin1String
(
configpath
));
file
->
setAbstractImportExportJob
(
exportMail
);
...
...
core/autotests/mail/exportmailjobinterfacetestimpl.cpp
View file @
8006ba87
...
...
@@ -92,7 +92,7 @@ QString ExportMailJobInterfaceTestImpl::resourcePath(const QString &identifier)
void
ExportMailJobInterfaceTestImpl
::
backupMailResourceFile
(
const
QString
&
agentIdentifier
,
const
QString
&
defaultPath
)
{
TestBackupResourceFileJob
*
job
=
new
TestBackupResourceFileJob
(
this
);
auto
*
job
=
new
TestBackupResourceFileJob
(
this
);
job
->
setDefaultPath
(
defaultPath
);
job
->
setIdentifier
(
agentIdentifier
);
job
->
setTestPath
(
mPathConfig
);
...
...
core/autotests/mail/importmailjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -46,11 +46,11 @@ void ImportMailJobInterfaceTest::importMail()
QFETCH
(
QString
,
testPath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
const
QString
fullTestPath
=
zipFilePath
+
testPath
;
TestImportFile
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
auto
*
file
=
new
TestImportFile
(
fullTestPath
,
this
);
file
->
setPathConfig
(
fullTestPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
QLatin1Char
(
'/'
)
+
testPath
);
file
->
setExcludePath
(
Utils
::
mailsPath
());
// ???
ImportMailJobInterfaceTestImpl
*
impl
=
new
ImportMailJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportMailJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
impl
->
setTempDirName
(
file
->
extractPath
());
...
...
core/autotests/notes/exportnotesjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -33,7 +33,7 @@ void ExportNotesJobInterfaceTest::exportNote()
{
QFETCH
(
QByteArray
,
configpath
);
QFETCH
(
Utils
::
StoredTypes
,
options
);
TestExportFile
*
file
=
new
TestExportFile
(
this
);
auto
*
file
=
new
TestExportFile
(
this
);
file
->
setPathConfig
(
configpath
);
QVector
<
Utils
::
AkonadiInstanceInfo
>
lstInfo
;
Utils
::
AkonadiInstanceInfo
info
;
...
...
@@ -45,7 +45,7 @@ void ExportNotesJobInterfaceTest::exportNote()
info
.
identifier
=
QStringLiteral
(
"akonadi_kontact_resource_2"
);
lstInfo
<<
info
;
ExportNotesJobInterfaceTestImpl
*
exportNote
=
new
ExportNotesJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
exportNote
=
new
ExportNotesJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
exportNote
->
setListOfResource
(
lstInfo
);
exportNote
->
setPathConfig
(
QLatin1String
(
configpath
));
file
->
setAbstractImportExportJob
(
exportNote
);
...
...
core/autotests/notes/importnotesjobinterfacetest.cpp
View file @
8006ba87
...
...
@@ -38,7 +38,7 @@ void ImportNotesJobInterfaceTest::importNote()
file
->
setPathConfig
(
fullTestPath
);
file
->
setExtractPath
(
QDir
::
tempPath
()
+
testPath
);
file
->
setExcludePath
(
Utils
::
notePath
());
ImportNotesJobInterfaceTestImpl
*
impl
=
new
ImportNotesJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
auto
*
impl
=
new
ImportNotesJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExistingPathConfig
(
fullTestPath
+
QStringLiteral
(
"/existingconfig/"
));
file
->
setAbstractImportExportJob
(
impl
);
...
...
core/backupresourcefilejobbase.cpp
View file @
8006ba87
...
...
@@ -42,7 +42,7 @@ void BackupResourceFileJobBase::start()
if
(
fileAdded
)
{
Q_EMIT
info
(
i18n
(
"
\"
%1
\"
was backed up."
,
filename
));
StoreResourceJob
*
job
=
new
StoreResourceJob
(
this
);
auto
*
job
=
new
StoreResourceJob
(
this
);
connect
(
job
,
&
StoreResourceJob
::
error
,
this
,
&
BackupResourceFileJobBase
::
error
);
connect
(
job
,
&
StoreResourceJob
::
info
,
this
,
&
BackupResourceFileJobBase
::
info
);
job
->
setArchivePath
(
archivePath
);
...
...
core/calendar/exportcalendarjobinterfaceimpl.cpp
View file @
8006ba87
...
...
@@ -48,7 +48,7 @@ QString ExportCalendarJobInterfaceImpl::convertToFullCollectionPath(const qlongl
void
ExportCalendarJobInterfaceImpl
::
exportResourceToArchive
(
const
QString
&
archivePath
,
const
QString
&
url
,
const
QString
&
identifier
)
{
ExportResourceArchiveJob
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
auto
*
resourceJob
=
new
ExportResourceArchiveJob
(
this
);
resourceJob
->
setArchivePath
(
archivePath
);
resourceJob
->
setUrl
(
url
);
resourceJob
->
setIdentifier
(
identifier
);
...
...
core/calendar/importcalendarjobinterface.cpp
View file @
8006ba87
...
...
@@ -90,7 +90,7 @@ void ImportCalendarJobInterface::restoreConfig()
const
QString
oldKorganizerPrintrrcStr
(
QStringLiteral
(
"korganizer_printing.rc"
));
const
KArchiveEntry
*
oldKorganizerPrinterEntry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
oldKorganizerPrintrrcStr
);
if
(
oldKorganizerPrinterEntry
&&
oldKorganizerPrinterEntry
->
isFile
())
{
const
KArchiveFile
*
korganizerFile
=
static_cast
<
const
KArchiveFile
*>
(
oldKorganizerPrinterEntry
);
const
auto
*
korganizerFile
=
static_cast
<
const
KArchiveFile
*>
(
oldKorganizerPrinterEntry
);
const
QString
oldKorganizerPrintrrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
korganizerPrinterrcStr
;
if
(
QFileInfo
::
exists
(
oldKorganizerPrintrrc
))
{
if
(
overwriteConfigMessageBox
(
oldKorganizerPrintrrc
))
{
...
...
@@ -102,7 +102,7 @@ void ImportCalendarJobInterface::restoreConfig()
}
else
{
const
KArchiveEntry
*
korganizerPrinterEntry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
korganizerPrinterrcStr
);
if
(
korganizerPrinterEntry
&&
korganizerPrinterEntry
->
isFile
())
{
const
KArchiveFile
*
korganizerFile
=
static_cast
<
const
KArchiveFile
*>
(
korganizerPrinterEntry
);
const
auto
*
korganizerFile
=
static_cast
<
const
KArchiveFile
*>
(
korganizerPrinterEntry
);
const
QString
korganizerPrinterrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
korganizerPrinterrcStr
;
if
(
QFileInfo
::
exists
(
korganizerPrinterrc
))
{
if
(
overwriteConfigMessageBox
(
korganizerPrinterrcStr
))
{
...
...
@@ -117,7 +117,7 @@ void ImportCalendarJobInterface::restoreConfig()
const
QString
korganizerStr
(
QStringLiteral
(
"korganizerrc"
));
const
KArchiveEntry
*
korganizerrcentry
=
mArchiveDirectory
->
entry
(
Utils
::
configsPath
()
+
korganizerStr
);
if
(
korganizerrcentry
&&
korganizerrcentry
->
isFile
())
{
const
KArchiveFile
*
korganizerrcFile
=
static_cast
<
const
KArchiveFile
*>
(
korganizerrcentry
);
const
auto
*
korganizerrcFile
=
static_cast
<
const
KArchiveFile
*>
(
korganizerrcentry
);
const
QString
korganizerrc
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
ConfigLocation
)
+
QLatin1Char
(
'/'
)
+
korganizerStr
;
if
(
QFileInfo
::
exists
(
korganizerrc
))
{