Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PIM Data Exporter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
PIM Data Exporter
Commits
6ee416c0
Commit
6ee416c0
authored
Jan 25, 2018
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QLatin1String
parent
54c83bcb
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
49 deletions
+49
-49
core/addressbook/exportaddressbookjob.cpp
core/addressbook/exportaddressbookjob.cpp
+2
-2
core/addressbook/importaddressbookjob.cpp
core/addressbook/importaddressbookjob.cpp
+8
-8
core/alarm/exportalarmjob.cpp
core/alarm/exportalarmjob.cpp
+2
-2
core/alarm/importalarmjob.cpp
core/alarm/importalarmjob.cpp
+5
-5
core/calendar/exportcalendarjob.cpp
core/calendar/exportcalendarjob.cpp
+2
-2
core/calendar/importcalendarjob.cpp
core/calendar/importcalendarjob.cpp
+6
-6
core/mail/exportmailjob.cpp
core/mail/exportmailjob.cpp
+11
-11
core/mail/importmailjob.cpp
core/mail/importmailjob.cpp
+11
-11
core/notes/exportnotesjob.cpp
core/notes/exportnotesjob.cpp
+1
-1
core/notes/importnotesjob.cpp
core/notes/importnotesjob.cpp
+1
-1
No files found.
core/addressbook/exportaddressbookjob.cpp
View file @
6ee416c0
...
...
@@ -90,7 +90,7 @@ void ExportAddressbookJob::slotWriteNextArchiveResource()
if
(
mIndexIdentifier
<
list
.
count
())
{
Akonadi
::
AgentInstance
agent
=
list
.
at
(
mIndexIdentifier
);
const
QString
identifier
=
agent
.
identifier
();
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_vcarddir_resource_"
))
||
identifier
.
contains
(
QStringLiteral
(
"akonadi_contacts_resource_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_vcarddir_resource_"
))
||
identifier
.
contains
(
QLatin1String
(
"akonadi_contacts_resource_"
)))
{
const
QString
archivePath
=
Utils
::
addressbookPath
()
+
identifier
+
QDir
::
separator
();
QString
url
=
Utils
::
resourcePath
(
agent
,
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericDataLocation
)
+
QStringLiteral
(
"/share/contacts/"
));
...
...
@@ -114,7 +114,7 @@ void ExportAddressbookJob::slotWriteNextArchiveResource()
}
else
{
QTimer
::
singleShot
(
0
,
this
,
&
ExportAddressbookJob
::
slotAddressbookJobTerminated
);
}
}
else
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_vcard_resource_"
)))
{
}
else
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_vcard_resource_"
)))
{
backupResourceFile
(
agent
,
Utils
::
addressbookPath
());
QTimer
::
singleShot
(
0
,
this
,
&
ExportAddressbookJob
::
slotAddressbookJobTerminated
);
}
else
{
...
...
core/addressbook/importaddressbookjob.cpp
View file @
6ee416c0
...
...
@@ -93,8 +93,8 @@ void ImportAddressbookJob::restoreResources()
for
(
int
i
=
0
;
i
<
numberOfResourceFile
;
++
i
)
{
resourceFiles
value
=
mListResourceFile
.
at
(
i
);
QMap
<
QString
,
QVariant
>
settings
;
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_vcarddir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_contacts_resource_"
)))
{
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_vcarddir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_contacts_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
...
...
@@ -113,7 +113,7 @@ void ImportAddressbookJob::restoreResources()
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
//TODO adapt directory name too
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_contacts_resource_"
)));
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_contacts_resource_"
)));
}
settings
.
insert
(
QStringLiteral
(
"Path"
),
newUrl
);
...
...
@@ -128,9 +128,9 @@ void ImportAddressbookJob::restoreResources()
}
}
QString
instanceType
;
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_vcarddir_resource_"
)))
{
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_vcarddir_resource_"
)))
{
instanceType
=
QStringLiteral
(
"akonadi_vcarddir_resource"
);
}
else
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_contacts_resource_"
)))
{
}
else
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_contacts_resource_"
)))
{
instanceType
=
QStringLiteral
(
"akonadi_contacts_resource"
);
}
else
{
qCDebug
(
PIMSETTINGEXPORTERCORE_LOG
)
<<
" not supported"
<<
value
.
akonadiConfigFile
;
...
...
@@ -168,9 +168,9 @@ void ImportAddressbookJob::addSpecificResourceSettings(KSharedConfig::Ptr resour
bool
ImportAddressbookJob
::
isAConfigFile
(
const
QString
&
name
)
const
{
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
StringLiteral
(
"akonadi_vcarddir_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_vcard_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_contacts_resource_"
)));
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
Latin1String
(
"akonadi_vcarddir_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_vcard_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_contacts_resource_"
)));
}
void
ImportAddressbookJob
::
restoreConfig
()
...
...
core/alarm/exportalarmjob.cpp
View file @
6ee416c0
...
...
@@ -91,7 +91,7 @@ void ExportAlarmJob::slotWriteNextArchiveResource()
if
(
mIndexIdentifier
<
list
.
count
())
{
Akonadi
::
AgentInstance
agent
=
list
.
at
(
mIndexIdentifier
);
const
QString
identifier
=
agent
.
identifier
();
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_dir_resource_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_dir_resource_"
)))
{
const
QString
archivePath
=
Utils
::
alarmPath
()
+
identifier
+
QDir
::
separator
();
QString
url
=
Utils
::
resourcePath
(
agent
);
...
...
@@ -115,7 +115,7 @@ void ExportAlarmJob::slotWriteNextArchiveResource()
}
else
{
QTimer
::
singleShot
(
0
,
this
,
&
ExportAlarmJob
::
slotAlarmJobTerminated
);
}
}
else
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_resource_"
)))
{
}
else
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_resource_"
)))
{
backupResourceFile
(
agent
,
Utils
::
alarmPath
());
QTimer
::
singleShot
(
0
,
this
,
&
ExportAlarmJob
::
slotAlarmJobTerminated
);
}
else
{
...
...
core/alarm/importalarmjob.cpp
View file @
6ee416c0
...
...
@@ -94,8 +94,8 @@ void ImportAlarmJob::restoreResources()
for
(
int
i
=
0
;
i
<
numberOfResourceFile
;
++
i
)
{
resourceFiles
value
=
mListResourceFile
.
at
(
i
);
QMap
<
QString
,
QVariant
>
settings
;
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_dir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_resource_"
)))
{
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_dir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
...
...
@@ -112,7 +112,7 @@ void ImportAlarmJob::restoreResources()
QFileInfo
newUrlInfo
(
newUrl
);
const
QString
dataFile
=
value
.
akonadiResources
;
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
bool
isDirResource
=
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_dir_resource_"
));
bool
isDirResource
=
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_dir_resource_"
));
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
//TODO adapt directory name too
...
...
@@ -145,8 +145,8 @@ void ImportAlarmJob::restoreResources()
bool
ImportAlarmJob
::
isAConfigFile
(
const
QString
&
name
)
const
{
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_kalarm_dir_resource_"
)));
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_kalarm_dir_resource_"
)));
}
void
ImportAlarmJob
::
restoreConfig
()
...
...
core/calendar/exportcalendarjob.cpp
View file @
6ee416c0
...
...
@@ -92,7 +92,7 @@ void ExportCalendarJob::slotWriteNextArchiveResource()
if
(
mIndexIdentifier
<
list
.
count
())
{
Akonadi
::
AgentInstance
agent
=
list
.
at
(
mIndexIdentifier
);
const
QString
identifier
=
agent
.
identifier
();
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_icaldir_resource_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_icaldir_resource_"
)))
{
const
QString
archivePath
=
Utils
::
calendarPath
()
+
identifier
+
QDir
::
separator
();
QString
url
=
Utils
::
resourcePath
(
agent
);
...
...
@@ -116,7 +116,7 @@ void ExportCalendarJob::slotWriteNextArchiveResource()
}
else
{
QTimer
::
singleShot
(
0
,
this
,
&
ExportCalendarJob
::
slotCalendarJobTerminated
);
}
}
else
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_ical_resource_"
)))
{
}
else
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_ical_resource_"
)))
{
backupResourceFile
(
agent
,
Utils
::
calendarPath
());
QTimer
::
singleShot
(
0
,
this
,
&
ExportCalendarJob
::
slotCalendarJobTerminated
);
}
else
{
...
...
core/calendar/importcalendarjob.cpp
View file @
6ee416c0
...
...
@@ -98,8 +98,8 @@ void ImportCalendarJob::restoreResources()
for
(
int
i
=
0
;
i
<
numberOfResourceFile
;
++
i
)
{
resourceFiles
value
=
mListResourceFile
.
at
(
i
);
QMap
<
QString
,
QVariant
>
settings
;
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_icaldir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_ical_resource_"
)))
{
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_icaldir_resource_"
))
||
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_ical_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
...
...
@@ -119,11 +119,11 @@ void ImportCalendarJob::restoreResources()
const
QString
dataFile
=
value
.
akonadiResources
;
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
bool
isDirResource
=
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_icaldir_resource_"
));
bool
isDirResource
=
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_icaldir_resource_"
));
if
(
dataResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
dataResouceEntry
);
//TODO adapt directory name too
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_icaldir_resource_"
)));
extractZipFile
(
file
,
copyToDirName
,
newUrlInfo
.
path
(),
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_icaldir_resource_"
)));
}
settings
.
insert
(
QStringLiteral
(
"Path"
),
newUrl
);
...
...
@@ -168,8 +168,8 @@ void ImportCalendarJob::addSpecificResourceSettings(KSharedConfig::Ptr resourceC
bool
ImportCalendarJob
::
isAConfigFile
(
const
QString
&
name
)
const
{
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
StringLiteral
(
"akonadi_ical_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_icaldir_resource_"
)));
return
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
Latin1String
(
"akonadi_ical_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_icaldir_resource_"
)));
}
void
ImportCalendarJob
::
restoreConfig
()
...
...
core/mail/exportmailjob.cpp
View file @
6ee416c0
...
...
@@ -146,12 +146,12 @@ void ExportMailJob::slotWriteNextArchiveResource()
const
Akonadi
::
AgentInstance
agent
=
list
.
at
(
mIndexIdentifier
);
const
QStringList
capabilities
(
agent
.
type
().
capabilities
());
if
(
agent
.
type
().
mimeTypes
().
contains
(
KMime
::
Message
::
mimeType
()))
{
if
(
capabilities
.
contains
(
Q
StringLiteral
(
"Resource"
))
&&
!
capabilities
.
contains
(
Q
StringLiteral
(
"Virtual"
))
&&
!
capabilities
.
contains
(
Q
StringLiteral
(
"MailTransport"
)))
{
if
(
capabilities
.
contains
(
Q
Latin1String
(
"Resource"
))
&&
!
capabilities
.
contains
(
Q
Latin1String
(
"Virtual"
))
&&
!
capabilities
.
contains
(
Q
Latin1String
(
"MailTransport"
)))
{
const
QString
identifier
=
agent
.
identifier
();
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_maildir_resource_"
))
||
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_mixedmaildir_resource_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_maildir_resource_"
))
||
identifier
.
contains
(
Q
Latin1String
(
"akonadi_mixedmaildir_resource_"
)))
{
const
QString
archivePath
=
Utils
::
mailsPath
()
+
identifier
+
QDir
::
separator
();
const
QString
url
=
Utils
::
resourcePath
(
agent
);
...
...
@@ -176,7 +176,7 @@ void ExportMailJob::slotWriteNextArchiveResource()
}
else
{
QTimer
::
singleShot
(
0
,
this
,
&
ExportMailJob
::
slotMailsJobTerminated
);
}
}
else
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_mbox_resource_"
)))
{
}
else
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_mbox_resource_"
)))
{
backupResourceFile
(
agent
,
Utils
::
addressbookPath
());
QTimer
::
singleShot
(
0
,
this
,
&
ExportMailJob
::
slotMailsJobTerminated
);
}
else
{
...
...
@@ -241,13 +241,13 @@ void ExportMailJob::backupResources()
for
(
const
Akonadi
::
AgentInstance
&
agent
:
list
)
{
const
QStringList
capabilities
(
agent
.
type
().
capabilities
());
if
(
agent
.
type
().
mimeTypes
().
contains
(
KMime
::
Message
::
mimeType
()))
{
if
(
capabilities
.
contains
(
Q
StringLiteral
(
"Resource"
))
&&
!
capabilities
.
contains
(
Q
StringLiteral
(
"Virtual"
))
&&
!
capabilities
.
contains
(
Q
StringLiteral
(
"MailTransport"
)))
{
if
(
capabilities
.
contains
(
Q
Latin1String
(
"Resource"
))
&&
!
capabilities
.
contains
(
Q
Latin1String
(
"Virtual"
))
&&
!
capabilities
.
contains
(
Q
Latin1String
(
"MailTransport"
)))
{
const
QString
identifier
=
agent
.
identifier
();
//Store just pop3/imap/kolab/gmail account. Store other config when we copy data.
if
(
identifier
.
contains
(
Q
StringLiteral
(
"pop3"
))
||
identifier
.
contains
(
QStringLiteral
(
"imap"
))
||
identifier
.
contains
(
Q
StringLiteral
(
"_kolab_"
))
||
identifier
.
contains
(
QStringLiteral
(
"_gmail_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"pop3"
))
||
identifier
.
contains
(
QLatin1String
(
"imap"
))
||
identifier
.
contains
(
Q
Latin1String
(
"_kolab_"
))
||
identifier
.
contains
(
QLatin1String
(
"_gmail_"
)))
{
const
QString
errorStr
=
Utils
::
storeResources
(
archive
(),
identifier
,
Utils
::
resourcesPath
());
if
(
!
errorStr
.
isEmpty
())
{
Q_EMIT
error
(
errorStr
);
...
...
core/mail/importmailjob.cpp
View file @
6ee416c0
...
...
@@ -138,9 +138,9 @@ void ImportMailJob::storeMailArchiveResource(const KArchiveDirectory *dir, const
resourceFiles
files
;
for
(
const
QString
&
name
:
lst
)
{
if
(
name
.
endsWith
(
QLatin1String
(
"rc"
))
&&
(
name
.
contains
(
Q
StringLiteral
(
"akonadi_mbox_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_mixedmaildir_resource_"
))
||
name
.
contains
(
Q
StringLiteral
(
"akonadi_maildir_resource_"
))))
{
&&
(
name
.
contains
(
Q
Latin1String
(
"akonadi_mbox_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_mixedmaildir_resource_"
))
||
name
.
contains
(
Q
Latin1String
(
"akonadi_maildir_resource_"
))))
{
files
.
akonadiConfigFile
=
archPath
+
name
;
}
else
if
(
name
.
startsWith
(
Utils
::
prefixAkonadiConfigFile
()))
{
files
.
akonadiAgentConfigFile
=
archPath
+
name
;
...
...
@@ -273,7 +273,7 @@ void ImportMailJob::restoreResources()
const
QString
resourceFileName
=
destDirectory
+
QLatin1Char
(
'/'
)
+
filename
;
KSharedConfig
::
Ptr
resourceConfig
=
KSharedConfig
::
openConfig
(
resourceFileName
);
QMap
<
QString
,
QVariant
>
settings
;
if
(
filename
.
contains
(
Q
StringLiteral
(
"pop3"
)))
{
if
(
filename
.
contains
(
Q
Latin1String
(
"pop3"
)))
{
KConfigGroup
general
=
resourceConfig
->
group
(
QStringLiteral
(
"General"
));
if
(
general
.
hasKey
(
QStringLiteral
(
"login"
)))
{
settings
.
insert
(
QStringLiteral
(
"Login"
),
general
.
readEntry
(
"login"
));
...
...
@@ -349,7 +349,7 @@ void ImportMailJob::restoreResources()
mHashResources
.
insert
(
filename
,
newResource
);
infoAboutNewResource
(
newResource
);
}
}
else
if
(
filename
.
contains
(
Q
StringLiteral
(
"imap"
))
||
filename
.
contains
(
QStringLiteral
(
"kolab_"
))
||
filename
.
contains
(
QStringLiteral
(
"gmail_"
)))
{
}
else
if
(
filename
.
contains
(
Q
Latin1String
(
"imap"
))
||
filename
.
contains
(
QLatin1String
(
"kolab_"
))
||
filename
.
contains
(
QLatin1String
(
"gmail_"
)))
{
KConfigGroup
network
=
resourceConfig
->
group
(
QStringLiteral
(
"network"
));
if
(
network
.
hasKey
(
QStringLiteral
(
"Authentication"
)))
{
settings
.
insert
(
QStringLiteral
(
"Authentication"
),
network
.
readEntry
(
"Authentication"
,
1
));
...
...
@@ -440,9 +440,9 @@ void ImportMailJob::restoreResources()
}
QString
newResource
;
if
(
filename
.
contains
(
Q
StringLiteral
(
"kolab_"
)))
{
if
(
filename
.
contains
(
Q
Latin1String
(
"kolab_"
)))
{
newResource
=
mCreateResource
->
createResource
(
QStringLiteral
(
"akonadi_kolab_resource"
),
filename
,
settings
);
}
else
if
(
filename
.
contains
(
Q
StringLiteral
(
"gmail_"
)))
{
}
else
if
(
filename
.
contains
(
Q
Latin1String
(
"gmail_"
)))
{
newResource
=
mCreateResource
->
createResource
(
QStringLiteral
(
"akonadi_gmail_resource"
),
filename
,
settings
);
}
else
{
newResource
=
mCreateResource
->
createResource
(
QStringLiteral
(
"akonadi_imap_resource"
),
filename
,
settings
);
...
...
@@ -501,7 +501,7 @@ void ImportMailJob::restoreMails()
}
QMap
<
QString
,
QVariant
>
settings
;
if
(
resourceName
.
contains
(
Q
StringLiteral
(
"akonadi_mbox_resource_"
)))
{
if
(
resourceName
.
contains
(
Q
Latin1String
(
"akonadi_mbox_resource_"
)))
{
const
QString
dataFile
=
value
.
akonadiResources
;
const
KArchiveEntry
*
dataResouceEntry
=
mArchiveDirectory
->
entry
(
dataFile
);
if
(
dataResouceEntry
->
isFile
())
{
...
...
@@ -544,8 +544,8 @@ void ImportMailJob::restoreMails()
mHashResources
.
insert
(
filename
,
newResource
);
infoAboutNewResource
(
newResource
);
}
}
else
if
(
resourceName
.
contains
(
Q
StringLiteral
(
"akonadi_maildir_resource_"
))
||
resourceName
.
contains
(
Q
StringLiteral
(
"akonadi_mixedmaildir_resource_"
)))
{
}
else
if
(
resourceName
.
contains
(
Q
Latin1String
(
"akonadi_maildir_resource_"
))
||
resourceName
.
contains
(
Q
Latin1String
(
"akonadi_mixedmaildir_resource_"
)))
{
settings
.
insert
(
QStringLiteral
(
"Path"
),
newUrl
);
KConfigGroup
general
=
resourceConfig
->
group
(
QStringLiteral
(
"General"
));
if
(
general
.
hasKey
(
QStringLiteral
(
"TopLevelIsContainer"
)))
{
...
...
@@ -558,7 +558,7 @@ void ImportMailJob::restoreMails()
settings
.
insert
(
QStringLiteral
(
"MonitorFilesystem"
),
general
.
readEntry
(
QStringLiteral
(
"MonitorFilesystem"
),
true
));
}
const
QString
newResource
=
mCreateResource
->
createResource
(
resourceName
.
contains
(
Q
StringLiteral
(
"akonadi_mixedmaildir_resource_"
))
const
QString
newResource
=
mCreateResource
->
createResource
(
resourceName
.
contains
(
Q
Latin1String
(
"akonadi_mixedmaildir_resource_"
))
?
QStringLiteral
(
"akonadi_mixedmaildir_resource"
)
:
QStringLiteral
(
"akonadi_maildir_resource"
),
filename
,
settings
);
...
...
core/notes/exportnotesjob.cpp
View file @
6ee416c0
...
...
@@ -104,7 +104,7 @@ void ExportNotesJob::slotWriteNextArchiveResource()
if
(
mIndexIdentifier
<
list
.
count
())
{
Akonadi
::
AgentInstance
agent
=
list
.
at
(
mIndexIdentifier
);
const
QString
identifier
=
agent
.
identifier
();
if
(
identifier
.
contains
(
Q
StringLiteral
(
"akonadi_akonotes_resource_"
)))
{
if
(
identifier
.
contains
(
Q
Latin1String
(
"akonadi_akonotes_resource_"
)))
{
const
QString
archivePath
=
Utils
::
notePath
()
+
identifier
+
QDir
::
separator
();
QString
url
=
Utils
::
resourcePath
(
agent
);
...
...
core/notes/importnotesjob.cpp
View file @
6ee416c0
...
...
@@ -146,7 +146,7 @@ void ImportNotesJob::restoreResources()
for
(
int
i
=
0
;
i
<
numberOfResourceFile
;
++
i
)
{
resourceFiles
value
=
mListResourceFile
.
at
(
i
);
QMap
<
QString
,
QVariant
>
settings
;
if
(
value
.
akonadiConfigFile
.
contains
(
Q
StringLiteral
(
"akonadi_akonotes_resource_"
)))
{
if
(
value
.
akonadiConfigFile
.
contains
(
Q
Latin1String
(
"akonadi_akonotes_resource_"
)))
{
const
KArchiveEntry
*
fileResouceEntry
=
mArchiveDirectory
->
entry
(
value
.
akonadiConfigFile
);
if
(
fileResouceEntry
&&
fileResouceEntry
->
isFile
())
{
const
KArchiveFile
*
file
=
static_cast
<
const
KArchiveFile
*>
(
fileResouceEntry
);
...
...
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