• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • sysadmin API Reference
  • KDE Home
  • Contact Us
 

libqapt

  • QApt
  • Transaction
Public Slots | Signals | Public Member Functions | Properties | List of all members
QApt::Transaction Class Reference

#include <transaction.h>

Inheritance diagram for QApt::Transaction:
Inheritance graph
[legend]

Public Slots

void cancel ()
 
void provideMedium (const QString &medium)
 
void replyUntrustedPrompt (bool approved)
 
void resolveConfigFileConflict (const QString &currentPath, bool replace)
 
void run ()
 
void setDebconfPipe (const QString &pipe)
 
void setFrontendCaps (QApt::FrontendCaps frontendCaps)
 
void setLocale (const QString &locale)
 
void setProxy (const QString &proxy)
 

Signals

void cancellableChanged (bool cancellable)
 
void configFileConflict (QString currentPath, QString newPath)
 
void downloadETAChanged (quint64 ETA)
 
void downloadProgressChanged (QApt::DownloadProgress progress)
 
void downloadSpeedChanged (quint64 downloadSpeed)
 
void errorOccurred (QApt::ErrorCode error)
 
void finished (QApt::ExitStatus exitStatus)
 
void mediumRequired (QString label, QString mountPoint)
 
void paused ()
 
void progressChanged (int progress)
 
void promptUntrusted (QStringList untrustedPackages)
 
void resumed ()
 
void statusChanged (QApt::TransactionStatus status)
 
void statusDetailsChanged (const QString &statusDetails)
 

Public Member Functions

 Transaction (const QString &tid)
 
 ~Transaction ()
 
QString debconfPipe () const
 
quint64 downloadETA () const
 
QApt::DownloadProgress downloadProgress () const
 
quint64 downloadSpeed () const
 
QApt::ErrorCode error () const
 
QString errorDetails () const
 
QString errorString () const
 
QApt::ExitStatus exitStatus () const
 
QString filePath () const
 
QApt::FrontendCaps frontendCaps () const
 
bool isCancellable () const
 
bool isCancelled () const
 
bool isPaused () const
 
QString locale () const
 
bool operator== (const Transaction *rhs) const
 
QVariantMap packages () const
 
int progress () const
 
QString proxy () const
 
QApt::TransactionRole role () const
 
QApt::TransactionStatus status () const
 
QString statusDetails () const
 
QString transactionId () const
 
QStringList untrustedPackages () const
 
int userId () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Properties

QString debconfPipe
 
quint64 downloadETA
 
DownloadProgress downloadProgress
 
quint64 downloadSpeed
 
ErrorCode error
 
QString errorDetails
 
ExitStatus exitStatus
 
QString filePath
 
FrontendCaps frontendCaps
 
bool isCancellable
 
bool isCancelled
 
bool isPaused
 
QString locale
 
QVariantMap packages
 
int progress
 
QString proxy
 
TransactionRole role
 
TransactionStatus status
 
QString statusDetails
 
QString transactionId
 
QStringList untrustedPackages
 
int userId
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 

Detailed Description

The Transaction class is an interface for a Transaction in the QApt Worker.

Transactions represent asynchronous tasks being performed by the QApt Worker, such as committing packages, or checking for updates. This class provides information about transactions, as well as means to interact with them on the client side.

Author
Jonathan Thomas
Since
2.0

Definition at line 54 of file transaction.h.

Constructor & Destructor Documentation

Transaction::Transaction ( const QString &  tid)
explicit

Constructor.

Parameters
tidThe D-Bus path (transaction id) of the transaction

Definition at line 88 of file transaction.cpp.

Transaction::~Transaction ( )

Destructor.

Definition at line 112 of file transaction.cpp.

Member Function Documentation

void Transaction::cancel ( )
slot

Attempts to cancel the transaction.

The transaction will only be cancelled if the isCancellable property is true.

See also
isCancellable

Definition at line 498 of file transaction.cpp.

void QApt::Transaction::cancellableChanged ( bool  cancellable)
signal

This signal is emitted when the transaction enters a state where it can or cannot be cancelled, depending on the parameter given.

Slots connected to this signal should disable or re-enable cancel buttons in their interface as appropriate.

Parameters
cancellableWhether or not the transaction is cancellable
void QApt::Transaction::configFileConflict ( QString  currentPath,
QString  newPath 
)
signal

This signal is emitted when a new version of a package being installed contains an updated version of a configuration file, and the user has made custom changes to the existing version of the configuration file.

The QApt Worker will pause the transaction until a response is given by the resolveConfigFileConflict() method

Slots connected to this signal should prompt the user to determine if the worker should keep the current configuration, or install the new configuration file. The currentPath argument indicates the location of the existing configuration file, and the newPath argument is the location of a copy of the new configuration file, which can be used to display the difference between the two files, if desired.

Parameters
currentPathThe path of the config file to be replaced
newPathThe path to a copy of the new config file
See also
resolveConfigFileConflict
QString QApt::Transaction::debconfPipe ( ) const

Returns the Debconf socket used by the transaction to handle debconf communication.

Use this socket to set up your Debconf frontend on the client side. Defaults to an empty string.

See also
setDebconfPipe
quint64 QApt::Transaction::downloadETA ( ) const

Returns the estimated time until the completion of a transaction's download state, in seconds.

See also
downloadETAChanged
void QApt::Transaction::downloadETAChanged ( quint64  ETA)
signal

This signal is emitted when the time estimate for a transaction's download changes.

Parameters
ETAThe estimated time until download completion in seconds
See also
downloadETA
QApt::DownloadProgress QApt::Transaction::downloadProgress ( ) const

Returns a QApt::DownloadProgress object which describes the most recent download progress information received from the worker.

See also
downloadProgressChanged
void QApt::Transaction::downloadProgressChanged ( QApt::DownloadProgress  progress)
signal

This signal is emitted when new download progress information becomes available.

Parameters
progressThe latest download progress info
quint64 QApt::Transaction::downloadSpeed ( ) const

Returns the rate at which data is being downloaded by the transaction in bytes.

See also
downloadSpeedChanged
void QApt::Transaction::downloadSpeedChanged ( quint64  downloadSpeed)
signal

This signal is emitted when the current download rate changes.

Parameters
downloadSpeedThe current download rate in bytes per second
See also
downloadSpeed
QApt::ErrorCode QApt::Transaction::error ( ) const

Returns the error code set by the QApt Worker in the event the transaction ended in error.

Returns QApt::Success if no error has occurred at the time the method is called.

QString QApt::Transaction::errorDetails ( ) const

Returns a string containing the details describing a transaction error.

If no errors have occurred, this will return an empty string.

void QApt::Transaction::errorOccurred ( QApt::ErrorCode  error)
signal

This signal is emitted when the transaction encounters a fatal error that prevents the transaction from successfully finishing.

Slots connected to this signal should notify the user that an error has occurred.

See also
errorDetails
QString Transaction::errorString ( ) const

Returns the error string for the error code that may or may not be set.

Returns QString::null if no error

Definition at line 167 of file transaction.cpp.

QApt::ExitStatus QApt::Transaction::exitStatus ( ) const

Returns the exit status of the transaction.

If the transaction has not yet finished, it will return QApt::ExitUnfinished

QString QApt::Transaction::filePath ( ) const

Returns the path of the file currently being installed for transactions with a TransactionRole of InstallFileRole.

See also
setFilePath
void QApt::Transaction::finished ( QApt::ExitStatus  exitStatus)
signal

This signal is emitted when the transaction reaches the Finished state.

Slots connected to this signal should perform post-transaction cleanup and delete the transaction object once they are done retreiving data from it.

Parameters
exitStatusThe exit status of the transaction
QApt::FrontendCaps QApt::Transaction::frontendCaps ( ) const

Returns the frontend capabilities of the frontend displaying the transaction.

bool QApt::Transaction::isCancellable ( ) const

Returns true if the transaction can be cancelled; otherwise, false.

bool QApt::Transaction::isCancelled ( ) const

Returns true if the transaction has been cancelled; otherwise, false.

bool QApt::Transaction::isPaused ( ) const

Returns true if the transaction has been paused; otherwise, false.

A transaction will be paused by the worker while waiting for user input.

See also
paused
resumed
QString QApt::Transaction::locale ( ) const

Returns the locale code the transaction is using to perform translations and encoding.

Defaults to an empty string.

See also
setLocale
void QApt::Transaction::mediumRequired ( QString  label,
QString  mountPoint 
)
signal

This signal is emitted when during the course of downloading packages, the QApt Worker encounters packages that need to be downloaded from a CD-ROM or DVD-ROM disc not currently mounted.

The worker will pause this transaction until a response is given by the provideMedium() method.

Slots connected to this signal should notify the user about this requirement, prompting to insert the CD in the drive at the given mount point.

Parameters
labelThe label of the required optical media
mountPointThe mount point of the optical medium drive to place the media
See also
provideMedium
bool Transaction::operator== ( const Transaction *  rhs) const

Equality operator.

This will compare the transaction IDs of the two Transaction objects to determine whether or not the two transactions are "the same". They will usually not point to the same address, but they still represent the same transaction on D-Bus

Parameters
rhsThe transaction to be compared to

Definition at line 117 of file transaction.cpp.

QVariantMap QApt::Transaction::packages ( ) const

Returns a list of the packages that this transaction will act upon.

void QApt::Transaction::paused ( )
signal

This signal is emitted whenever the QApt worker pauses the transaction.

int QApt::Transaction::progress ( ) const

Returns the current overall progress of the transaction as a percentage.

If a number over 100 is returned, no progress can be determined, and progress bars displaying this progress should be placed in "busy" or "indeterminate" mode.

See also
progressChanged
void QApt::Transaction::progressChanged ( int  progress)
signal

This signal is emitted when the global progress of the transaction changes.

Parameters
progressThe new current progress, as a percentage.
void QApt::Transaction::promptUntrusted ( QStringList  untrustedPackages)
signal

This signal is emitted when the QApt Worker detects that packages will need to be downloaded from an untrusted source to complete the transaction.

The worker will pause the transaction until a response is given by the replyUntrustedPrompt method.

Parameters
untrustedPackagesThe list of untrusted packages
See also
replyUntrustedPrompt
void Transaction::provideMedium ( const QString &  medium)
slot

Responds to the QApt Worker's request for an installation medium.

The mount point of the medium the worker requested must be provided as a sanity check.

Parameters
mediumThe mount point of the medium the user has provided

Definition at line 507 of file transaction.cpp.

QString QApt::Transaction::proxy ( ) const

Returns the HTTP proxy used by the transaction to perform actions that require fetching data over HTTP.

Defaults to an empty string.

See also
setProxy
void Transaction::replyUntrustedPrompt ( bool  approved)
slot

Responds to the QApt Worker's query of whether or not the user wishes to continue with the transaction, despite the need to download untrusted packages.

Parameters
approvedWhether or not the user wishes to continue

Definition at line 516 of file transaction.cpp.

void Transaction::resolveConfigFileConflict ( const QString &  currentPath,
bool  replace 
)
slot

Responds to the QApt Worker's prompt of a configuration file conflict.

The path of the configuration file being replaced must be provided as a sanity check.

Parameters
currentPathThe configuration file being replaced
replaceWhether or not the user wants the file to be replaced by a newer version

Definition at line 525 of file transaction.cpp.

void QApt::Transaction::resumed ( )
signal

This signal is emitted whenever the QApt worker resumes the transaction.

QApt::TransactionRole QApt::Transaction::role ( ) const

Returns the role of the transaction, describing what action the transaction will perform.

void Transaction::run ( )
slot

Queues the transaction to be processed by the QApt Worker.

Definition at line 489 of file transaction.cpp.

void Transaction::setDebconfPipe ( const QString &  pipe)
slot

Sets the Debconf socket used by the transaction to handle debconf communication.

Use this socket to set up your Debconf frontend on the client side.

This property can only be changed before the transaction is run.

Parameters
pipeThe debconf socket to be used by the worker
See also
debconfPipe

Definition at line 479 of file transaction.cpp.

void Transaction::setFrontendCaps ( QApt::FrontendCaps  frontendCaps)
slot

Sets the frontend capabilities for the frontend handling this transaction.

E.g. advertise support for debconf, etc.

Definition at line 454 of file transaction.cpp.

void Transaction::setLocale ( const QString &  locale)
slot

Sets the locale code to be used by the transaction for translation and encoding purposes.

This property can only be changed before the transaction is run.

Parameters
localeThe locale code to be used
See also
locale

Definition at line 444 of file transaction.cpp.

void Transaction::setProxy ( const QString &  proxy)
slot

Sets the HTTP proxy to be used by the transaction during actions that require fetching data over HTTP.

This property can only be changed before the transaction is run.

Parameters
proxyThe HTTP proxy for the transaction to use
See also
proxy

Definition at line 469 of file transaction.cpp.

QApt::TransactionStatus QApt::Transaction::status ( ) const

Returns the current status of the transaction.

void QApt::Transaction::statusChanged ( QApt::TransactionStatus  status)
signal

This signal is emitted when the status of the transaction changes.

Slots connected to this signal should use this to react to these state changes, updating their interfaces and reloading the backend as needed.

QString QApt::Transaction::statusDetails ( ) const

Returns a human-readable status message providing further information about the current transaction status.

For example, during the QApt::CommittingStatus, status messages from APT will be returned.

If no details about the current status are available, an empty string will be returned.

See also
statusDetailsChanged status
void QApt::Transaction::statusDetailsChanged ( const QString &  statusDetails)
signal

This signal is emitted when the status details of the transaction change.

Parameters
statusDetailsThe latest status details
See also
statusDetails
QString QApt::Transaction::transactionId ( ) const

Returns a unique identifier for the transaction.

This is useful for interacting with certain QApt::Backend API, which refers to transactions by their transaction ID when notifying of worker queue changes.

QStringList QApt::Transaction::untrustedPackages ( ) const

Returns the list of untrusted packages that the transaction will potentially act upon.

The QApt Worker will set this list if the transaction will act upon untrusted packages.

See also
promptUntrusted
replyUntrustedPrompt
int QApt::Transaction::userId ( ) const

Returns the user ID of the user that initiated the transaction.

Property Documentation

QString Transaction::debconfPipe
readwrite

Definition at line 74 of file transaction.h.

quint64 Transaction::downloadETA
readwrite

Definition at line 85 of file transaction.h.

DownloadProgress Transaction::downloadProgress
readwrite

Definition at line 82 of file transaction.h.

quint64 Transaction::downloadSpeed
readwrite

Definition at line 84 of file transaction.h.

QApt::ErrorCode Transaction::error
read

Definition at line 71 of file transaction.h.

QString Transaction::errorDetails
readwrite

Definition at line 87 of file transaction.h.

QApt::ExitStatus Transaction::exitStatus
readwrite

Definition at line 78 of file transaction.h.

QString Transaction::filePath
readwrite

Definition at line 86 of file transaction.h.

QApt::FrontendCaps Transaction::frontendCaps
readwrite

Definition at line 88 of file transaction.h.

bool Transaction::isCancellable
readwrite

Definition at line 76 of file transaction.h.

bool Transaction::isCancelled
readwrite

Definition at line 77 of file transaction.h.

bool Transaction::isPaused
readwrite

Definition at line 79 of file transaction.h.

QString Transaction::locale
readwrite

Definition at line 72 of file transaction.h.

QVariantMap Transaction::packages
readwrite

Definition at line 75 of file transaction.h.

int Transaction::progress
readwrite

Definition at line 81 of file transaction.h.

QString Transaction::proxy
readwrite

Definition at line 73 of file transaction.h.

QApt::TransactionRole Transaction::role
readwrite

Definition at line 69 of file transaction.h.

QApt::TransactionStatus Transaction::status
readwrite

Definition at line 70 of file transaction.h.

QString Transaction::statusDetails
readwrite

Definition at line 80 of file transaction.h.

QString Transaction::transactionId
readwrite

Definition at line 67 of file transaction.h.

QStringList Transaction::untrustedPackages
readwrite

Definition at line 83 of file transaction.h.

int Transaction::userId
readwrite

Definition at line 68 of file transaction.h.


The documentation for this class was generated from the following files:
  • transaction.h
  • transaction.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2018 The KDE developers.
Generated on Fri Jan 12 2018 03:21:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libqapt

Skip menu "libqapt"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

sysadmin API Reference

Skip menu "sysadmin API Reference"
  • libqapt

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal