File indexing completed on 2025-07-13 04:54:02

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "importnotesjobinterfaceimpl.h"
0008 #include "archivestorage.h"
0009 #include <MailCommon/MailUtil>
0010 #include <PimCommonAkonadi/CreateResource>
0011 
0012 #include <KArchive>
0013 
0014 #include "resourceconverterimpl.h"
0015 #include <QStandardPaths>
0016 
0017 ImportNotesJobInterfaceImpl::ImportNotesJobInterfaceImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
0018     : ImportNotesJobInterface(parent, typeSelected, archiveStorage, numberOfStep)
0019 {
0020     initializeImportJob();
0021 }
0022 
0023 ImportNotesJobInterfaceImpl::~ImportNotesJobInterfaceImpl() = default;
0024 
0025 QString ImportNotesJobInterfaceImpl::adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData)
0026 {
0027     ResourceConverterImpl converter;
0028     return converter.adaptResourcePath(resourceConfig, storedData);
0029 }
0030 
0031 Akonadi::Collection::Id ImportNotesJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
0032 {
0033     ResourceConverterImpl converter;
0034     return converter.convertFolderPathToCollectionId(path);
0035 }
0036 
0037 QString
0038 ImportNotesJobInterfaceImpl::createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree)
0039 {
0040     return mCreateResource->createResource(resources, name, settings, synchronizeTree);
0041 }
0042 
0043 void ImportNotesJobInterfaceImpl::synchronizeResource(const QStringList &lst)
0044 {
0045     // It's maildir support. Need to add support
0046     startSynchronizeResources(lst);
0047 }
0048 
0049 QString ImportNotesJobInterfaceImpl::adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath)
0050 {
0051     ResourceConverterImpl converter;
0052     return converter.adaptNewResourceUrl(overwriteResources, resourceConfig, storePath);
0053 }
0054 
0055 #include "moc_importnotesjobinterfaceimpl.cpp"