Commit 005e94d9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use new connect api + QStringLiteral

parent 83871cef
......@@ -90,7 +90,7 @@ void KSquaresDemoWindow::gameNew()
void KSquaresDemoWindow::playerTakeTurn(KSquaresPlayer *currentPlayer)
{
//QT5 statusBar()->changeItem(currentPlayer->name(), 0);
QTimer::singleShot(200, this, SLOT(aiChooseLine()));
QTimer::singleShot(200, this, &KSquaresDemoWindow::aiChooseLine);
}
void KSquaresDemoWindow::aiChooseLine()
......@@ -102,6 +102,6 @@ void KSquaresDemoWindow::aiChooseLine()
void KSquaresDemoWindow::gameOver(const QVector<KSquaresPlayer> & /*playerList*/)
{
//qDebug() << "Game Over";
QTimer::singleShot(1000, this, SLOT(gameNew()));
QTimer::singleShot(1000, this, &KSquaresDemoWindow::gameNew);
}
......@@ -39,7 +39,7 @@
KSquaresWindow::KSquaresWindow() : KXmlGuiWindow(), m_view(new GameBoardView(this)), m_scene(0)
{
setCentralWidget(m_view);
QTimer::singleShot(0, this, SLOT(initObject()));
QTimer::singleShot(0, this, &KSquaresWindow::initObject);
}
KSquaresWindow::~KSquaresWindow()
......@@ -257,7 +257,7 @@ void KSquaresWindow::gameOver(const QVector<KSquaresPlayer> &_playerList)
void KSquaresWindow::playerTakeTurn(KSquaresPlayer *currentPlayer)
{
////qDebug() << "void KSquares::playerTakeTurn(KSquaresPlayer* currentPlayer)";
m_player->setText(QString::fromLatin1("<font color=\"%1\">%2</font>")
m_player->setText(QStringLiteral("<font color=\"%1\">%2</font>")
.arg(currentPlayer->colour().name())
.arg(currentPlayer->name()));
if (currentPlayer->isHuman()) {
......@@ -270,7 +270,7 @@ void KSquaresWindow::playerTakeTurn(KSquaresPlayer *currentPlayer)
setCursor(Qt::WaitCursor);
m_scene->disableEvents();
QTimer::singleShot(200, this, SLOT(aiChooseLine()));
QTimer::singleShot(200, this, &KSquaresWindow::aiChooseLine);
setCursor(Qt::ArrowCursor);
}
}
......@@ -299,15 +299,15 @@ void KSquaresWindow::setupActions()
void KSquaresWindow::optionsPreferences()
{
KConfigDialog *dialog = new KConfigDialog(this, QLatin1Literal("settings"), Settings::self());
KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), Settings::self());
QWidget *displaySettingsDialog = new QWidget;
ui_prefs_display.setupUi(displaySettingsDialog);
dialog->addPage(displaySettingsDialog, i18n("Display"), QLatin1Literal("preferences-desktop-display"));
dialog->addPage(displaySettingsDialog, i18n("Display"), QStringLiteral("preferences-desktop-display"));
QWidget *aiSettingsDialog = new QWidget;
ui_prefs_ai.setupUi(aiSettingsDialog);
dialog->addPage(aiSettingsDialog, i18n("Computer Player"), QLatin1Literal("games-difficult"));
dialog->addPage(aiSettingsDialog, i18n("Computer Player"), QStringLiteral("games-difficult"));
connect(dialog, &KConfigDialog::settingsChanged, m_view, &GameBoardView::setBoardSize);
dialog->show();
......
......@@ -30,15 +30,15 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
Kdelibs4ConfigMigrator migrate(QLatin1String("ksquares"));
migrate.setConfigFiles(QStringList() << QLatin1String("ksquaresrc"));
migrate.setUiFiles(QStringList() << QLatin1String("ksquaresui.rc"));
Kdelibs4ConfigMigrator migrate(QStringLiteral("ksquares"));
migrate.setConfigFiles(QStringList() << QStringLiteral("ksquaresrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("ksquaresui.rc"));
migrate.migrate();
KLocalizedString::setApplicationDomain("ksquares");
KAboutData about(QLatin1Literal("ksquares"), i18n("KSquares"), QLatin1Literal(version), i18n(description),
KAboutData about(QStringLiteral("ksquares"), i18n("KSquares"), QLatin1Literal(version), i18n(description),
KAboutLicense::GPL, i18n("(C) 2006-2007 Matt Williams"),
QLatin1Literal("http://games.kde.org/ksquares"));
about.addAuthor(i18n("Matt Williams"), i18n("Original creator and maintainer"), QLatin1Literal("matt@milliams.com"), QLatin1Literal("http://milliams.com"));
QStringLiteral("http://games.kde.org/ksquares"));
about.addAuthor(i18n("Matt Williams"), i18n("Original creator and maintainer"), QStringLiteral("matt@milliams.com"), QStringLiteral("http://milliams.com"));
about.addCredit(i18n("Fela Winkelmolen"), i18n("Many patches and bugfixes"));
about.addCredit(i18n("Tom Vincent Peters"), i18n("Hard AI"));
......@@ -46,14 +46,14 @@ int main(int argc, char **argv)
KAboutData::setApplicationData(about);
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("demo"), i18n("Run game in demo (autoplay) mode")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("demo"), i18n("Run game in demo (autoplay) mode")));
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
KDBusService service;
app.setWindowIcon(QIcon::fromTheme(QLatin1String("ksquares")));
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksquares")));
// default names for players
KConfigGroup cg(KSharedConfig::openConfig(), "General");
......@@ -67,7 +67,7 @@ int main(int argc, char **argv)
cg.writeEntry("initializeNames", false);
}
if (parser.isSet(QLatin1Literal("demo"))) {
if (parser.isSet(QStringLiteral("demo"))) {
KSquaresDemoWindow *demoWindow = new KSquaresDemoWindow;
demoWindow->show();
demoWindow->gameNew();
......
......@@ -27,8 +27,8 @@ ScoresDialog::ScoresDialog(QWidget *parent)
mainLayout->addWidget(mainWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
mainLayout->addWidget(buttonBox);
}
......
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