From e0a4ed3a4bdebafc10e5ad29fc8ff317d7466654 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 17 Jan 2013 07:56:21 +0100 Subject: [PATCH 1/3] Remove some not necessary virtual keyword --- addressvalidationjob.h | 4 ++-- attachmentcontroller.h | 2 +- attachmentview.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addressvalidationjob.h b/addressvalidationjob.h index dfe33bde6..ff932e3d8 100644 --- a/addressvalidationjob.h +++ b/addressvalidationjob.h @@ -30,10 +30,10 @@ class AddressValidationJob : public KJob Q_OBJECT public: - AddressValidationJob( const QString &emailAddresses, QWidget *parentWidget, QObject *parent = 0 ); + explicit AddressValidationJob( const QString &emailAddresses, QWidget *parentWidget, QObject *parent = 0 ); ~AddressValidationJob(); - virtual void start(); + void start(); bool isValid() const; diff --git a/attachmentcontroller.h b/attachmentcontroller.h index 87899eb12..264c95b2b 100644 --- a/attachmentcontroller.h +++ b/attachmentcontroller.h @@ -45,7 +45,7 @@ class AttachmentController : public Message::AttachmentControllerBase public slots: /// @reimp - virtual void attachMyPublicKey(); + void attachMyPublicKey(); private slots: diff --git a/attachmentview.h b/attachmentview.h index d68949460..4194d4f36 100644 --- a/attachmentview.h +++ b/attachmentview.h @@ -56,13 +56,13 @@ class AttachmentView : public QTreeView void updateAttachmentLabel(); protected: /** reimpl to avoid default drag cursor */ - virtual void startDrag( Qt::DropActions supportedActions ); + void startDrag( Qt::DropActions supportedActions ); /* reimpl */ - virtual void contextMenuEvent( QContextMenuEvent *event ); + void contextMenuEvent( QContextMenuEvent *event ); /* reimpl */ - virtual void keyPressEvent( QKeyEvent *event ); + void keyPressEvent( QKeyEvent *event ); /** reimpl to avoid drags from ourselves */ - virtual void dragEnterEvent( QDragEnterEvent *event ); + void dragEnterEvent( QDragEnterEvent *event ); private Q_SLOTS: void slotShowHideAttchementList(bool); From 4d4ce3a1c5c439635c9ddb7c7b3bf9dabfafbc4b Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 17 Jan 2013 08:03:50 +0100 Subject: [PATCH 2/3] Remove not necessary virtual keyword --- createnewcontactjob.h | 2 +- kmmainwin.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/createnewcontactjob.h b/createnewcontactjob.h index 418757696..b8dd589cf 100644 --- a/createnewcontactjob.h +++ b/createnewcontactjob.h @@ -46,7 +46,7 @@ public: /** * @brief start the job */ - virtual void start(); + void start(); private Q_SLOTS: void slotCollectionsFetched(KJob*); diff --git a/kmmainwin.h b/kmmainwin.h index f5529d6a6..98e7d51b8 100644 --- a/kmmainwin.h +++ b/kmmainwin.h @@ -58,9 +58,9 @@ public slots: protected: /// Reimplemented to save the docked state - virtual void saveProperties( KConfigGroup & ); + void saveProperties( KConfigGroup & ); - virtual bool queryClose (); + bool queryClose (); protected slots: void slotQuit(); From d0df4dc2f6bf111d0b19112cc7630a6e6ece26d5 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Thu, 17 Jan 2013 08:08:57 +0100 Subject: [PATCH 3/3] Not necessary to store this pointer --- xfaceconfigurator.cpp | 22 +++++++++++----------- xfaceconfigurator.h | 4 ---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/xfaceconfigurator.cpp b/xfaceconfigurator.cpp index ef44a0cbd..90ce998fc 100644 --- a/xfaceconfigurator.cpp +++ b/xfaceconfigurator.cpp @@ -104,32 +104,32 @@ namespace KMail { // "obtain X-Face from" combo and label: hlay = new QHBoxLayout(); // inherits spacing vlay->addLayout( hlay ); - mSourceCombo = new KComboBox( this ); - mSourceCombo->setEditable( false ); - mSourceCombo->setWhatsThis( + KComboBox *sourceCombo = new KComboBox( this ); + sourceCombo->setEditable( false ); + sourceCombo->setWhatsThis( i18n("Click on the widgets below to obtain help on the input methods.")); - mSourceCombo->setEnabled( false ); // since !mEnableCheck->isChecked() - mSourceCombo->addItems( QStringList() + sourceCombo->setEnabled( false ); // since !mEnableCheck->isChecked() + sourceCombo->addItems( QStringList() << i18nc( "continuation of \"obtain picture from\"", "External Source" ) << i18nc( "continuation of \"obtain picture from\"", "Input Field Below" ) ); label = new QLabel( i18n("Obtain pic&ture from:"), this ); - label->setBuddy( mSourceCombo ); + label->setBuddy( sourceCombo ); label->setEnabled( false ); // since !mEnableCheck->isChecked() hlay->addWidget( label ); - hlay->addWidget( mSourceCombo, 1 ); + hlay->addWidget( sourceCombo, 1 ); // widget stack that is controlled by the source combo: QStackedWidget * widgetStack = new QStackedWidget( this ); widgetStack->setEnabled( false ); // since !mEnableCheck->isChecked() vlay->addWidget( widgetStack, 1 ); - connect( mSourceCombo, SIGNAL(highlighted(int)), + connect( sourceCombo, SIGNAL(highlighted(int)), widgetStack, SLOT(setCurrentIndex(int)) ); - connect( mSourceCombo, SIGNAL(activated(int)), + connect( sourceCombo, SIGNAL(activated(int)), widgetStack, SLOT(setCurrentIndex(int)) ); connect( mEnableCheck, SIGNAL(toggled(bool)), - mSourceCombo, SLOT(setEnabled(bool)) ); + sourceCombo, SLOT(setEnabled(bool)) ); connect( mEnableCheck, SIGNAL(toggled(bool)), widgetStack, SLOT(setEnabled(bool)) ); connect( mEnableCheck, SIGNAL(toggled(bool)), @@ -172,7 +172,7 @@ namespace KMail { label1->setWordWrap( true ); page_vlay->addWidget( label1 ); - widgetStack->setCurrentIndex( 0 ); // since mSourceCombo->currentItem() == 0 + widgetStack->setCurrentIndex( 0 ); // since sourceCombo->currentItem() == 0 // page 1: input field for direct entering ++pageno; diff --git a/xfaceconfigurator.h b/xfaceconfigurator.h index e1761f01d..1a0d640b0 100644 --- a/xfaceconfigurator.h +++ b/xfaceconfigurator.h @@ -19,7 +19,6 @@ #include -class KComboBox; class KJob; class KTextEdit; class KUrl; @@ -55,9 +54,6 @@ namespace KMail { QCheckBox * mEnableCheck; KTextEdit * mTextEdit; QLabel * mXFaceLabel; - KComboBox * mSourceCombo; - - }; } // namespace KMail