Commit e343c6b7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

don't use const'ref for int

parent 7765b7e7
Pipeline #178920 passed with stage
in 2 minutes and 8 seconds
......@@ -48,9 +48,7 @@ ChemicalDataObject::ChemicalDataObject()
d->m_unit = KUnitConversion::NoUnit;
}
ChemicalDataObject::ChemicalDataObject(const ChemicalDataObject &other)
= default;
ChemicalDataObject::ChemicalDataObject(const ChemicalDataObject &other) = default;
ChemicalDataObject::~ChemicalDataObject() = default;
......
......@@ -117,7 +117,7 @@ void DetailedInfoDlg::setTableType(int tableTyp)
QTextBrowser *DetailedInfoDlg::addHTMLTab(const QString &title, const QString &icontext, const QString &iconname)
{
auto *frame = new QWidget(this);
auto frame = new QWidget(this);
KPageWidgetItem *item = addPage(frame, title);
item->setHeader(icontext);
item->setIcon(QIcon::fromTheme(iconname));
......
......@@ -35,7 +35,7 @@ PeriodicTableStates::PeriodicTableStates(const QList<ElementItem *> &elementItem
m_states.start();
}
void PeriodicTableStates::setNumerationItemPositions(const int &tableIndex)
void PeriodicTableStates::setNumerationItemPositions(int tableIndex)
{
hideAllNumerationItems(tableIndex);
......@@ -49,9 +49,9 @@ void PeriodicTableStates::setNumerationItemPositions(const int &tableIndex)
}
}
void PeriodicTableStates::hideAllNumerationItems(const int &tableIndex)
void PeriodicTableStates::hideAllNumerationItems(int tableIndex)
{
foreach (NumerationItem *item, m_numerationItemList) {
for (NumerationItem *item : std::as_const(m_numerationItemList)) {
m_tableStatesList.at(tableIndex)->assignProperty(item, "pos", QPointF(hiddenPoint()));
}
}
......@@ -61,7 +61,7 @@ QPoint PeriodicTableStates::hiddenPoint() const
return QPoint(-40, -400);
}
int PeriodicTableStates::maxNumerationItemXCoordinate(const int &tableIndex)
int PeriodicTableStates::maxNumerationItemXCoordinate(int tableIndex)
{
const int maxTableLenght = pseTables::instance()->getTabletype(tableIndex)->tableSize().x();
......@@ -76,7 +76,7 @@ void PeriodicTableStates::addElementAnimation(QGraphicsObject *object, int durat
m_group->addAnimation(anim);
}
void PeriodicTableStates::setElementItemPositions(const int &tableIndex)
void PeriodicTableStates::setElementItemPositions(int tableIndex)
{
for (int i = 0; i < m_elementItemList.size(); ++i) {
const int elementNumber = m_elementItemList.at(i)->data(0).toInt();
......@@ -93,7 +93,7 @@ void PeriodicTableStates::setElementItemPositions(const int &tableIndex)
}
}
QRectF PeriodicTableStates::pseRect(const int &tableIndex) const
QRectF PeriodicTableStates::pseRect(int tableIndex) const
{
const QPoint maxTableCoords = pseTables::instance()->getTabletype(tableIndex)->tableSize();
......@@ -105,7 +105,7 @@ QRectF PeriodicTableStates::pseRect(const int &tableIndex) const
return QRectF(0, -m_height, x * m_width, y * m_height);
}
void PeriodicTableStates::setTableState(const int &tableIndex)
void PeriodicTableStates::setTableState(int tableIndex)
{
m_stateSwitcher->switchToState(tableIndex);
}
......
......@@ -43,22 +43,22 @@ public:
* @param tableIndex Index of the table @see pseTables.
* @return Rectangle in floating point precision.
*/
QRectF pseRect(const int &tableIndex) const;
QRectF pseRect(int tableIndex) const;
/**
* Set the table index
* @param tableIndex Index of the table @see pseTables..
*/
void setTableState(const int &tableIndex);
void setTableState(int tableIndex);
private:
void setNumerationItemPositions(const int &tableIndex);
void hideAllNumerationItems(const int &tableIndex);
int maxNumerationItemXCoordinate(const int &tableIndex);
void setNumerationItemPositions(int tableIndex);
void hideAllNumerationItems(int tableIndex);
int maxNumerationItemXCoordinate(int tableIndex);
void addElementAnimation(QGraphicsObject *object, int factor = 1);
void setElementItemPositions(const int &tableIndex);
void setElementItemPositions(int tableIndex);
QPoint hiddenPoint() const;
......
......@@ -11,7 +11,7 @@ StateSwitcher::StateSwitcher(QStateMachine *machine)
{
}
void StateSwitcher::addState(QState *state, QAbstractAnimation *animation, const int &id)
void StateSwitcher::addState(QState *state, QAbstractAnimation *animation, int id)
{
auto trans = new StateSwitchTransition(id);
trans->setTargetState(state);
......
......@@ -71,7 +71,7 @@ class StateSwitcher : public QState
public:
explicit StateSwitcher(QStateMachine *machine);
void addState(QState *state, QAbstractAnimation *animation, const int &id);
void addState(QState *state, QAbstractAnimation *animation, int id);
void switchToState(int n);
};
......
......@@ -253,9 +253,9 @@ MyTableWidget::MyTableWidget(QWidget *parent)
void MyTableWidget::contextMenuEvent(QContextMenuEvent *event)
{
auto *menu = new QMenu((QWidget *)sender());
menu->addAction(i18n("&Copy"), this, &MyTableWidget::copyToClipboard, QKeySequence(Qt::Key_C | Qt::CTRL));
menu->exec(event->globalPos());
auto menu = QMenu((QWidget *)sender());
menu.addAction(i18n("&Copy"), this, &MyTableWidget::copyToClipboard, QKeySequence(Qt::Key_C | Qt::CTRL));
menu.exec(event->globalPos());
}
void MyTableWidget::copyToClipboard()
......
Supports Markdown
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