[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim] kmail: Indent
From:       Montel Laurent <montel () kde ! org>
Date:       2013-05-31 7:37:10
Message-ID: 20130531073710.BF141A6067 () git ! kde ! org
[Download RAW message or body]

Git commit fc08a3b732be95402b702e82723d0b354a9589bc by Montel Laurent.
Committed on 31/05/2013 at 09:37.
Pushed by mlaurent into branch 'master'.

Indent

M  +0    -1    kmail/messageactions.h
M  +85   -85   kmail/newidentitydialog.cpp
M  +12   -12   kmail/newidentitydialog.h
M  +1    -0    kmail/snippetwidget.h
M  +62   -62   kmail/undostack.cpp
M  +22   -22   kmail/undostack.h

http://commits.kde.org/kdepim/fc08a3b732be95402b702e82723d0b354a9589bc

diff --git a/kmail/messageactions.h b/kmail/messageactions.h
index 7347958..7a5768d 100644
--- a/kmail/messageactions.h
+++ b/kmail/messageactions.h
@@ -102,7 +102,6 @@ class MessageActions : public QObject
 
 
   signals:
-
     // This signal is emitted when a reply is triggered and the
     // action has finished.
     // This is useful for the stand-alone reader, it might want to close the window \
                in
diff --git a/kmail/newidentitydialog.cpp b/kmail/newidentitydialog.cpp
index dfb42a7..e4702d8 100644
--- a/kmail/newidentitydialog.cpp
+++ b/kmail/newidentitydialog.cpp
@@ -40,108 +40,108 @@
 using namespace KMail;
 
 NewIdentityDialog::NewIdentityDialog( KPIMIdentities::IdentityManager* manager, \
                QWidget *parent )
-  : KDialog( parent ),
-  mIdentityManager( manager )
+    : KDialog( parent ),
+      mIdentityManager( manager )
 {
-  setCaption( i18n("New Identity") );
-  setButtons( Ok|Cancel|Help );
-  setHelp( QString::fromLatin1("configure-identity-newidentitydialog") );
-  QWidget *page = new QWidget( this );
-  setMainWidget( page );
-  QVBoxLayout * vlay = new QVBoxLayout( page );
-  vlay->setSpacing( spacingHint() );
-  vlay->setMargin( 0 );
-
-  // row 0: line edit with label
-  QHBoxLayout * hlay = new QHBoxLayout(); // inherits spacing
-  vlay->addLayout( hlay );
-  mLineEdit = new KLineEdit( page );
-  mLineEdit->setFocus();
-  mLineEdit->setClearButtonShown( true );
-  QLabel *l = new QLabel( i18n("&New identity:"), page );
-  l->setBuddy( mLineEdit );
-  hlay->addWidget( l );
-  hlay->addWidget( mLineEdit, 1 );
-  connect( mLineEdit, SIGNAL(textChanged(QString)),
-           this, SLOT(slotEnableOK(QString)) );
-
-  mButtonGroup = new QButtonGroup( page );
-
-  // row 1: radio button
-  QRadioButton *radio = new QRadioButton( i18n("&With empty fields"), page );
-  radio->setChecked( true );
-  vlay->addWidget( radio );
-  mButtonGroup->addButton( radio, (int)Empty );
-
-  // row 2: radio button
-  radio = new QRadioButton( i18n("&Use System Settings values"), page );
-  vlay->addWidget( radio );
-  mButtonGroup->addButton( radio, (int)ControlCenter );
-
-  // row 3: radio button
-  radio = new QRadioButton( i18n("&Duplicate existing identity"), page );
-  vlay->addWidget( radio );
-  mButtonGroup->addButton( radio, (int)ExistingEntry );
-
-  // row 4: combobox with existing identities and label
-  hlay = new QHBoxLayout(); // inherits spacing
-  vlay->addLayout( hlay );
-  mComboBox = new KComboBox( page );
-  mComboBox->setEditable( false );
-  mComboBox->addItems( manager->shadowIdentities() );
-  mComboBox->setEnabled( false );
-  QLabel *label = new QLabel( i18n("&Existing identities:"), page );
-  label->setBuddy( mComboBox );
-  label->setEnabled( false );
-  hlay->addWidget( label );
-  hlay->addWidget( mComboBox, 1 );
-
-  vlay->addStretch( 1 ); // spacer
-
-  // enable/disable combobox and label depending on the third radio
-  // button's state:
-  connect( radio, SIGNAL(toggled(bool)),
-           label, SLOT(setEnabled(bool)) );
-  connect( radio, SIGNAL(toggled(bool)),
-           mComboBox, SLOT(setEnabled(bool)) );
-
-  enableButtonOk( false ); // since line edit is empty
+    setCaption( i18n("New Identity") );
+    setButtons( Ok|Cancel|Help );
+    setHelp( QString::fromLatin1("configure-identity-newidentitydialog") );
+    QWidget *page = new QWidget( this );
+    setMainWidget( page );
+    QVBoxLayout * vlay = new QVBoxLayout( page );
+    vlay->setSpacing( spacingHint() );
+    vlay->setMargin( 0 );
+
+    // row 0: line edit with label
+    QHBoxLayout * hlay = new QHBoxLayout(); // inherits spacing
+    vlay->addLayout( hlay );
+    mLineEdit = new KLineEdit( page );
+    mLineEdit->setFocus();
+    mLineEdit->setClearButtonShown( true );
+    QLabel *l = new QLabel( i18n("&New identity:"), page );
+    l->setBuddy( mLineEdit );
+    hlay->addWidget( l );
+    hlay->addWidget( mLineEdit, 1 );
+    connect( mLineEdit, SIGNAL(textChanged(QString)),
+             this, SLOT(slotEnableOK(QString)) );
+
+    mButtonGroup = new QButtonGroup( page );
+
+    // row 1: radio button
+    QRadioButton *radio = new QRadioButton( i18n("&With empty fields"), page );
+    radio->setChecked( true );
+    vlay->addWidget( radio );
+    mButtonGroup->addButton( radio, (int)Empty );
+
+    // row 2: radio button
+    radio = new QRadioButton( i18n("&Use System Settings values"), page );
+    vlay->addWidget( radio );
+    mButtonGroup->addButton( radio, (int)ControlCenter );
+
+    // row 3: radio button
+    radio = new QRadioButton( i18n("&Duplicate existing identity"), page );
+    vlay->addWidget( radio );
+    mButtonGroup->addButton( radio, (int)ExistingEntry );
+
+    // row 4: combobox with existing identities and label
+    hlay = new QHBoxLayout(); // inherits spacing
+    vlay->addLayout( hlay );
+    mComboBox = new KComboBox( page );
+    mComboBox->setEditable( false );
+    mComboBox->addItems( manager->shadowIdentities() );
+    mComboBox->setEnabled( false );
+    QLabel *label = new QLabel( i18n("&Existing identities:"), page );
+    label->setBuddy( mComboBox );
+    label->setEnabled( false );
+    hlay->addWidget( label );
+    hlay->addWidget( mComboBox, 1 );
+
+    vlay->addStretch( 1 ); // spacer
+
+    // enable/disable combobox and label depending on the third radio
+    // button's state:
+    connect( radio, SIGNAL(toggled(bool)),
+             label, SLOT(setEnabled(bool)) );
+    connect( radio, SIGNAL(toggled(bool)),
+             mComboBox, SLOT(setEnabled(bool)) );
+
+    enableButtonOk( false ); // since line edit is empty
 }
 
 NewIdentityDialog::DuplicateMode NewIdentityDialog::duplicateMode() const
 {
-  const int id = mButtonGroup->checkedId();
-  assert( id == (int)Empty
-          || id == (int)ControlCenter
-          || id == (int)ExistingEntry );
-  return static_cast<DuplicateMode>( id );
+    const int id = mButtonGroup->checkedId();
+    assert( id == (int)Empty
+            || id == (int)ControlCenter
+            || id == (int)ExistingEntry );
+    return static_cast<DuplicateMode>( id );
 }
 
 void NewIdentityDialog::slotEnableOK( const QString & proposedIdentityName )
 {
-  // OK button is disabled if
-  const QString name = proposedIdentityName.trimmed();
-  // name isn't empty
-  if ( name.isEmpty() ) {
-    enableButtonOk( false );
-    return;
-  }
-  // or name doesn't yet exist.
-  if ( !mIdentityManager->isUnique( name ) ) {
-    enableButtonOk( false );
-    return;
-  }
-  enableButtonOk( true );
+    // OK button is disabled if
+    const QString name = proposedIdentityName.trimmed();
+    // name isn't empty
+    if ( name.isEmpty() ) {
+        enableButtonOk( false );
+        return;
+    }
+    // or name doesn't yet exist.
+    if ( !mIdentityManager->isUnique( name ) ) {
+        enableButtonOk( false );
+        return;
+    }
+    enableButtonOk( true );
 }
 
 QString NewIdentityDialog::identityName() const
 {
-  return mLineEdit->text();
+    return mLineEdit->text();
 }
 
 QString NewIdentityDialog::duplicateIdentity() const
 {
-  return mComboBox->currentText();
+    return mComboBox->currentText();
 }
 
 #include "newidentitydialog.moc"
diff --git a/kmail/newidentitydialog.h b/kmail/newidentitydialog.h
index e7ea20f..dc8aa3e 100644
--- a/kmail/newidentitydialog.h
+++ b/kmail/newidentitydialog.h
@@ -31,32 +31,32 @@ class KLineEdit;
 class QButtonGroup;
 
 namespace KPIMIdentities {
-  class IdentityManager;
+class IdentityManager;
 }
 
 namespace KMail {
 
 class NewIdentityDialog : public KDialog
 {
-  Q_OBJECT
+    Q_OBJECT
 
 public:
-  enum DuplicateMode { Empty, ControlCenter, ExistingEntry };
+    enum DuplicateMode { Empty, ControlCenter, ExistingEntry };
 
-  explicit NewIdentityDialog( KPIMIdentities::IdentityManager *manager, QWidget \
*parent = 0 ); +    explicit NewIdentityDialog( KPIMIdentities::IdentityManager \
*manager, QWidget *parent = 0 );  
-  QString identityName() const;
-  QString duplicateIdentity() const;
-  DuplicateMode duplicateMode() const;
+    QString identityName() const;
+    QString duplicateIdentity() const;
+    DuplicateMode duplicateMode() const;
 
 protected slots:
-  void slotEnableOK( const QString & );
+    void slotEnableOK( const QString & );
 
 private:
-  KLineEdit  *mLineEdit;
-  KComboBox  *mComboBox;
-  QButtonGroup *mButtonGroup;
-  KPIMIdentities::IdentityManager *mIdentityManager;
+    KLineEdit  *mLineEdit;
+    KComboBox  *mComboBox;
+    QButtonGroup *mButtonGroup;
+    KPIMIdentities::IdentityManager *mIdentityManager;
 };
 
 }
diff --git a/kmail/snippetwidget.h b/kmail/snippetwidget.h
index cbf07ae..11c3e82 100644
--- a/kmail/snippetwidget.h
+++ b/kmail/snippetwidget.h
@@ -37,6 +37,7 @@ public:
 protected:
     void contextMenuEvent( QContextMenuEvent* );
     void dropEvent( QDropEvent * );
+
 private:
     MailCommon::SnippetsManager *mSnippetsManager;
 };
diff --git a/kmail/undostack.cpp b/kmail/undostack.cpp
index 7250060..217138f 100644
--- a/kmail/undostack.cpp
+++ b/kmail/undostack.cpp
@@ -35,89 +35,89 @@
 namespace KMail {
 
 UndoStack::UndoStack(int size)
-  : QObject(0), mSize(size), mLastId(0),
-    mCachedInfo(0)
+    : QObject(0),
+      mSize(size),
+      mLastId(0),
+      mCachedInfo(0)
 {
-  setObjectName( "undostack" );
+    setObjectName( "undostack" );
 }
 
 UndoStack::~UndoStack()
 {
-  clear();
+    clear();
 }
 
 void UndoStack::clear()
 {
-  qDeleteAll( mStack );
-  mStack.clear();
+    qDeleteAll( mStack );
+    mStack.clear();
 }
 
 int UndoStack::newUndoAction( const Akonadi::Collection &srcFolder, const \
Akonadi::Collection &destFolder )  {
-  UndoInfo *info = new UndoInfo;
-  info->id         = ++mLastId;
-  info->srcFolder  = srcFolder;
-  info->destFolder = destFolder;
-  if ((int) mStack.count() == mSize) {
-    delete mStack.last();
-    mStack.removeLast();
-  }
-  mStack.prepend( info );
-  emit undoStackChanged();
-  return info->id;
+    UndoInfo *info = new UndoInfo;
+    info->id         = ++mLastId;
+    info->srcFolder  = srcFolder;
+    info->destFolder = destFolder;
+    if ((int) mStack.count() == mSize) {
+        delete mStack.last();
+        mStack.removeLast();
+    }
+    mStack.prepend( info );
+    emit undoStackChanged();
+    return info->id;
 }
 
 void UndoStack::addMsgToAction( int undoId, const Akonadi::Item &item )
 {
-  if ( !mCachedInfo || mCachedInfo->id != undoId ) {
-    QList<UndoInfo*>::const_iterator itr = mStack.constBegin();
-    while ( itr != mStack.constEnd() ) {
-      if ( (*itr)->id == undoId ) {
-        mCachedInfo = (*itr);
-        break;
-      }
-      ++itr;
+    if ( !mCachedInfo || mCachedInfo->id != undoId ) {
+        QList<UndoInfo*>::const_iterator itr = mStack.constBegin();
+        while ( itr != mStack.constEnd() ) {
+            if ( (*itr)->id == undoId ) {
+                mCachedInfo = (*itr);
+                break;
+            }
+            ++itr;
+        }
     }
-  }
 
-  Q_ASSERT( mCachedInfo );
-  mCachedInfo->items.append( item );
+    Q_ASSERT( mCachedInfo );
+    mCachedInfo->items.append( item );
 }
 
 void UndoStack::undo()
 {
-  if ( mStack.count() > 0 )
-  {
-    UndoInfo *info = mStack.takeFirst();
-    emit undoStackChanged();
-    Akonadi::ItemMoveJob * job = new Akonadi::ItemMoveJob( info->items, \
                info->srcFolder, this );
-    connect( job, SIGNAL(result(KJob*)), this, SLOT(slotMoveResult(KJob*)) );
-    delete info;
-  }
-  else
-  {
-    // Sorry.. stack is empty..
-    KMessageBox::sorry( kmkernel->mainWin(), i18n("There is nothing to undo."));
-  }
+    if ( mStack.count() > 0 )
+    {
+        UndoInfo *info = mStack.takeFirst();
+        emit undoStackChanged();
+        Akonadi::ItemMoveJob * job = new Akonadi::ItemMoveJob( info->items, \
info->srcFolder, this ); +        connect( job, SIGNAL(result(KJob*)), this, \
SLOT(slotMoveResult(KJob*)) ); +        delete info;
+    }
+    else
+    {
+        // Sorry.. stack is empty..
+        KMessageBox::sorry( kmkernel->mainWin(), i18n("There is nothing to undo."));
+    }
 }
 
 void UndoStack::slotMoveResult( KJob *job )
 {
-  if ( job->error() )
-    KMessageBox::sorry( kmkernel->mainWin(), i18n("Can not move message. %1", \
job->errorString() ) ); +    if ( job->error() )
+        KMessageBox::sorry( kmkernel->mainWin(), i18n("Can not move message. %1", \
job->errorString() ) );  }
 
-void
-UndoStack::pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection \
&folder, const Akonadi::Collection &destFolder) +void \
UndoStack::pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection \
&folder, const Akonadi::Collection &destFolder)  {
-  int id = newUndoAction( folder, destFolder );
-  addMsgToAction( id, item );
+    int id = newUndoAction( folder, destFolder );
+    addMsgToAction( id, item );
 }
 
-void
-UndoStack::msgDestroyed( const Akonadi::Item & /*msg*/)
+void UndoStack::msgDestroyed( const Akonadi::Item & /*msg*/)
 {
-  /*
+    /*
    for (UndoInfo *info = mStack.first(); info; )
    {
       if (info->msgIdMD5 == msg->msgIdMD5())
@@ -134,19 +134,19 @@ UndoStack::msgDestroyed( const Akonadi::Item & /*msg*/)
 void
 UndoStack::folderDestroyed( const Akonadi::Collection &folder)
 {
-  QList<UndoInfo*>::iterator it = mStack.begin();
-  while ( it != mStack.end() ) {
-    UndoInfo *info = *it;
-    if ( info &&
-          ( (info->srcFolder == folder) ||
-            (info->destFolder == folder) ) ) {
-      delete info;
-      it = mStack.erase( it );
+    QList<UndoInfo*>::iterator it = mStack.begin();
+    while ( it != mStack.end() ) {
+        UndoInfo *info = *it;
+        if ( info &&
+             ( (info->srcFolder == folder) ||
+               (info->destFolder == folder) ) ) {
+            delete info;
+            it = mStack.erase( it );
+        }
+        else
+            ++it;
     }
-    else
-      ++it;
-  }
-  emit undoStackChanged();
+    emit undoStackChanged();
 }
 
 }
diff --git a/kmail/undostack.h b/kmail/undostack.h
index b3fb7ab..3c08667 100644
--- a/kmail/undostack.h
+++ b/kmail/undostack.h
@@ -34,43 +34,43 @@ namespace KMail {
 class UndoInfo
 {
 public:
-  int          id;
-  Akonadi::Item::List items;
-  Akonadi::Collection srcFolder;
-  Akonadi::Collection destFolder;
+    int id;
+    Akonadi::Item::List items;
+    Akonadi::Collection srcFolder;
+    Akonadi::Collection destFolder;
 };
 
 class UndoStack : public QObject
 {
-  Q_OBJECT
+    Q_OBJECT
 
 public:
-  explicit UndoStack(int size);
-  ~UndoStack();
+    explicit UndoStack(int size);
+    ~UndoStack();
 
-  void clear();
-  int  size() const { return mStack.count(); }
-  int  newUndoAction( const Akonadi::Collection& srcFolder, const \
                Akonadi::Collection & destFolder );
-  void addMsgToAction( int undoId, const Akonadi::Item &item );
-  void undo();
+    void clear();
+    int  size() const { return mStack.count(); }
+    int  newUndoAction( const Akonadi::Collection& srcFolder, const \
Akonadi::Collection & destFolder ); +    void addMsgToAction( int undoId, const \
Akonadi::Item &item ); +    void undo();
 
-  void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection&, const \
                Akonadi::Collection& destFolder);
-  void folderDestroyed( const Akonadi::Collection &folder);
+    void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection&, \
const Akonadi::Collection& destFolder); +    void folderDestroyed( const \
Akonadi::Collection &folder);  
 public slots:
-  void msgDestroyed( const Akonadi::Item &msg);
+    void msgDestroyed( const Akonadi::Item &msg);
 
 protected slots:
-  void slotMoveResult(KJob*);
-  
+    void slotMoveResult(KJob*);
+
 protected:
-  QList<UndoInfo*> mStack;
-  int mSize;
-  int mLastId;
-  UndoInfo *mCachedInfo;
+    QList<UndoInfo*> mStack;
+    int mSize;
+    int mLastId;
+    UndoInfo *mCachedInfo;
 
 signals:
-   void undoStackChanged();
+    void undoStackChanged();
 };
 
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic