From 3eda17fbb27cf5425b4fdf0590e17f04ae64b4a1 Mon Sep 17 00:00:00 2001 From: gregory guy Date: Wed, 19 Aug 2020 13:08:28 +0200 Subject: [PATCH] fix FTBFS, 'keys' class object being out of scope. see comments starting from https://mirror.git.trinitydesktop.org/gitea/TDE/kpacman/issues/1#issuecomment-9217 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch is provided by François Andriot with contribution from Slávek Banko Signed-off-by: gregory guy --- kpacman/keys.cpp | 26 +++++++++++++------------- kpacman/keys.h | 4 ++-- kpacman/kpacman.cpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/kpacman/keys.cpp b/kpacman/keys.cpp index 46b55d7..780e895 100644 --- a/kpacman/keys.cpp +++ b/kpacman/keys.cpp @@ -13,8 +13,8 @@ #include #include -Keys::Keys( TQWidget *parent, const char *name) - : TQDialog( parent, name, TRUE ) +PKeys::PKeys( TQWidget *parent, const char *name) + : TQDialog( parent, name, TRUE, 0 ) { TDEStandardDirs *dirs = TDEGlobal::dirs(); @@ -88,7 +88,7 @@ Keys::Keys( TQWidget *parent, const char *name) init(); } -void Keys::keyPressEvent( TQKeyEvent *e ) +void PKeys::keyPressEvent( TQKeyEvent *e ) { uint kCode = e->key() & ~(SHIFT | CTRL | ALT); TQString string = TDEAccel::keyToString(kCode); @@ -103,27 +103,27 @@ void Keys::keyPressEvent( TQKeyEvent *e ) reject(); } -void Keys::butUp() +void PKeys::butUp() { getKey(0); } -void Keys::butDown() +void PKeys::butDown() { getKey(1); } -void Keys::butLeft() +void PKeys::butLeft() { getKey(2); } -void Keys::butRight() +void PKeys::butRight() { getKey(3); } -void Keys::getKey(int i) +void PKeys::getKey(int i) { if ( lab != 0) focusOut(lab); @@ -131,14 +131,14 @@ void Keys::getKey(int i) focusIn(labels[i]); } -void Keys::focusOut(TQLabel *l) +void PKeys::focusOut(TQLabel *l) { l->setFrameStyle( TQFrame::NoFrame ); l->setBackgroundColor(backgroundColor()); l->repaint(); } -void Keys::focusIn(TQLabel *l) +void PKeys::focusIn(TQLabel *l) { lab = l; lab->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); @@ -146,7 +146,7 @@ void Keys::focusIn(TQLabel *l) lab->repaint(); } -void Keys::defaults() +void PKeys::defaults() { if ( lab != 0) focusOut(lab); @@ -159,7 +159,7 @@ void Keys::defaults() labels[3]->setText("Right"); } -void Keys::init() +void PKeys::init() { TQString up("Up"); up = kapp->config()->readEntry("upKey", (const char*) up); @@ -178,7 +178,7 @@ void Keys::init() labels[3]->setText(right); } -void Keys::ok() +void PKeys::ok() { kapp->config()->writeEntry("upKey", (const char*) labels[0]->text() ); kapp->config()->writeEntry("downKey", (const char*) labels[1]->text() ); diff --git a/kpacman/keys.h b/kpacman/keys.h index e2fb5ea..d7ba8ae 100644 --- a/kpacman/keys.h +++ b/kpacman/keys.h @@ -13,11 +13,11 @@ #include -class Keys : public TQDialog +class PKeys : public TQDialog { Q_OBJECT public: - Keys( TQWidget *parent=0, const char *name=0 ); + PKeys( TQWidget *parent=0, const char *name=0 ); private slots: void butRight(); diff --git a/kpacman/kpacman.cpp b/kpacman/kpacman.cpp index 8d91f17..08f23cf 100644 --- a/kpacman/kpacman.cpp +++ b/kpacman/kpacman.cpp @@ -445,7 +445,7 @@ void KpacmanApp::slotKeyBindings() slotStatusMsg(i18n("Configure key bindings...")); /////////////////////////////////////////////////////////////////// // configure key bindings - Keys *keys = new Keys(); + PKeys *keys = new PKeys(); if (keys->exec() == TQDialog::Accepted) { view->referee->initKeys(); view->score->initKeys();