From ba4fc3433f6d37e5c4c6bc61859acf5d4c85b0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Fri, 2 Jun 2017 17:59:59 +0100 Subject: [PATCH] Remove KDELibs4Support. --- CMakeLists.txt | 1 - src/CMakeLists.txt | 1 - src/game.cpp | 4 +++- src/gamedialog.cpp | 41 +++++++++++++++++++++-------------------- src/gamedialog.h | 8 +++----- src/gameglview.cpp | 8 ++------ src/kubrick.cpp | 9 +++++---- 7 files changed, 34 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e357b..ca115b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS CoreAddons Crash DocTools - KDELibs4Support I18n KIO WidgetsAddons diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 406b97b..cd12d4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,6 @@ target_link_libraries(kubrick Qt5::Svg KF5::Crash KF5::ConfigCore - KF5::KDELibs4Support KF5::KIOCore KF5::XmlGui KF5KDEGames diff --git a/src/game.cpp b/src/game.cpp index f97a229..5a3ce6c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -21,7 +21,9 @@ #include "movetracker.h" #include "scenelabel.h" #include "kubrick_debug.h" + #include +#include #include #include #include @@ -1822,7 +1824,7 @@ void Game::chooseMousePointer () void Game::startNextDisplay () { // Pick off the first character of the display sequence. - char c = displaySequence.at(0).toAscii(); + char c = displaySequence.at(0).toLatin1(); displaySequence.remove (0, 1); int nRMoves = 0; diff --git a/src/gamedialog.cpp b/src/gamedialog.cpp index 85959de..cb36baa 100644 --- a/src/gamedialog.cpp +++ b/src/gamedialog.cpp @@ -17,43 +17,44 @@ *******************************************************************************/ #include "gamedialog.h" +#include #include -#include -#include +#include #include +#include +#include +#include /******************************************************************************/ /***************** DIALOG BOX TO SELECT A GAME AND LEVEL *****************/ /******************************************************************************/ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) - : KDialog (parent) + : QDialog (parent) { myParent = parent; myChangePuzzle = changePuzzle; opt = optionTemp; - int margin = marginHint(); - int spacing = spacingHint(); - QWidget * dad = new QWidget (this); - setMainWidget (dad); - setCaption (i18n ("Rubik's Cube Options")); - setButtons (KDialog::Ok | KDialog::Cancel | KDialog::Help); - setDefaultButton (KDialog::Ok); - - QVBoxLayout * mainLayout = new QVBoxLayout (dad); - mainLayout->setSpacing (spacing); - mainLayout->setMargin (margin); + QVBoxLayout *mainLayout = new QVBoxLayout(dad); + mainLayout->addWidget(dad); + setLayout(mainLayout); + setWindowTitle (i18n ("Rubik's Cube Options")); + QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help); + QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); + okButton->setDefault(true); + okButton->setShortcut(Qt::CTRL | Qt::Key_Return); + connect(buttonBox, &QDialogButtonBox::accepted, this, &GameDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &GameDialog::reject); + buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); QHBoxLayout * cubeDimensions = new QHBoxLayout(); mainLayout->addLayout (cubeDimensions); - cubeDimensions->setSpacing (spacing); QHBoxLayout * difficulty = new QHBoxLayout(); mainLayout->addLayout (difficulty); - difficulty->setSpacing (spacing); if (changePuzzle) { // Lay out spin boxes for the cube dimensions. @@ -116,7 +117,6 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) QHBoxLayout * speed = new QHBoxLayout(); mainLayout->addLayout (speed); - speed->setSpacing (spacing); speedL = new QLabel (i18n("Speed of moves:")); speedN = new QSpinBox (); @@ -126,7 +126,6 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) QHBoxLayout * bevel = new QHBoxLayout(); mainLayout->addLayout (bevel); - bevel->setSpacing (spacing); // xgettext: no-c-format bevelL = new QLabel (i18n("% of bevel on edges of cubies:")); @@ -136,6 +135,8 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) bevel->addWidget (bevelL); bevel->addWidget (bevelN); + mainLayout->addWidget(buttonBox); + // Set the option-widgets to the current values of the options. if (changePuzzle) { dimX->setValue (optionTemp [optXDim]); @@ -150,8 +151,8 @@ GameDialog::GameDialog (bool changePuzzle, int optionTemp [], QWidget * parent) bevelN->setValue (optionTemp [optBevel]); - connect(this, &GameDialog::okClicked, this, &GameDialog::slotOk); - connect(this, &GameDialog::helpClicked, this, &GameDialog::slotHelp); + connect(okButton, &QPushButton::clicked, this, &GameDialog::slotOk); + connect(buttonBox->button(QDialogButtonBox::Help), &QPushButton::clicked, this, &GameDialog::slotHelp); } diff --git a/src/gamedialog.h b/src/gamedialog.h index 61d7a7a..504193f 100644 --- a/src/gamedialog.h +++ b/src/gamedialog.h @@ -19,14 +19,12 @@ #ifndef GAMEDIALOG_H #define GAMEDIALOG_H -// Use KDialog and KMessageBox. -#include #include - +#include +#include #include #include -#include #include "kbkglobal.h" @@ -40,7 +38,7 @@ class Game; /******************* DIALOG TO SELECT A GAME AND LEVEL *******************/ /******************************************************************************/ -class GameDialog : public KDialog +class GameDialog : public QDialog { public: GameDialog (bool changePuzzle, int optionTemp [8], QWidget * parent = 0); diff --git a/src/gameglview.cpp b/src/gameglview.cpp index 97d6298..f7c9c83 100644 --- a/src/gameglview.cpp +++ b/src/gameglview.cpp @@ -25,15 +25,11 @@ #include #include #include +#include #include - -// IDW - This is temporary code for KDE 4.1. Do themes properly in KDE 4.2. -#include -#include #include + #include "kubrick_debug.h" -#include -#include // C++ includes #include diff --git a/src/kubrick.cpp b/src/kubrick.cpp index 215332a..9040e65 100644 --- a/src/kubrick.cpp +++ b/src/kubrick.cpp @@ -21,19 +21,20 @@ // Qt includes. #include -#include -#include #include +#include +#include #include #include #include // KDE includes. #include +#include #include -#include #include #include +#include #include // Local includes. @@ -47,7 +48,7 @@ Kubrick::Kubrick () : singmasterMoves (0) { // Window title. - // setCaption("Rubik's Cube"); // DELETED - This is a *trademark*. + // setWindowTitle("Rubik's Cube"); // DELETED - This is a *trademark*. // use multi-sample (anti-aliased) OpenGL if available QGLFormat defFormat = QGLFormat::defaultFormat(); -- GitLab