![]() |
digiKam
|
#include <exiftoolprocess.h>
Classes | |
class | Private |
class | Result |
Public Types | |
enum | Action { LOAD_METADATA = 0 , LOAD_CHUNKS , APPLY_CHANGES , APPLY_CHANGES_EXV , APPLY_METADATA_FILE , CHANGE_TIMESTAMPS , READ_FORMATS , WRITE_FORMATS , TRANSLATIONS_LIST , TAGS_DATABASE , VERSION_STRING , COPY_TAGS , TRANS_TAGS , NO_ACTION } |
enum | CopyTagsSource { COPY_EXIF = 0x01 , COPY_MAKERNOTES = 0x02 , RESTORE_PREVIEW = 0x04 , COPY_IPTC = 0x08 , COPY_XMP = 0x10 , COPY_ICC = 0x20 , COPY_ALL = 0x40 , COPY_NONE = 0x80 } |
enum | ResultStatus { COMMAND_RESULT = 0 , FINISH_RESULT , ERROR_RESULT } |
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 | signalChangeProgram (const QString &etExePath) |
void | signalExecNextCmd () |
void | signalExifToolResult (int cmdId) |
Public Member Functions | |
int | command (const QByteArrayList &args, Action ac) |
bool | exifToolAvailable () const |
QProcess::ProcessError | exifToolError () const |
QString | exifToolErrorString () const |
bool | exifToolIsBusy () const |
ExifToolProcess () | |
QString | getExifToolProgram () const |
ExifToolProcess::Result | getExifToolResult (int cmdId) const |
void | initExifTool () |
void | setExifToolProgram (const QString &etExePath) |
void | shutDownExifTool () |
ExifToolProcess::Result | waitForExifToolResult (int cmdId) const |
~ExifToolProcess () | |
Static Public Member Functions | |
static ExifToolProcess * | instance () |
Q_GLOBAL_STATIC implementation. | |
static bool | isCreated () |
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. |
APPLY_METADATA_FILE | Apply a metadata file to a file with ExifTool. |
CHANGE_TIMESTAMPS | Change all timestamps in a file with ExifTool. |
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.
Digikam::ExifToolProcess::ExifToolProcess | ( | ) |
Constructs a ExifToolProcess.
References Digikam::adjustedEnvironmentForAppImage().
Digikam::ExifToolProcess::~ExifToolProcess | ( | ) |
Destructs the ExifToolProcess object, i.e., killing the process. Note that this function will not return until the process is terminated.
int Digikam::ExifToolProcess::command | ( | const QByteArrayList & | args, |
Action | ac | ||
) |
Send a command to exiftool process. This function can be called from another thread. Return 0: ExitTool not running, write channel is closed or args is empty.
References CMD_ID_MAX, CMD_ID_MIN, Digikam::ExifToolProcess::Private::cmdMutex, Digikam::ExifToolProcess::Private::cmdQueue, command(), Digikam::ExifToolProcess::Private::Command::id, Digikam::ExifToolProcess::Private::nextCmdId, signalExecNextCmd(), and Digikam::ExifToolProcess::Private::writeChannelIsClosed.
Referenced by command(), and Digikam::ExifToolProcess::Private::slotExecNextCmd().
bool Digikam::ExifToolProcess::exifToolAvailable | ( | ) | const |
Returns true if ExifToolProcess is available (process state == Running)
Referenced by Digikam::ExifToolParser::exifToolAvailable().
QProcess::ProcessError Digikam::ExifToolProcess::exifToolError | ( | ) | const |
Returns the type of error that occurred last.
References Digikam::ExifToolProcess::Private::processError.
QString Digikam::ExifToolProcess::exifToolErrorString | ( | ) | const |
Returns an error message.
References Digikam::ExifToolProcess::Private::errorString.
Referenced by Digikam::ExifToolParser::currentErrorString().
bool Digikam::ExifToolProcess::exifToolIsBusy | ( | ) | const |
Returns true if a command is running.
References Digikam::ExifToolProcess::Private::cmdNumber.
QString Digikam::ExifToolProcess::getExifToolProgram | ( | ) | const |
References Digikam::ExifToolProcess::Private::etExePath.
ExifToolProcess::Result Digikam::ExifToolProcess::getExifToolResult | ( | int | cmdId | ) | const |
Returns the ExifToolProcess result.
References Digikam::ExifToolProcess::Private::mutex, and Digikam::ExifToolProcess::Private::resultMap.
Referenced by Digikam::ExifToolParser::slotExifToolResult().
void Digikam::ExifToolProcess::initExifTool | ( | ) |
Setup connections, apply Settings and start ExifTool process. This function cannot be called from another thread.
References Digikam::MetaEngineSettings::instance(), signalChangeProgram(), signalExecNextCmd(), and Digikam::ExifToolProcess::Private::slotExecNextCmd().
Referenced by Digikam::ExifToolThread::run().
|
static |
Q_GLOBAL_STATIC implementation.
Referenced by Digikam::ExifToolParser::ExifToolParser(), and Digikam::ExifToolThread::run().
|
static |
void Digikam::ExifToolProcess::setExifToolProgram | ( | const QString & | etExePath | ) |
Change the ExifTool path configuration. This function can be called from another thread.
References signalChangeProgram().
Referenced by Digikam::ExifToolParser::setExifToolProgram().
void Digikam::ExifToolProcess::shutDownExifTool | ( | ) |
Attempts to shut down the ExifTool process. This function cannot be called from another thread.
References Digikam::ExifToolProcess::Private::cmdQueue, and Digikam::ExifToolProcess::Private::writeChannelIsClosed.
Referenced by Digikam::ExifToolThread::run().
|
signal |
Referenced by initExifTool(), and setExifToolProgram().
|
signal |
Referenced by command(), and initExifTool().
|
signal |
Referenced by Digikam::ExifToolParser::ExifToolParser().
ExifToolProcess::Result Digikam::ExifToolProcess::waitForExifToolResult | ( | int | cmdId | ) | const |
WatCondition for the ExifToolParser class. Returns the ExifToolProcess result.
References Digikam::ExifToolProcess::Private::condVar, Digikam::ExifToolProcess::Private::mutex, Digikam::ExifToolProcess::Private::resultMap, and Digikam::ExifToolProcess::Result::waitError.