Skip to content
GitLab
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
29fbce73
Commit
29fbce73
authored
May 01, 2020
by
Laurent Montel
Browse files
Move method to ResourceConverterBase
parent
2161b5ad
Changes
15
Hide whitespace changes
Inline
Side-by-side
core/addressbook/exportaddressbookjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -114,5 +114,6 @@ void ExportAddressbookJobInterfaceImpl::convertCollectionListToRealPath(KConfigG
Akonadi
::
Collection
::
Id
ExportAddressbookJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/addressbook/importaddressbookjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -127,5 +127,6 @@ void ImportAddressbookJobInterfaceImpl::restoreResources()
Akonadi
::
Collection
::
Id
ImportAddressbookJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/alarm/exportalarmjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -104,5 +104,6 @@ void ExportAlarmJobInterfaceImpl::exportArchiveResource()
Akonadi
::
Collection
::
Id
ExportAlarmJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/alarm/importalarmjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -119,5 +119,6 @@ void ImportAlarmJobInterfaceImpl::restoreResources()
Akonadi
::
Collection
::
Id
ImportAlarmJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/autotests/resourceconvertertest.cpp
View file @
29fbce73
...
...
@@ -32,3 +32,11 @@ QString ResourceConverterTest::convertToFullCollectionPath(const qlonglong colle
qDebug
()
<<
" QString ResourceConverterTest::convertToFullCollectionPath(const qlonglong collectionValue) not implemented yet!"
;
return
QStringLiteral
(
"COLLECTION_CONVERTED"
);
}
Akonadi
::
Collection
::
Id
ResourceConverterTest
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
//TODO implement it
qDebug
()
<<
" Akonadi::Collection::Id ResourceConverterTest::convertFolderPathToCollectionId(const QString &path) not implemented yet"
;
return
-
1
;
}
core/autotests/resourceconvertertest.h
View file @
29fbce73
...
...
@@ -28,6 +28,8 @@ public:
ResourceConverterTest
();
~
ResourceConverterTest
()
override
;
Q_REQUIRED_RESULT
QString
convertToFullCollectionPath
(
const
qlonglong
collectionValue
)
override
;
Q_REQUIRED_RESULT
Akonadi
::
Collection
::
Id
convertFolderPathToCollectionId
(
const
QString
&
path
)
override
;
};
#endif // RESOURCECONVERTERTEST_H
core/calendar/exportcalendarjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -51,7 +51,8 @@ void ExportCalendarJobInterfaceImpl::exportArchiveResource()
Akonadi
::
Collection
::
Id
ExportCalendarJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
void
ExportCalendarJobInterfaceImpl
::
slotCalendarJobTerminated
()
...
...
core/calendar/importcalendarjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -57,7 +57,8 @@ ImportCalendarJobInterfaceImpl::~ImportCalendarJobInterfaceImpl()
Akonadi
::
Collection
::
Id
ImportCalendarJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
void
ImportCalendarJobInterfaceImpl
::
restoreResources
()
...
...
core/mail/exportmailjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -157,7 +157,8 @@ void ExportMailJobInterfaceImpl::backupResources()
Akonadi
::
Collection
::
Id
ExportMailJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
void
ExportMailJobInterfaceImpl
::
convertCollectionIdsToRealPath
(
KConfigGroup
&
group
,
const
QString
&
currentKey
,
const
QString
&
prefixCollection
)
...
...
core/mail/importmailjobinterface.cpp
View file @
29fbce73
...
...
@@ -529,7 +529,8 @@ void ImportMailJobInterface::restoreResources()
Collection
::
Id
ImportMailJobInterface
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
void
ImportMailJobInterface
::
restoreMails
()
...
...
core/notes/exportnotesjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -105,5 +105,6 @@ void ExportNotesJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &s
Akonadi
::
Collection
::
Id
ExportNotesJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/notes/importnotesjobinterfaceimpl.cpp
View file @
29fbce73
...
...
@@ -115,5 +115,6 @@ void ImportNotesJobInterfaceImpl::restoreResources()
Akonadi
::
Collection
::
Id
ImportNotesJobInterfaceImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
ResourceConverterImpl
converter
;
return
converter
.
convertFolderPathToCollectionId
(
path
);
}
core/resourceconverterbase.h
View file @
29fbce73
...
...
@@ -23,6 +23,7 @@
#include
"pimdataexporter_export.h"
#include
<QString>
#include
<KSharedConfig>
#include
<AkonadiCore/Collection>
class
PIMDATAEXPORTER_EXPORT
ResourceConverterBase
{
public:
...
...
@@ -36,6 +37,7 @@ public:
Q_REQUIRED_RESULT
QString
resourcePath
(
const
KSharedConfigPtr
&
resourceConfig
,
const
QString
&
defaultPath
=
QString
());
Q_REQUIRED_RESULT
QString
adaptResourcePath
(
const
KSharedConfigPtr
&
resourceConfig
,
const
QString
&
storedData
);
virtual
Q_REQUIRED_RESULT
QString
convertToFullCollectionPath
(
const
qlonglong
collectionValue
)
=
0
;
virtual
Q_REQUIRED_RESULT
Akonadi
::
Collection
::
Id
convertFolderPathToCollectionId
(
const
QString
&
path
)
=
0
;
};
#endif // RESOURCECONVERTER_H
core/resourceconverterimpl.cpp
View file @
29fbce73
...
...
@@ -32,3 +32,8 @@ QString ResourceConverterImpl::convertToFullCollectionPath(const qlonglong colle
{
return
MailCommon
::
Util
::
fullCollectionPath
(
Akonadi
::
Collection
(
collectionValue
));
}
Akonadi
::
Collection
::
Id
ResourceConverterImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
{
return
MailCommon
::
Util
::
convertFolderPathToCollectionId
(
path
);
}
core/resourceconverterimpl.h
View file @
29fbce73
...
...
@@ -28,6 +28,7 @@ public:
ResourceConverterImpl
();
~
ResourceConverterImpl
()
override
;
Q_REQUIRED_RESULT
QString
convertToFullCollectionPath
(
const
qlonglong
collectionValue
)
override
;
Q_REQUIRED_RESULT
Akonadi
::
Collection
::
Id
convertFolderPathToCollectionId
(
const
QString
&
path
)
override
;
};
#endif // RESOURCECONVERTERIMPL_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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