Akonadi::ICalImporter Class
| Header: | #include <Akonadi/ICalImporter> |
| CMake: | find_package(KPim6AkonadiCalendar REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendar) |
| Inherits: | QObject |
Public Functions
| ICalImporter(Akonadi::IncidenceChanger *changer = nullptr, QObject *parent = nullptr) | |
| QString & | errorMessage() const |
Public Slots
| bool | importIntoExistingResource(const QUrl &url, Akonadi::Collection collection) |
| bool | importIntoNewResource(const QString &filename) |
Signals
| void | importIntoExistingFinished(bool success, int total) |
| void | importIntoNewFinished(bool success) |
Detailed Description
A class to import ical calendar files into akonadi.
Member Function Documentation
[explicit] ICalImporter::ICalImporter(Akonadi::IncidenceChanger *changer = nullptr, QObject *parent = nullptr)
Constructs a new ICalImporter object. Use a different ICalImporter instance for each file you want to import.
changer An existing IncidenceChanger, if 0, an internal one will be created. If you pass an existing one, you will be able to undo/redo import operations. parent Parent QObject.
QString &ICalImporter::errorMessage() const
Translated error message. This is set when either importIntoExistingFinished() or importIntoNewResource() return false or when the corresponding signals are have success=false.
[signal] void ICalImporter::importIntoExistingFinished(bool success, int total)
Emitted after calling importIntoExistingResource() success Success of the operation. total Number of incidences included in the ical file.
See also importIntoExistingResource() and errorMessage().
[slot] bool ICalImporter::importIntoExistingResource(const QUrl &url, Akonadi::Collection collection)
Imports an ical file into an existing resource. url Path of a local or remote file to import. collectionId The destination collection. If null, the user will be prompted for a destination.
Returns false if some basic validation happened, like insufficient permissions. Use errorMessage() to see what happened. The importIntoExistingFinished() signal won't be emitted in this case.
true if the import job was started. importIntoExistingFinished() signal will be emitted in this case.
[signal] void ICalImporter::importIntoNewFinished(bool success)
Emitted after calling importIntoNewResource(). If success is false, check errorMessage().
[slot] bool ICalImporter::importIntoNewResource(const QString &filename)
Creates a new akonadi_ical_resource and configures it to use filename. filename ical absolute file path Returns True if the job was started, in this case you should wait for the corresponding signal.