From 3d7c005808492b8c380b73d30f5be569980a1e5c Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Wed, 11 Mar 2015 21:27:13 +0100 Subject: [PATCH] Clean up --- identity/newidentitydialog.h | 6 ++++- identity/xfaceconfigurator.cpp | 45 +++++++++++++--------------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/identity/newidentitydialog.h b/identity/newidentitydialog.h index dc8aa3ed6..0ed088bf7 100644 --- a/identity/newidentitydialog.h +++ b/identity/newidentitydialog.h @@ -41,7 +41,11 @@ class NewIdentityDialog : public KDialog Q_OBJECT public: - enum DuplicateMode { Empty, ControlCenter, ExistingEntry }; + enum DuplicateMode { + Empty = 0, + ControlCenter, + ExistingEntry + }; explicit NewIdentityDialog( KPIMIdentities::IdentityManager *manager, QWidget *parent = 0 ); diff --git a/identity/xfaceconfigurator.cpp b/identity/xfaceconfigurator.cpp index 5841f5d41..b450815c1 100644 --- a/identity/xfaceconfigurator.cpp +++ b/identity/xfaceconfigurator.cpp @@ -65,22 +65,11 @@ namespace KMail { XFaceConfigurator::XFaceConfigurator( QWidget * parent ) : QWidget( parent ) { - // tmp. vars: - QLabel * label; - QLabel * label1; - QLabel * label2; - QWidget * page; - QVBoxLayout * vlay; - QHBoxLayout * hlay; - QVBoxLayout * page_vlay; - QPushButton * mFromFileBtn; - QPushButton * mFromAddrbkBtn; - - vlay = new QVBoxLayout( this ); + QVBoxLayout *vlay = new QVBoxLayout( this ); vlay->setObjectName( QLatin1String("main layout") ); vlay->setSpacing( KDialog::spacingHint() ); vlay->setMargin( 0 ); - hlay = new QHBoxLayout(); + QHBoxLayout *hlay = new QHBoxLayout(); vlay->addLayout( hlay ); // "enable X-Face" checkbox: @@ -114,7 +103,7 @@ XFaceConfigurator::XFaceConfigurator( QWidget * parent ) "External Source" ) << i18nc( "continuation of \"obtain picture from\"", "Input Field Below" ) ); - label = new QLabel( i18n("Obtain pic&ture from:"), this ); + QLabel *label = new QLabel( i18n("Obtain pic&ture from:"), this ); label->setBuddy( sourceCombo ); label->setEnabled( false ); // since !mEnableCheck->isChecked() hlay->addWidget( label ); @@ -140,31 +129,31 @@ XFaceConfigurator::XFaceConfigurator( QWidget * parent ) int pageno = 0; // page 0: create X-Face from image file or address book entry - page = new QWidget( widgetStack ); + QWidget *page = new QWidget( widgetStack ); widgetStack->insertWidget( pageno, page ); // force sequential numbers (play safe) - page_vlay = new QVBoxLayout( page ); + QVBoxLayout *page_vlay = new QVBoxLayout( page ); page_vlay->setMargin( 0 ); page_vlay->setSpacing( KDialog::spacingHint() ); hlay = new QHBoxLayout(); // inherits spacing ??? FIXME really? page_vlay->addLayout( hlay ); - mFromFileBtn = new QPushButton( i18n("Select File..."), page ); - mFromFileBtn->setWhatsThis( + QPushButton *fromFileButton = new QPushButton( i18n("Select File..."), page ); + fromFileButton->setWhatsThis( i18n("Use this to select an image file to create the picture from. " "The image should be of high contrast and nearly quadratic shape. " "A light background helps improve the result." ) ); - mFromFileBtn->setAutoDefault( false ); - page_vlay->addWidget( mFromFileBtn, 1 ); - connect( mFromFileBtn, SIGNAL(released()), + fromFileButton->setAutoDefault( false ); + page_vlay->addWidget( fromFileButton, 1 ); + connect( fromFileButton, SIGNAL(released()), this, SLOT(slotSelectFile()) ); - mFromAddrbkBtn = new QPushButton( i18n("Set From Address Book"), page ); - mFromAddrbkBtn->setWhatsThis( + QPushButton *fromAddressBookButton = new QPushButton( i18n("Set From Address Book"), page ); + fromAddressBookButton->setWhatsThis( i18n( "You can use a scaled-down version of the picture " "you have set in your address book entry." ) ); - mFromAddrbkBtn->setAutoDefault( false ); - page_vlay->addWidget( mFromAddrbkBtn, 1 ); - connect( mFromAddrbkBtn, SIGNAL(released()), + fromAddressBookButton->setAutoDefault( false ); + page_vlay->addWidget( fromAddressBookButton, 1 ); + connect( fromAddressBookButton, SIGNAL(released()), this, SLOT(slotSelectFromAddressbook()) ); - label1 = new QLabel( i18n("KMail can send a small (48x48 pixels), low-quality, " + QLabel *label1 = new QLabel( i18n("KMail can send a small (48x48 pixels), low-quality, " "monochrome picture with every message. " "For example, this could be a picture of you or a glyph. " "It is shown in the recipient's mail client (if supported)." ), page ); @@ -187,7 +176,7 @@ XFaceConfigurator::XFaceConfigurator( QWidget * parent ) mTextEdit->setFont( KGlobalSettings::fixedFont() ); mTextEdit->setWordWrapMode( QTextOption::WrapAnywhere); mTextEdit->setSearchSupport(false); - label2 = new QLabel( i18n("Examples are available at " "http://ace.home.xs4all.nl/X-Faces/."), page ); label2->setOpenExternalLinks(true);