r23892 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 15 23:10:43 UTC 2020
Author: jghali
Date: Mon Jun 15 23:10:43 2020
New Revision: 23892
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23892
Log:
Code cleanup
Modified:
trunk/Scribus/scribus/ui/directionselect.cpp
trunk/Scribus/scribus/ui/directionselect.h
trunk/Scribus/scribus/ui/smdirectionselect.cpp
Modified: trunk/Scribus/scribus/ui/directionselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23892&path=/trunk/Scribus/scribus/ui/directionselect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/directionselect.cpp (original)
+++ trunk/Scribus/scribus/ui/directionselect.cpp Mon Jun 15 23:10:43 2020
@@ -15,28 +15,26 @@
DirectionSelect::DirectionSelect(QWidget* parent) : QWidget(parent)
{
- selected = 0;
-
buttonGroup = new QButtonGroup(this);
- GroupSelectLayout = new QHBoxLayout( this );
- GroupSelectLayout->setSpacing( 0 );
- GroupSelectLayout->setMargin( 5 );
- GroupSelectLayout->setAlignment(Qt::AlignRight);
+ groupSelectLayout = new QHBoxLayout( this );
+ groupSelectLayout->setSpacing( 0 );
+ groupSelectLayout->setMargin( 5 );
+ groupSelectLayout->setAlignment(Qt::AlignRight);
LTR = new QToolButton( this );
LTR->setMaximumSize( QSize( 22, 22 ) );
LTR->setIcon(IconManager::instance().loadIcon("16/text-direction-ltr.png"));
LTR->setCheckable( true );
LTR->setChecked( true );
- GroupSelectLayout->addWidget( LTR );
+ groupSelectLayout->addWidget( LTR );
buttonGroup->addButton(LTR, 0);
RTL = new QToolButton( this );
RTL->setMaximumSize( QSize( 22, 22 ) );
RTL->setIcon(IconManager::instance().loadIcon("16/text-direction-rtl.png"));
RTL->setCheckable( true );
- GroupSelectLayout->addWidget( RTL );
+ groupSelectLayout->addWidget( RTL );
buttonGroup->addButton(RTL, 1);
resize(minimumSizeHint());
@@ -63,13 +61,13 @@
void DirectionSelect::setTypeStyle(int a)
{
- selected = a;
+ m_selected = a;
emit State(a);
}
int DirectionSelect::selectedId()
{
- return selected;
+ return m_selected;
}
void DirectionSelect::changeEvent(QEvent *e)
Modified: trunk/Scribus/scribus/ui/directionselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23892&path=/trunk/Scribus/scribus/ui/directionselect.h
==============================================================================
--- trunk/Scribus/scribus/ui/directionselect.h (original)
+++ trunk/Scribus/scribus/ui/directionselect.h Mon Jun 15 23:10:43 2020
@@ -29,17 +29,18 @@
int getStyle();
int selectedId();
- QButtonGroup* buttonGroup;
- int selected;
- QToolButton* RTL;
- QToolButton* LTR;
+ QButtonGroup* buttonGroup { nullptr };
+ QToolButton* RTL { nullptr };
+ QToolButton* LTR { nullptr };
public slots:
void iconSetChange();
void languageChange();
protected:
- QHBoxLayout* GroupSelectLayout;
+ QHBoxLayout* groupSelectLayout { nullptr };
+
+ int m_selected { 0 };
void changeEvent(QEvent *e) override;
Modified: trunk/Scribus/scribus/ui/smdirectionselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23892&path=/trunk/Scribus/scribus/ui/smdirectionselect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smdirectionselect.cpp (original)
+++ trunk/Scribus/scribus/ui/smdirectionselect.cpp Mon Jun 15 23:10:43 2020
@@ -8,7 +8,7 @@
parentButton->setCheckable( true );
parentButton->setText( tr("P", "P as in Parent"));
parentButton->setToolTip( tr("Use parent style's direction instead of overriding it"));
- GroupSelectLayout->addWidget( parentButton );
+ groupSelectLayout->addWidget( parentButton );
resize(minimumSizeHint());
parentButton->hide();
}
More information about the scribus-commit
mailing list