Commit 3a825896 authored by Constantin Berzan's avatar Constantin Berzan
Browse files

obey coding style; minor i18n fixes. SVN_SILENT

svn path=/branches/work/akonadi-ports/kdepimlibs/; revision=988524
parent dc120291
......@@ -60,7 +60,7 @@ class AddTransportDialog::Private
TransportType AddTransportDialog::Private::selectedType() const
{
QList<QTreeWidgetItem*> sel = ui.typeListView->selectedItems();
if( !sel.empty() ) {
if ( !sel.empty() ) {
return sel.first()->data( 0, Qt::UserRole ).value<TransportType>();
}
return TransportType();
......@@ -72,11 +72,8 @@ void AddTransportDialog::Private::typeListClicked()
q->enableButtonOk( selectedType().isValid() );
}
AddTransportDialog::AddTransportDialog( QWidget *parent )
: KDialog( parent )
, d( new Private( this ) )
: KDialog( parent ), d( new Private( this ) )
{
// Setup UI.
{
......@@ -90,7 +87,7 @@ AddTransportDialog::AddTransportDialog( QWidget *parent )
}
// Populate type list.
foreach( const TransportType &type, TransportManager::self()->types() ) {
foreach ( const TransportType &type, TransportManager::self()->types() ) {
QTreeWidgetItem *treeItem = new QTreeWidgetItem( d->ui.typeListView );
treeItem->setText( 0, type.name() );
treeItem->setText( 1, type.description() );
......
......@@ -62,7 +62,7 @@
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
<string comment="The name of a mail transport">Name:</string>
</property>
</widget>
</item>
......
......@@ -73,9 +73,10 @@ void AkonadiJob::doStart()
return;
}
d->iface = new QDBusInterface( QLatin1String( "org.freedesktop.Akonadi.Resource." ) + transport()->host(),
QLatin1String( "/" ), QLatin1String( "org.freedesktop.Akonadi.Resource.Transport" ),
QDBusConnection::sessionBus(), this );
d->iface = new QDBusInterface(
QLatin1String( "org.freedesktop.Akonadi.Resource." ) + transport()->host(),
QLatin1String( "/" ), QLatin1String( "org.freedesktop.Akonadi.Resource.Transport" ),
QDBusConnection::sessionBus(), this );
if( !d->iface->isValid() ) {
setError( UserDefinedError );
setErrorText( i18n( "Failed to get D-Bus interface of resource %1.", transport()->host() ) );
......
......@@ -32,7 +32,6 @@
using namespace MailTransport;
class MailTransport::SendmailConfigWidgetPrivate : public TransportConfigWidgetPrivate
{
public:
......@@ -46,7 +45,8 @@ SendmailConfigWidget::SendmailConfigWidget( Transport *transport, QWidget *paren
init();
}
SendmailConfigWidget::SendmailConfigWidget( SendmailConfigWidgetPrivate &dd, Transport *transport, QWidget *parent )
SendmailConfigWidget::SendmailConfigWidget( SendmailConfigWidgetPrivate &dd,
Transport *transport, QWidget *parent )
: TransportConfigWidget( dd, transport, parent )
{
init();
......@@ -69,5 +69,4 @@ void SendmailConfigWidget::init()
}
}
#include "sendmailconfigwidget.moc"
......@@ -122,7 +122,8 @@ SMTPConfigWidget::SMTPConfigWidget( Transport *transport, QWidget *parent )
init();
}
SMTPConfigWidget::SMTPConfigWidget( SMTPConfigWidgetPrivate &dd, Transport *transport, QWidget *parent )
SMTPConfigWidget::SMTPConfigWidget( SMTPConfigWidgetPrivate &dd,
Transport *transport, QWidget *parent )
: TransportConfigWidget( dd, transport, parent )
{
init();
......
......@@ -186,7 +186,7 @@ void Transport::usrReadConfig()
d->transportType = types[ index ];
} else {
kWarning() << "Type unknown to manager.";
d->transportType.d->mName = i18n( "Unknown" );
d->transportType.d->mName = i18nc( "An unknown transport type", "Unknown" );
}
}
......
......@@ -57,11 +57,8 @@ void TransportConfigDialog::Private::okClicked()
}
}
TransportConfigDialog::TransportConfigDialog( Transport *transport, QWidget *parent )
: KDialog( parent )
, d( new Private )
: KDialog( parent ), d( new Private )
{
Q_ASSERT( transport );
d->transport = transport;
......
......@@ -35,15 +35,14 @@
using namespace MailTransport;
TransportConfigWidget::TransportConfigWidget( Transport *transport, QWidget *parent )
: QWidget( parent )
, d_ptr( new TransportConfigWidgetPrivate )
: QWidget( parent ), d_ptr( new TransportConfigWidgetPrivate )
{
init( transport );
}
TransportConfigWidget::TransportConfigWidget( TransportConfigWidgetPrivate &dd, Transport *transport, QWidget *parent )
: QWidget( parent )
, d_ptr( &dd )
TransportConfigWidget::TransportConfigWidget( TransportConfigWidgetPrivate &dd,
Transport *transport, QWidget *parent )
: QWidget( parent ), d_ptr( &dd )
{
init( transport );
}
......
......@@ -93,7 +93,8 @@ class TransportConfigWidget : public QWidget
protected:
TransportConfigWidgetPrivate *const d_ptr;
TransportConfigWidget( TransportConfigWidgetPrivate &dd, Transport *transport, QWidget *parent );
TransportConfigWidget( TransportConfigWidgetPrivate &dd,
Transport *transport, QWidget *parent );
private:
Q_DECLARE_PRIVATE( TransportConfigWidget )
......
......@@ -170,7 +170,7 @@ QList< Transport * > TransportManager::transports() const
return d->transports;
}
const TransportType::List &TransportManager::types() const
TransportType::List TransportManager::types() const
{
return d->types;
}
......@@ -235,14 +235,15 @@ bool TransportManager::showNewTransportDialog( QWidget *parent )
bool TransportManager::promptCreateTransportIfNoneExists( QWidget *parent )
{
if ( !isEmpty() )
if ( !isEmpty() ) {
return true;
}
const int response = KMessageBox::messageBox( parent,
KMessageBox::WarningContinueCancel,
i18n("You must create an outgoing account before sending."),
i18n("Create Account Now?"),
KGuiItem( i18n("Create Account Now") ) );
i18n( "You must create an outgoing account before sending." ),
i18n( "Create Account Now?" ),
KGuiItem( i18n( "Create Account Now" ) ) );
if ( response == KMessageBox::Continue ) {
return showNewTransportDialog( parent );
}
......@@ -488,11 +489,11 @@ void TransportManager::fillTypes()
type.d->mDescription = i18n( "A local sendmail installation" );
d->types << type;
}
// All Akonadi resources with MailTransport capability.
{
using namespace Akonadi;
foreach( const AgentType &atype, AgentManager::self()->types() ) {
foreach ( const AgentType &atype, AgentManager::self()->types() ) {
// TODO probably the string "MailTransport" should be #defined somewhere
// and used like that in the resources (?)
if( atype.capabilities().contains( QLatin1String( "MailTransport" ) ) ) {
......@@ -752,7 +753,7 @@ void TransportManager::agentTypeAdded( const Akonadi::AgentType &atype )
void TransportManager::agentTypeRemoved( const Akonadi::AgentType &atype )
{
using namespace Akonadi;
foreach( const TransportType &type, d->types ) {
foreach ( const TransportType &type, d->types ) {
if( type.type() == Transport::EnumType::Akonadi &&
type.agentType() == atype ) {
d->types.removeAll( type );
......
......@@ -106,7 +106,7 @@ class MAILTRANSPORT_EXPORT TransportManager : public QObject
/**
Returns a list of all available transport types.
*/
const TransportType::List &types() const;
TransportType::List types() const;
/**
Creates a new, empty Transport object. The object is owned by the caller.
......
......@@ -39,7 +39,7 @@ TransportType::~TransportType()
{
}
TransportType& TransportType::operator=( const TransportType &other )
TransportType &TransportType::operator=( const TransportType &other )
{
if( this != &other ) {
d = other.d;
......
......@@ -78,8 +78,8 @@ class MAILTRANSPORT_EXPORT TransportType
/**
@internal
*/
TransportType& operator=( const TransportType &other );
TransportType &operator=( const TransportType &other );
/**
@internal
Compares two transport types.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment