| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Digikam::ActionThreadBase Class Reference
Inheritance diagram for Digikam::ActionThreadBase:

## Public Member Functions
| ActionThreadBase (QObject *const parent=nullptr)
void | cancel (bool isCancel=true)
| Cancel processing of current jobs under progress.
int | expiryTimeout () const
int | maximumNumberOfThreads () const
void | setDefaultMaximumNumberOfThreads ()
| Reset maximum number of threads used to parallelize collection of job processing to max core detected on computer.
void | setExpiryTimeout (int timeout)
| Adjust the thread expiry timeout value in milliseconds.
void | setMaximumNumberOfThreads (int n)
| Adjust maximum number of threads used to parallelize collection of job processing.

## Static Public Member Functions
static void | setCurrentThreadName (const QString &name)
| Call this method to customize a thread name visible in a process viewer.

## Protected Slots
virtual void | slotJobFinished ()

## Protected Member Functions
void | appendJobs (const ActionJobCollection &jobs)
| Append a collection of jobs to process into QThreadPool.
bool | isEmpty () const
int | pendingCount () const
void | run () override
| Main thread loop used to process jobs in todo list.

## Member Function Documentation

## ◆ appendJobs()

void Digikam::ActionThreadBase::appendJobs | ( | const ActionJobCollection & | jobs | ) |
| protected

Jobs are add to pending lists and will be deleted by ActionThreadBase, not QThreadPool.

## ◆ expiryTimeout()

int Digikam::ActionThreadBase::expiryTimeout | ( |  | ) | const

Returns
  the thread expiry timeout value in milliseconds.

## ◆ isEmpty()

bool Digikam::ActionThreadBase::isEmpty | ( |  | ) | const
| protected

Returns
  true if list of pending jobs to process is empty.

## ◆ maximumNumberOfThreads()

int Digikam::ActionThreadBase::maximumNumberOfThreads | ( |  | ) | const

Returns
  the maximum number of threads used to parallelize collection of job processing.

## ◆ pendingCount()

int Digikam::ActionThreadBase::pendingCount | ( |  | ) | const
| protected

Returns
  the number of pending jobs to process.

## ◆ setCurrentThreadName()

void Digikam::ActionThreadBase::setCurrentThreadName | ( | const QString & | name | ) |
| static

This will replace the default "Thread (pooled)" string set by Qt for QRunable and QtConcurrent. To show the thread names you can use: Linux: htop –filter=PNAME –tree" sudo gdb -p PID -batch -ex "info threads" -ex "quit" macOS: sudo lldb -p PID -o "thread list" -o "quit" Windows: Microsoft Process Explorer https://learn.microsoft.com/fr-fr/sysinternals/downloads/process-explorer String limitation: Linux: 15 characters max (UTF8). macOS: 64 characters max (UTF8). Windows: 260 characters max (UTF16).

## ◆ setDefaultMaximumNumberOfThreads()

void Digikam::ActionThreadBase::setDefaultMaximumNumberOfThreads | ( |  | ) |

This method is called in constructor.