Commit 3525feed authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix export config file

parent 50124178
......@@ -29,7 +29,6 @@
#include <QFile>
#include <QDir>
#include <QStandardPaths>
#include "resourceconverterimpl.h"
ExportAlarmJobInterface::ExportAlarmJobInterface(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
......@@ -134,8 +133,7 @@ void ExportAlarmJobInterface::backupConfig()
if (kalarmConfig->hasGroup(collectionsStr)) {
KConfigGroup group = kalarmConfig->group(collectionsStr);
const QString selectionKey(QStringLiteral("FavoriteCollectionIds"));
ResourceConverterImpl converter;
converter.convertCollectionIdsToRealPath(group, selectionKey);
convertCollectionIdsToRealPath(group, selectionKey);
}
kalarmConfig->sync();
......
......@@ -40,6 +40,7 @@ protected:
virtual Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() = 0;
virtual Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const = 0;
virtual void backupAlarmResourceFile(const QString &agentIdentifier, const QString &defaultPath) = 0;
virtual void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) = 0;
private:
void slotCheckBackupResource();
......
......@@ -88,3 +88,10 @@ QString ExportAlarmJobInterfaceImpl::createResource(const QString &resources, co
Q_UNREACHABLE();
return {};
}
void ExportAlarmJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr)
{
ResourceConverterImpl converter;
return converter.convertCollectionIdsToRealPath(selectFolderNoteGroup, selectFolderNoteGroupStr);
}
......@@ -40,6 +40,7 @@ protected:
void backupAlarmResourceFile(const QString &agentIdentifier, const QString &defaultPath) override;
Q_REQUIRED_RESULT QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override;
Q_REQUIRED_RESULT QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree) override;
void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) override;
};
#endif // EXPORTALARMJOBINTERFACEIMPL_H
[$Version]
update_info=kalarm.upd:1.9.5,kalarm.upd:1.9.9,kalarm.upd:1.9.12,kalarm.upd:2.0.0,kalarm.upd:2.0.2,kalarm.upd:2.1.5,kalarm.upd:2.3.2
[AgentTypeDialog]
Size=460,320
[Collections]
FavoriteCollectionIds=2635,2634,2632
FavoriteCollectionLabels=Active Alarms,Alarm Templates,Archived Alarms
[General]
AutoStart=true
Backend=Akonadi
Version=3.0.0A
[MainWindow]
Splitter 1920=143
State=AAAA/wAAAAD9AAAAAAAAAoAAAAGdAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA
ToolBarsMovable=Disabled
[Migratekde4]
Version=1
[Notification Messages]
AskAutoStart=
ConfirmAlarmDeletion=true
EmailQueuedNotify=false
QuitWarn=
noWritableCal=false
[View]
ShowArchivedAlarms=true
ShowResources=true
......@@ -3,3 +3,4 @@ alarm/akonadi_kalarm_dir_resource_2/akonadi_kalarm_dir_resource_2rc
alarm/akonadi_kalarm_dir_resource_2/alarm.zip
information/VERSION_2
information/exportdatatype.xml
configs/kalarmrc
[$Version]
update_info=kalarm.upd:1.9.5,kalarm.upd:1.9.9,kalarm.upd:1.9.12,kalarm.upd:2.0.0,kalarm.upd:2.0.2,kalarm.upd:2.1.5,kalarm.upd:2.3.2
[AgentTypeDialog]
Size=460,320
[Collections]
FavoriteCollectionIds=foo/bla bla/bli2635,foo/bla bla/bli2634,foo/bla bla/bli2632
FavoriteCollectionLabels=Active Alarms,Alarm Templates,Archived Alarms
[General]
AutoStart=true
Backend=Akonadi
Version=3.0.0A
[MainWindow]
Splitter 1920=143
State=AAAA/wAAAAD9AAAAAAAAAoAAAAGdAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA
ToolBarsMovable=Disabled
[Migratekde4]
Version=1
[Notification Messages]
AskAutoStart=
ConfirmAlarmDeletion=true
EmailQueuedNotify=false
QuitWarn=
noWritableCal=false
[View]
ShowArchivedAlarms=true
ShowResources=true
[$Version]
update_info=kalarm.upd:1.9.5,kalarm.upd:1.9.9,kalarm.upd:1.9.12,kalarm.upd:2.0.0,kalarm.upd:2.0.2,kalarm.upd:2.1.5,kalarm.upd:2.3.2
[AgentTypeDialog]
Size=460,320
[Collections]
FavoriteCollectionIds=2635,2634,2632
FavoriteCollectionLabels=Active Alarms,Alarm Templates,Archived Alarms
[General]
AutoStart=true
Backend=Akonadi
Version=3.0.0A
[MainWindow]
Splitter 1920=143
State=AAAA/wAAAAD9AAAAAAAAAoAAAAGdAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA
ToolBarsMovable=Disabled
[Migratekde4]
Version=1
[Notification Messages]
AskAutoStart=
ConfirmAlarmDeletion=true
EmailQueuedNotify=false
QuitWarn=
noWritableCal=false
[View]
ShowArchivedAlarms=true
ShowResources=true
information/VERSION_2
information/exportdatatype.xml
configs/kalarmrc
[$Version]
update_info=kalarm.upd:1.9.5,kalarm.upd:1.9.9,kalarm.upd:1.9.12,kalarm.upd:2.0.0,kalarm.upd:2.0.2,kalarm.upd:2.1.5,kalarm.upd:2.3.2
[AgentTypeDialog]
Size=460,320
[Collections]
FavoriteCollectionIds=foo/bla bla/bli2635,foo/bla bla/bli2634,foo/bla bla/bli2632
FavoriteCollectionLabels=Active Alarms,Alarm Templates,Archived Alarms
[General]
AutoStart=true
Backend=Akonadi
Version=3.0.0A
[MainWindow]
Splitter 1920=143
State=AAAA/wAAAAD9AAAAAAAAAoAAAAGdAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAA
ToolBarsMovable=Disabled
[Migratekde4]
Version=1
[Notification Messages]
AskAutoStart=
ConfirmAlarmDeletion=true
EmailQueuedNotify=false
QuitWarn=
noWritableCal=false
[View]
ShowArchivedAlarms=true
ShowResources=true
configs/akonadi_notes_agent.notifyrc
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -85,6 +85,13 @@ QString ExportAlarmJobInterfaceTestImpl::adaptNewResourceUrl(bool overwriteResou
return resourceConverterTest.adaptNewResourceUrl(overwriteResources, resourceConfig, storePath);
}
void ExportAlarmJobInterfaceTestImpl::convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr)
{
ResourceConverterTest resourceConverterTest;
resourceConverterTest.setTestPath(mPathConfig);
return resourceConverterTest.convertCollectionIdsToRealPath(selectFolderNoteGroup, selectFolderNoteGroupStr);
}
QString ExportAlarmJobInterfaceTestImpl::createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree)
{
Q_UNREACHABLE();
......@@ -130,3 +137,4 @@ void ExportAlarmJobInterfaceTest::exportAlarm()
file->start();
delete exportNote;
}
......@@ -39,6 +39,7 @@ protected:
void backupAlarmResourceFile(const QString &agentIdentifier, const QString &defaultPath) override;
Q_REQUIRED_RESULT QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override;
Q_REQUIRED_RESULT QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree) override;
void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) override;
};
class ExportAlarmJobInterfaceTest : public QObject
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment