digiKam
|
Classes | |
class | Private |
Public Types | |
enum | Action { LOAD_METADATA = 0 , LOAD_CHUNKS , APPLY_CHANGES , APPLY_CHANGES_EXV , READ_FORMATS , WRITE_FORMATS , TRANSLATIONS_LIST , TAGS_DATABASE , VERSION_STRING , COPY_TAGS , TRANS_TAGS , NO_ACTION } |
enum | CopyTagsSource { COPY_EXIF = 0x01 , COPY_MAKERNOTES = 0x02 , COPY_IPTC = 0x04 , COPY_XMP = 0x08 , COPY_ICC = 0x10 , COPY_ALL = 0x20 , COPY_NONE = 0x40 } |
enum | TranslateTagsOps { TRANS_ALL_XMP = 0x01 , TRANS_ALL_IPTC = 0x02 , TRANS_ALL_EXIF = 0x04 } |
enum | WritingTagsMode { WRITE_EXISTING_TAGS = 0x01 , CREATE_NEW_TAGS = 0x02 , CREATE_NEW_GROUPS = 0x04 , ALL_MODES } |
Signals | |
void | signalCmdCompleted (int cmdAction, int execTime, const QByteArray &cmdOutputChannel, const QByteArray &cmdErrorChannel) |
void | signalErrorOccurred (int cmdAction, QProcess::ProcessError error) |
void | signalFinished (int cmdAction, int exitCode, QProcess::ExitStatus exitStatus) |
void | signalStarted (int cmdAction) |
void | signalStateChanged (int cmdAction, QProcess::ProcessState newState) |
Public Member Functions | |
bool | checkExifToolProgram () |
int | command (const QByteArrayList &args, Action ac) |
QProcess::ProcessError | error () const |
QString | errorString () const |
ExifToolProcess (QObject *const parent) | |
int | exitCode () const |
QProcess::ExitStatus | exitStatus () const |
bool | isBusy () const |
bool | isRunning () const |
void | kill () |
qint64 | processId () const |
QString | program () const |
void | setProgram (const QString &etExePath, const QString &perlExePath=QString()) |
bool | start () |
QProcess::ProcessState | state () const |
void | terminate () |
bool | waitForFinished (int msecs=30000) const |
bool | waitForStarted (int msecs=30000) const |
~ExifToolProcess () | |
ExifTool actions to process.
Enumerator | |
---|---|
LOAD_METADATA | Load all metadata from a file with ExifTool. |
LOAD_CHUNKS | Load Exif, Iptc, and Xmp chunks from a file as byte-array for MetaEngine. |
APPLY_CHANGES | Apply tag changes in a file with ExifTool. |
APPLY_CHANGES_EXV | Apply tag changes in a file with ExifTool using an EXV container. |
READ_FORMATS | Return the list of readable ExifTool file formats. |
WRITE_FORMATS | Return the list of writable ExifTool file formats. |
TRANSLATIONS_LIST | List of ExifTool languages available for translations. |
TAGS_DATABASE | List of ExifTool tags from database. |
VERSION_STRING | Return the ExifTool version as string. |
COPY_TAGS | Copy tags from one file to another one. See CopyTagsSource enum for details. |
TRANS_TAGS | Translate tags in file. See TranslateTagsOps enum for details. |
NO_ACTION | Last value from this list. Do nothing. |
Possible copying tags operations to OR combine with COPY_TAGS action.
|
explicit |
Constructs a ExifToolProcess object with the given parent.
References Digikam::adjustedEnvironmentForAppImage(), and Digikam::ExifToolProcess::Private::process.
Digikam::ExifToolProcess::~ExifToolProcess | ( | ) |
Destructs the ExifToolProcess object, i.e., killing the process. Note that this function will not return until the process is terminated.
References terminate().
bool Digikam::ExifToolProcess::checkExifToolProgram | ( | ) |
int Digikam::ExifToolProcess::command | ( | const QByteArrayList & | args, |
Action | ac | ||
) |
Send a command to exiftool process Return 0: ExitTool not running, write channel is closed or args is empty
References Digikam::ExifToolProcess::Private::CMD_ID_MAX, Digikam::ExifToolProcess::Private::CMD_ID_MIN, Digikam::ExifToolProcess::Private::cmdQueue, Digikam::ExifToolProcess::Private::execNextCmd(), Digikam::ExifToolProcess::Private::process, Digikam::ExifToolProcess::Private::s_cmdIdMutex, Digikam::ExifToolProcess::Private::s_nextCmdId, and Digikam::ExifToolProcess::Private::writeChannelIsClosed.
Referenced by Digikam::ExifToolProcess::Private::execNextCmd().
QProcess::ProcessError Digikam::ExifToolProcess::error | ( | ) | const |
Returns the type of error that occurred last.
References Digikam::ExifToolProcess::Private::processError.
Referenced by Digikam::ExifToolProcess::Private::setProcessErrorAndEmit().
QString Digikam::ExifToolProcess::errorString | ( | ) | const |
Returns an error message.
References Digikam::ExifToolProcess::Private::errorString.
Referenced by Digikam::ExifToolParser::currentErrorString(), and Digikam::ExifToolProcess::Private::setProcessErrorAndEmit().
int Digikam::ExifToolProcess::exitCode | ( | ) | const |
QProcess::ExitStatus Digikam::ExifToolProcess::exitStatus | ( | ) | const |
Returns the exit status of the last process that finished.
References Digikam::ExifToolProcess::Private::process.
bool Digikam::ExifToolProcess::isBusy | ( | ) | const |
Returns true if a command is running
References Digikam::ExifToolProcess::Private::cmdRunning.
bool Digikam::ExifToolProcess::isRunning | ( | ) | const |
Returns true if ExifToolProcess is running (process state == Running)
References Digikam::ExifToolProcess::Private::process.
void Digikam::ExifToolProcess::kill | ( | ) |
Kills the current process, causing it to exit immediately. On Windows, kill() uses TerminateProcess, and on Unix and macOS, the SIGKILL signal is sent to the process.
References Digikam::ExifToolProcess::Private::process.
Referenced by terminate().
qint64 Digikam::ExifToolProcess::processId | ( | ) | const |
Returns the native process identifier for the running process, if available. If no process is currently running, 0 is returned.
References Digikam::ExifToolProcess::Private::process.
QString Digikam::ExifToolProcess::program | ( | ) | const |
References Digikam::ExifToolProcess::Private::etExePath.
Referenced by start().
void Digikam::ExifToolProcess::setProgram | ( | const QString & | etExePath, |
const QString & | perlExePath = QString() |
||
) |
Setup the ExifTool configuration. This function must be called before start().
References Digikam::ExifToolProcess::Private::etExePath, Digikam::ExifToolProcess::Private::perlExePath, and Digikam::ExifToolProcess::Private::process.
Referenced by Digikam::ExifToolParser::setExifToolProgram().
|
signal |
Referenced by Digikam::ExifToolParser::ExifToolParser().
|
signal |
Referenced by Digikam::ExifToolParser::ExifToolParser().
|
signal |
Referenced by Digikam::ExifToolParser::ExifToolParser().
|
signal |
|
signal |
bool Digikam::ExifToolProcess::start | ( | ) |
Starts exiftool in a new process.
References checkExifToolProgram(), Digikam::ExifToolProcess::Private::cmdAction, Digikam::ExifToolProcess::Private::cmdQueue, Digikam::ExifToolProcess::Private::cmdRunning, Digikam::ExifToolProcess::Private::errorString, Digikam::ExifToolProcess::Private::etExePath, NO_ACTION, Digikam::ExifToolProcess::Private::perlExePath, Digikam::ExifToolProcess::Private::process, Digikam::ExifToolProcess::Private::processError, program(), DigikamGenericRajcePlugin::UnknownError, and Digikam::ExifToolProcess::Private::writeChannelIsClosed.
QProcess::ProcessState Digikam::ExifToolProcess::state | ( | ) | const |
Returns the current state of the process.
References Digikam::ExifToolProcess::Private::process.
void Digikam::ExifToolProcess::terminate | ( | ) |
Attempts to terminate the process.
References Digikam::ExifToolProcess::Private::cmdQueue, kill(), Digikam::ExifToolProcess::Private::process, and Digikam::ExifToolProcess::Private::writeChannelIsClosed.
Referenced by ~ExifToolProcess().
bool Digikam::ExifToolProcess::waitForFinished | ( | int | msecs = 30000 | ) | const |
Blocks until the process has finished and the finished() signal has been emitted, or until msecs milliseconds have passed.
References Digikam::ExifToolProcess::Private::process.
bool Digikam::ExifToolProcess::waitForStarted | ( | int | msecs = 30000 | ) | const |
Blocks until the process has started and the started() signal has been emitted, or until msecs milliseconds have passed.
References Digikam::ExifToolProcess::Private::process.