Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 724cc448 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some clazy warning

parent ebadcaf8
......@@ -132,7 +132,7 @@ signals:
void dropActive(bool active);
void updateMoves(int moves);
void solverStateChanged(QString text);
void solverStateChanged(const QString &text);
void cardsPickedUp();
void cardsPutDown();
......
......@@ -121,18 +121,18 @@ QString Freecell::solverFormat() const
tmp += suitToString(target[i]->topCard()->suit()) + '-' + rankToString(target[i]->topCard()->rank()) + ' ';
}
if (!tmp.isEmpty())
output += QString::fromLatin1("Foundations: %1\n").arg(tmp);
output += QStringLiteral("Foundations: %1\n").arg(tmp);
tmp.truncate(0);
for (int i = 0; i < 4 ; i++) {
if (freecell[i]->isEmpty())
tmp += "- ";
tmp += QLatin1String("- ");
else
tmp += rankToString(freecell[i]->topCard()->rank()) + suitToString(freecell[i]->topCard()->suit()) + ' ';
}
if (!tmp.isEmpty())
{
QString a = QString::fromLatin1("Freecells: %1\n");
QString a = QStringLiteral("Freecells: %1\n");
output += a.arg(tmp);
}
......
......@@ -92,7 +92,7 @@ public:
CardState newState;
QList<KCard*> cards;
CardStateChange( CardState oldState, CardState newState, QList<KCard*> cards )
CardStateChange( CardState oldState, CardState newState, const QList<KCard*> &cards )
: oldState( oldState ),
newState( newState ),
cards( cards )
......@@ -108,7 +108,7 @@ public:
SolverInterface::ExitStatus solvability;
QList<MOVE> winningMoves;
GameState( QList<CardStateChange> changes, QString stateData )
GameState( const QList<CardStateChange> &changes, const QString &stateData )
: changes ( changes ),
stateData( stateData ),
solvability( SolverInterface::SearchAborted )
......
......@@ -128,13 +128,13 @@ QString KCardDeck::elementName( quint32 id, bool faceUp ) const
switch( rank )
{
case King:
element = QLatin1String("king");
element = QStringLiteral("king");
break;
case Queen:
element = QLatin1String("queen");
element = QStringLiteral("queen");
break;
case Jack:
element = QLatin1String("jack");
element = QStringLiteral("jack");
break;
default:
element = QString::number( rank );
......
......@@ -763,7 +763,7 @@ void KCardScene::recalculatePileLayouts()
}
void KCardScene::setHighlightedItems( QList<QGraphicsItem*> items )
void KCardScene::setHighlightedItems( const QList<QGraphicsItem*> &items )
{
QSet<QGraphicsItem*> s = QSet<QGraphicsItem*>::fromList( items );
foreach ( QGraphicsItem * i, d->highlightedItems.subtract( s ) )
......
......@@ -90,7 +90,7 @@ public:
void removePile( KCardPile * pile );
QList<KCardPile*> piles() const;
void setHighlightedItems( QList<QGraphicsItem*> items );
void setHighlightedItems( const QList<QGraphicsItem*> &items );
void clearHighlightedItems();
QList<QGraphicsItem*> highlightedItems() const;
......
......@@ -216,13 +216,13 @@ QSet<QString> KCardTheme::supportedFeatures() const
}
bool KCardTheme::operator==( KCardTheme theme ) const
bool KCardTheme::operator==( const KCardTheme &theme ) const
{
return dirName() == theme.dirName();
}
bool KCardTheme::operator!=( KCardTheme theme ) const
bool KCardTheme::operator!=( const KCardTheme &theme ) const
{
return !operator==( theme );
}
......
......@@ -49,8 +49,8 @@ public:
QDateTime lastModified() const;
QSet<QString> supportedFeatures() const;
bool operator==( KCardTheme theme ) const;
bool operator!=( KCardTheme theme ) const;
bool operator==( const KCardTheme &theme ) const;
bool operator!=( const KCardTheme &theme ) const;
private:
QSharedDataPointer<const KCardThemePrivate> d;
......
......@@ -532,7 +532,7 @@ void MainWindow::setGameType(int id)
m_gameHelpAction->setText(i18nc("Is disabled and changes to \"Help &with Current Game\" when"
" there is no current game.",
"Help &with %1", di->baseName().replace('&', "&&")));
"Help &with %1", di->baseName().replace('&', QLatin1String("&&"))));
connect(m_dealer, &DealerScene::solverStateChanged, this, &MainWindow::updateSolverDescription);
connect(m_dealer, &DealerScene::updateMoves, this, &MainWindow::slotUpdateMoves);
......
......@@ -151,13 +151,13 @@ bool checkAddAlternateColorDescendingFromKing( const QList<KCard*> & oldCards, c
QString suitToString(int s) {
switch (s) {
case KCardDeck::Clubs:
return "C";
return QStringLiteral("C");
case KCardDeck::Hearts:
return "H";
return QStringLiteral("H");
case KCardDeck::Diamonds:
return "D";
return QStringLiteral("D");
case KCardDeck::Spades:
return "S";
return QStringLiteral("S");
default:
exit(-1);
}
......@@ -168,15 +168,15 @@ QString rankToString(int r)
{
switch (r) {
case KCardDeck::King:
return "K";
return QStringLiteral("K");
case KCardDeck::Ace:
return "A";
return QStringLiteral("A");
case KCardDeck::Jack:
return "J";
return QStringLiteral("J");
case KCardDeck::Queen:
return "Q";
return QStringLiteral("Q");
case KCardDeck::Ten:
return "T";
return QStringLiteral("T");
default:
return QString::number(r);
}
......
......@@ -164,7 +164,7 @@ QString Simon::solverFormat() const
tmp += suitToString(target[i]->topCard()->suit()) + "-K ";
}
if (!tmp.isEmpty())
output += QString::fromLatin1("Foundations: %1\n").arg(tmp);
output += QStringLiteral("Foundations: %1\n").arg(tmp);
for (int i = 0; i < 10 ; i++)
{
......
......@@ -128,7 +128,7 @@ void StatisticsDialog::setGameType(int gameIndex)
ui->CurrentStreak->setText( i18np("1 loss", "%1 losses", l) );
else
ui->CurrentStreak->setText( i18np("1 win", "%1 wins",
cg.readEntry(QString("winstreak%1").arg(gameIndex),0)) );
cg.readEntry(QStringLiteral("winstreak%1").arg(gameIndex),0)) );
}
void StatisticsDialog::resetStats()
......
Markdown is supported
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