Commit fbb86374 authored by Markus Heidelberg's avatar Markus Heidelberg Committed by Sam Ravnborg

kconfig qconf: add namespace for use of Key_ enum values

They are defined in the 'Qt' namespace.

Fixes the following compiler errors after a quick conversion with 'qt3to4',
which occured with g++ 3.4.6 and 4.1.2, but not anymore with 4.3.2.

scripts/kconfig/qconf.cc: In member function 'virtual void ConfigLineEdit::keyPressEvent(QKeyEvent*)':
scripts/kconfig/qconf.cc:311: error: 'Key_Escape' was not declared in this scope
scripts/kconfig/qconf.cc:313: error: 'Key_Return' was not declared in this scope
scripts/kconfig/qconf.cc:314: error: 'Key_Enter' was not declared in this scope

scripts/kconfig/qconf.cc: In member function 'virtual void ConfigList::keyPressEvent(QKeyEvent*)':
scripts/kconfig/qconf.cc:653: error: 'Key_Escape' was not declared in this scope
scripts/kconfig/qconf.cc:666: error: 'Key_Return' was not declared in this scope
scripts/kconfig/qconf.cc:667: error: 'Key_Enter' was not declared in this scope
scripts/kconfig/qconf.cc:681: error: 'Key_Space' was not declared in this scope
scripts/kconfig/qconf.cc:684: error: 'Key_N' was not declared in this scope
scripts/kconfig/qconf.cc:687: error: 'Key_M' was not declared in this scope
scripts/kconfig/qconf.cc:690: error: 'Key_Y' was not declared in this scope

scripts/kconfig/qconf.cc: In constructor 'ConfigMainWindow::ConfigMainWindow()':
scripts/kconfig/qconf.cc:1329: error: 'CTRL' was not declared in this scope
scripts/kconfig/qconf.cc:1329: error: 'Key_Q' was not declared in this scope
scripts/kconfig/qconf.cc:1331: error: 'Key_L' was not declared in this scope
scripts/kconfig/qconf.cc:1333: error: 'Key_S' was not declared in this scope
scripts/kconfig/qconf.cc:1340: error: 'Key_F' was not declared in this scope
Signed-off-by: default avatarMarkus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 7298b936
...@@ -297,10 +297,10 @@ void ConfigLineEdit::show(ConfigItem* i) ...@@ -297,10 +297,10 @@ void ConfigLineEdit::show(ConfigItem* i)
void ConfigLineEdit::keyPressEvent(QKeyEvent* e) void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
{ {
switch (e->key()) { switch (e->key()) {
case Key_Escape: case Qt::Key_Escape:
break; break;
case Key_Return: case Qt::Key_Return:
case Key_Enter: case Qt::Key_Enter:
sym_set_string_value(item->menu->sym, text().latin1()); sym_set_string_value(item->menu->sym, text().latin1());
parent()->updateList(item); parent()->updateList(item);
break; break;
...@@ -639,7 +639,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) ...@@ -639,7 +639,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
struct menu *menu; struct menu *menu;
enum prop_type type; enum prop_type type;
if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) { if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
emit parentSelected(); emit parentSelected();
ev->accept(); ev->accept();
return; return;
...@@ -652,8 +652,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) ...@@ -652,8 +652,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
item = (ConfigItem*)i; item = (ConfigItem*)i;
switch (ev->key()) { switch (ev->key()) {
case Key_Return: case Qt::Key_Return:
case Key_Enter: case Qt::Key_Enter:
if (item->goParent) { if (item->goParent) {
emit parentSelected(); emit parentSelected();
break; break;
...@@ -667,16 +667,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) ...@@ -667,16 +667,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev)
emit menuSelected(menu); emit menuSelected(menu);
break; break;
} }
case Key_Space: case Qt::Key_Space:
changeValue(item); changeValue(item);
break; break;
case Key_N: case Qt::Key_N:
setValue(item, no); setValue(item, no);
break; break;
case Key_M: case Qt::Key_M:
setValue(item, mod); setValue(item, mod);
break; break;
case Key_Y: case Qt::Key_Y:
setValue(item, yes); setValue(item, yes);
break; break;
default: default:
...@@ -1315,18 +1315,18 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1315,18 +1315,18 @@ ConfigMainWindow::ConfigMainWindow(void)
backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this); backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
connect(backAction, SIGNAL(activated()), SLOT(goBack())); connect(backAction, SIGNAL(activated()), SLOT(goBack()));
backAction->setEnabled(FALSE); backAction->setEnabled(FALSE);
QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this); QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
connect(quitAction, SIGNAL(activated()), SLOT(close())); connect(quitAction, SIGNAL(activated()), SLOT(close()));
QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this); QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this); saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
conf_set_changed_callback(conf_changed); conf_set_changed_callback(conf_changed);
// Set saveAction's initial state // Set saveAction's initial state
conf_changed(); conf_changed();
QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this); QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this); QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this); QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
......
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