MailTransport::Transport Class

class MailTransport::Transport
Header: #include <MailTransport/Transport>
CMake: find_package(KPim6MailTransport REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailTransport)

Properties

Public Functions

~Transport()
QString authenticationTypeString() const
MailTransport::Transport *clone() const
void forceUniqueName()
bool isComplete() const
bool isValid() const
QString password() const
void setPassword(const QString &passwd)
MailTransport::TransportType transportType() const
void updatePasswordState()

Signals

Static Public Members

QString authenticationTypeString(int type)

Protected Functions

Transport(const QString &cfgGroup)
void migrateToWallet()
bool needsWalletMigration() const

Private Slots

void readPassword()

Detailed Description

Represents the settings of a specific mail transport.

To create a new empty Transport object, use TransportManager::createTransport().

Initialize an empty Transport object by calling the set...() methods defined in kcfg-generated TransportBase, and in this class.

Property Documentation

password : QString

This property holds the password of this transport.

Access functions:

QString password() const
void setPassword(const QString &passwd)

Notifier signal:

[read-only] transportType : TransportType

This property holds the type of this transport.

Access functions:

MailTransport::TransportType transportType() const

Notifier signal:

Member Function Documentation

[explicit protected] Transport::Transport(const QString &cfgGroup)

Creates a Transport object. Should only be used by TransportManager. cfgGroup The KConfig group to read its data from.

[noexcept] Transport::~Transport()

Destructor

QString Transport::authenticationTypeString() const

Returns a string representation of the authentication type.

[static] QString Transport::authenticationTypeString(int type)

Returns a string representation of the authentication type. Convenience function when there isn't a Transport object instantiated.

MailTransport::Transport *Transport::clone() const

Returns a deep copy of this Transport object which will no longer be automatically updated. Use this if you need to store a Transport object over a longer time. However it is recommended to store transport identifiers instead if possible.

@sa updatePasswordState()

void Transport::forceUniqueName()

Makes sure the transport has a unique name. Adds #1, #2, #3 etc. if necessary.

bool Transport::isComplete() const

Returns true if all settings have been loaded. This is the way to find out if the password has already been loaded from the wallet.

[invokable] bool Transport::isValid() const

Returns true if this transport is valid, ie. has all necessary data set.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[protected] void Transport::migrateToWallet()

Try to migrate the password from the config file to the wallet.

[protected] bool Transport::needsWalletMigration() const

Returns true if the password was not stored in the wallet.

QString Transport::password() const

Returns the password of this transport.

Note: Getter function for property password.

See also setPassword().

[signal] void Transport::passwordChanged()

Emitted when the password is changed

Note: Notifier signal for property password.

[signal] void Transport::passwordLoaded()

Emitted when passwords have been loaded from QKeyChain.

[private slot] void Transport::readPassword()

void Transport::setPassword(const QString &passwd)

Sets the password of this transport. passwd The new password.

Note: Setter function for property password.

See also password().

MailTransport::TransportType Transport::transportType() const

Returns the type of this transport.

Note: Getter function for property transportType.

See also TransportType.

[signal] void Transport::transportTypeChanged()

Emitted when the transport type is changed

Note: Notifier signal for property transportType.

void Transport::updatePasswordState()

This function synchronizes the password of this transport with the password of the transport with the same ID that is managed by the transport manager. This is only useful for cloned transports, since their passwords don't automatically get updated when calling TransportManager::loadPasswordsAsync() or TransportManager::loadPasswords().

@sa clone()