fix FTBFS, 'keys' class object being out of scope.

see comments starting from TDE/kpacman#1

Patch is provided by François Andriot with contribution from Slávek Banko

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/1/head
gregory guy 2 years ago
parent 5debd26d86
commit 3eda17fbb2
No known key found for this signature in database
GPG Key ID: 3BCCA0F7AB4536F4
  1. 26
      kpacman/keys.cpp
  2. 4
      kpacman/keys.h
  3. 2
      kpacman/kpacman.cpp

@ -13,8 +13,8 @@
#include <ntqpixmap.h>
#include <ntqstring.h>
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() );

@ -13,11 +13,11 @@
#include <tdeaccel.h>
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();

@ -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();

Loading…
Cancel
Save