MailTransport::Transport

Search for usage in LXR

#include <transport.h>

Public Types

using Id = int
 
using List = QList<Transport *>
 

Properties

QString password
 
TransportType transportType
 

Signals

void passwordChanged ()
 
void passwordLoaded ()
 
void transportTypeChanged ()
 

Public Member Functions

 ~Transport () override
 
QString authenticationTypeString () const
 
Transportclone () const
 
void forceUniqueName ()
 
bool isComplete () const
 
Q_INVOKABLE bool isValid () const
 
QString password () const
 
void setPassword (const QString &passwd)
 
TransportType transportType () const
 
void updatePasswordState ()
 

Static Public Member Functions

static QString authenticationTypeString (int type)
 

Protected Member Functions

 Transport (const QString &cfgGroup)
 
void migrateToWallet ()
 
bool needsWalletMigration () const
 
void usrRead () override
 
bool usrSave () override
 

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.

Definition at line 32 of file transport.h.

Member Typedef Documentation

◆ Id

using MailTransport::Transport::Id = int

Definition at line 49 of file transport.h.

◆ List

Definition at line 48 of file transport.h.

Property Documentation

◆ password

QString MailTransport::Transport::password
readwrite

Definition at line 36 of file transport.h.

◆ transportType

TransportType MailTransport::Transport::transportType
read

Definition at line 37 of file transport.h.

Constructor & Destructor Documentation

◆ ~Transport()

Transport::~Transport ( )
overridedefault

Destructor.

◆ Transport()

Transport::Transport ( const QString & cfgGroup)
explicitprotected

Creates a Transport object.

Should only be used by TransportManager.

Parameters
cfgGroupThe KConfig group to read its data from.

Definition at line 23 of file transport.cpp.

Member Function Documentation

◆ authenticationTypeString() [1/2]

QString Transport::authenticationTypeString ( ) const
nodiscard

Returns a string representation of the authentication type.

Definition at line 110 of file transport.cpp.

◆ authenticationTypeString() [2/2]

QString Transport::authenticationTypeString ( int type)
staticnodiscard

Returns a string representation of the authentication type.

Convenience function when there isn't a Transport object instantiated.

Since
4.5

Definition at line 115 of file transport.cpp.

◆ clone()

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.

See also
updatePasswordState()

Definition at line 297 of file transport.cpp.

◆ forceUniqueName()

void Transport::forceUniqueName ( )

Makes sure the transport has a unique name.

Adds #1, #2, #3 etc. if necessary.

Since
4.4

Definition at line 66 of file transport.cpp.

◆ isComplete()

bool Transport::isComplete ( ) const
nodiscard

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.

Definition at line 105 of file transport.cpp.

◆ isValid()

bool Transport::isValid ( ) const
nodiscard

Returns true if this transport is valid, ie.

has all necessary data set.

Definition at line 38 of file transport.cpp.

◆ migrateToWallet()

void Transport::migrateToWallet ( )
protected

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

Definition at line 286 of file transport.cpp.

◆ needsWalletMigration()

bool Transport::needsWalletMigration ( ) const
nodiscardprotected

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

Definition at line 281 of file transport.cpp.

◆ password()

QString Transport::password ( ) const
nodiscard

Returns the password of this transport.

Definition at line 50 of file transport.cpp.

◆ passwordChanged

void MailTransport::Transport::passwordChanged ( )
signal

Emitted when the password is changed.

◆ passwordLoaded

void MailTransport::Transport::passwordLoaded ( )
signal

Emitted when passwords have been loaded from QKeyChain.

◆ setPassword()

void Transport::setPassword ( const QString & passwd)

Sets the password of this transport.

Parameters
passwdThe new password.

Definition at line 55 of file transport.cpp.

◆ transportType()

TransportType Transport::transportType ( ) const
nodiscard

Returns the type of this transport.

See also
TransportType.
Since
4.4

Definition at line 303 of file transport.cpp.

◆ transportTypeChanged

void MailTransport::Transport::transportTypeChanged ( )
signal

Emitted when the transport type is changed.

◆ updatePasswordState()

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().

See also
clone()
Since
4.2

Definition at line 88 of file transport.cpp.

◆ usrRead()

void Transport::usrRead ( )
overrideprotected

Definition at line 143 of file transport.cpp.

◆ usrSave()

bool Transport::usrSave ( )
overrideprotected

Definition at line 199 of file transport.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.