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

Fix clazy warning

parent e946e3fc
......@@ -131,12 +131,10 @@ const double RATING_REMIS = 20000.0;
const double RATING_ONE_POINT = 500.0;
// Tactical ratings
const double RATING_AMOUNT_TRUMPCARD = 3.0 * RATING_ONE_POINT;
const double RATING_AMOUNT_GRANDCARD = 15.0 * RATING_ONE_POINT;
const double RATING_AMOUNT_OPENCARD = 1.5 * RATING_ONE_POINT;
const double RATING_AMOUNT_ACES = 3.0 * RATING_ONE_POINT;
const double RATING_AMOUNT_TENS = 1.0 * RATING_ONE_POINT;
const double RATING_AMOUNT_JACKS = 8.5 * RATING_ONE_POINT;
const double RATING_GOOD_MISSING_SUITE = 3.5 * RATING_ONE_POINT;
const double RATING_JACK_OF_CLUBS = 0.8 * RATING_ONE_POINT;
const double RATING_JACK_OF_SPADE = 0.6 * RATING_ONE_POINT;
......
......@@ -117,7 +117,7 @@ void KCardInfo::setSuit(KCardInfo::Suit s)
m_suit = s;
}
bool KCardInfo::operator==(const KCardInfo &c) const
bool KCardInfo::operator==(KCardInfo c) const
{
return (c.card() == card() && c.suit() == suit());
}
......@@ -162,7 +162,7 @@ QString KCardInfo::svgName() const
return s;
}
QPixmap doRender(const QString &element, QSvgRenderer *r, const QSize &s)
QPixmap doRender(const QString &element, QSvgRenderer *r, QSize s)
{
QPixmap pix = QPixmap(s);
pix.fill(Qt::transparent);
......@@ -172,7 +172,7 @@ QPixmap doRender(const QString &element, QSvgRenderer *r, const QSize &s)
return pix;
}
QString keyForPixmap(const QString &theme, const QString &element, const QSize &s)
QString keyForPixmap(const QString &theme, const QString &element, QSize s)
{
return theme + QLatin1Char('_') + element + QLatin1Char('_')
+ QString::number(s.width()) + QLatin1Char('_')
......@@ -311,7 +311,7 @@ QPixmap KCardCache::backside() const
QPixmap pix;
if (d->deckName.isEmpty() || d->size.isEmpty())
return pix;
QString element = QLatin1String("back");
QString element = QStringLiteral("back");
QString key = keyForPixmap(d->deckName, element, d->size);
{
......@@ -327,7 +327,7 @@ QPixmap KCardCache::backside() const
return pix;
}
QPixmap KCardCache::frontside(const KCardInfo &info) const
QPixmap KCardCache::frontside(KCardInfo info) const
{
QPixmap pix;
if (d->deckName.isEmpty() || d->size.isEmpty())
......@@ -365,7 +365,7 @@ void KCardCache::setDeckName(const QString &theme)
delete d->cache;
// The default size is arbitrary: it reflects the old KPixmapCache default
// and it seems to match the real maximum size for the decks
d->cache = new KImageCache(QString::fromLatin1("kdegames-cards_%1").arg(theme), 3*(1024<<10));
d->cache = new KImageCache(QStringLiteral("kdegames-cards_%1").arg(theme), 3*(1024<<10));
QDateTime dt = QFileInfo(CardDeckInfo::svgFilePath(theme)).lastModified();
if (d->cache->lastModifiedTime() < dt)
{
......@@ -428,7 +428,7 @@ void KCardCache::loadTheme(LoadInfos infos)
d->loadThread->start(QThread::IdlePriority);
}
QSizeF KCardCache::defaultCardSize(const KCardInfo &info) const
QSizeF KCardCache::defaultCardSize(KCardInfo info) const
{
if (d->deckName.isEmpty())
return QSizeF();
......@@ -461,7 +461,7 @@ QSizeF KCardCache::defaultBackSize() const
if (d->deckName.isEmpty())
return QSizeF();
QString element = QLatin1String("back");
QString element = QStringLiteral("back");
QPixmap pix;
QString key = d->deckName + QLatin1Char('_') + element + QLatin1String("_default");
{
......
......@@ -46,7 +46,7 @@ public:
Suit suit() const;
QString svgName() const;
bool operator==(const KCardInfo &c) const;
bool operator==(KCardInfo c) const;
private:
Suit m_suit;
Card m_card;
......@@ -194,7 +194,7 @@ public:
* @see setSize
* @see CardInfo
*/
QPixmap frontside(const KCardInfo &info) const;
QPixmap frontside(KCardInfo info) const;
/**
* Retrieve the default size for the frontside card.
......@@ -208,7 +208,7 @@ public:
* @returns the default size of the selected frontside card
*
*/
QSizeF defaultCardSize(const KCardInfo &info) const;
QSizeF defaultCardSize(KCardInfo info) const;
/**
* Invalidates all cached images in the current size for the current
......
......@@ -54,7 +54,7 @@ public:
// Add SVG card sets
QStringList list;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "carddecks", QStandardPaths::LocateDirectory);
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("carddecks"), QStandardPaths::LocateDirectory);
for (const QString& dir : dirs) {
const QStringList deckFolderNames = QDir(dir).entryList(QStringList() << QStringLiteral("svg*"));
for (const QString& deck : deckFolderNames) {
......
......@@ -80,7 +80,7 @@ Mainwindow::Mainwindow(QWidget *parent)
// Read theme files
QStringList themeList;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, "grafix", QStandardPaths::LocateDirectory);
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, QStringLiteral("grafix"), QStandardPaths::LocateDirectory);
for (const QString& dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.desktop"));
for (const QString& file : fileNames) {
......@@ -385,7 +385,7 @@ void Mainwindow::initGUI()
// Determine start player
KSelectAction *startPlayerAct = new KSelectAction(i18n("Starting Player"), this);
actionCollection()->addAction(QLatin1String("startplayer"), startPlayerAct);
actionCollection()->addAction(QStringLiteral("startplayer"), startPlayerAct);
connect(startPlayerAct, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuStartplayer);
startPlayerAct->setToolTip(i18n("Changing starting player..."));
startPlayerAct->setWhatsThis(i18n("Chooses which player begins the next game."));
......@@ -398,7 +398,7 @@ void Mainwindow::initGUI()
// Determine who plays player 1
KSelectAction *player1Act = new KSelectAction(i18n("Player &1 Played By"), this);
actionCollection()->addAction(QLatin1String("player1"), player1Act);
actionCollection()->addAction(QStringLiteral("player1"), player1Act);
connect(player1Act, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuPlayer1By);
player1Act->setToolTip(i18n("Changing who plays player 1..."));
player1Act->setWhatsThis(i18n("Changing who plays player 1."));
......@@ -410,7 +410,7 @@ void Mainwindow::initGUI()
// Determine who plays player 2
KSelectAction *player2Act = new KSelectAction(i18n("Player &2 Played By"), this);
actionCollection()->addAction(QLatin1String("player2"), player2Act);
actionCollection()->addAction(QStringLiteral("player2"), player2Act);
connect(player2Act, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::menuPlayer2By);
player2Act->setToolTip(i18n("Changing who plays player 2..."));
player2Act->setWhatsThis(i18n("Changing who plays player 2."));
......@@ -422,7 +422,7 @@ void Mainwindow::initGUI()
themes.sort();
KSelectAction *themeAct = new KSelectAction(i18n("&Theme"), this);
actionCollection()->addAction(QLatin1String("theme"), themeAct);
actionCollection()->addAction(QStringLiteral("theme"), themeAct);
themeAct->setItems(themes);
connect(themeAct, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered), this, &Mainwindow::changeTheme);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "Setting current theme item to " << mThemeIndexNo;
......@@ -431,7 +431,7 @@ void Mainwindow::initGUI()
themeAct->setWhatsThis(i18n("Changing theme."));
// Choose card deck
QAction *action1 = actionCollection()->addAction(QLatin1String("select_carddeck"));
QAction *action1 = actionCollection()->addAction(QStringLiteral("select_carddeck"));
action1->setText(i18n("Select &Card Deck..."));
actionCollection()->setDefaultShortcut(action1, QKeySequence(Qt::Key_F10));
connect(action1, &QAction::triggered, this, &Mainwindow::menuCardDeck);
......@@ -439,7 +439,7 @@ void Mainwindow::initGUI()
action1->setWhatsThis(i18n("Choose how the cards should look."));
// Change player names
action = actionCollection()->addAction(QLatin1String("change_names"));
action = actionCollection()->addAction(QStringLiteral("change_names"));
action->setText(i18n("&Change Player Names..."));
connect(action, &QAction::triggered, this, &Mainwindow::menuPlayerNames);
if (global_demo_mode) action->setEnabled(false);
......
......@@ -129,8 +129,6 @@ void ScoreSprite::changeTheme()
mScore->setTextWidth(fontWidthLower);
mGames->setTextWidth(fontWidthLower);
QPoint offset = thememanager()->getOffset();
// Restore the frame of the input device sprite
if (mInputFrame >= 0) mInput->setFrame(mInputFrame);
}
......
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