History

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

Markus Heidelberg committed 17 years ago

Commit fbb86371 parent 7298b931 file · +14 −14Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/kconfig/qconf.cc+14−14
@@ -297,10 +297,10 @@ void ConfigLineEdit::show(ConfigItem* i) · 296 unmodified lines
297void ConfigLineEdit::keyPressEvent(QKeyEvent* e)297void ConfigLineEdit::keyPressEvent(QKeyEvent* e)
298{298{
299 switch (e->key()) {299 switch (e->key()) {
300 case Key_Escape:300 case Qt::Key_Escape:
301 break;301 break;
302 case Key_Return:302 case Qt::Key_Return:
303 case Key_Enter:303 case Qt::Key_Enter:
304 sym_set_string_value(item->menu->sym, text().latin1());304 sym_set_string_value(item->menu->sym, text().latin1());
305 parent()->updateList(item);305 parent()->updateList(item);
306 break;306 break;
@@ -639,7 +639,7 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 332 unmodified lines
639 struct menu *menu;639 struct menu *menu;
640 enum prop_type type;640 enum prop_type type;
641 641
642 if (ev->key() == Key_Escape && mode != fullMode && mode != listMode) {642 if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) {
643 emit parentSelected();643 emit parentSelected();
644 ev->accept();644 ev->accept();
645 return;645 return;
@@ -652,8 +652,8 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 6 unmodified lines
652 item = (ConfigItem*)i;652 item = (ConfigItem*)i;
653 653
654 switch (ev->key()) {654 switch (ev->key()) {
655 case Key_Return:655 case Qt::Key_Return:
656 case Key_Enter:656 case Qt::Key_Enter:
657 if (item->goParent) {657 if (item->goParent) {
658 emit parentSelected();658 emit parentSelected();
659 break;659 break;
@@ -667,16 +667,16 @@ void ConfigList::keyPressEvent(QKeyEvent* ev) · 7 unmodified lines
667 emit menuSelected(menu);667 emit menuSelected(menu);
668 break;668 break;
669 }669 }
670 case Key_Space:670 case Qt::Key_Space:
671 changeValue(item);671 changeValue(item);
672 break;672 break;
673 case Key_N:673 case Qt::Key_N:
674 setValue(item, no);674 setValue(item, no);
675 break;675 break;
676 case Key_M:676 case Qt::Key_M:
677 setValue(item, mod);677 setValue(item, mod);
678 break;678 break;
679 case Key_Y:679 case Qt::Key_Y:
680 setValue(item, yes);680 setValue(item, yes);
681 break;681 break;
682 default:682 default:
@@ -1315,18 +1315,18 @@ ConfigMainWindow::ConfigMainWindow(void) · 632 unmodified lines
1315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);1315 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1316 connect(backAction, SIGNAL(activated()), SLOT(goBack()));1316 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1317 backAction->setEnabled(FALSE);1317 backAction->setEnabled(FALSE);
1318 QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this);1318 QAction *quitAction = new QAction("Quit", _("&Quit"), Qt::CTRL + Qt::Key_Q, this);
1319 connect(quitAction, SIGNAL(activated()), SLOT(close()));1319 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1320 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this);1320 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), Qt::CTRL + Qt::Key_L, this);
1321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));1321 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1322 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this);1322 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), Qt::CTRL + Qt::Key_S, this);
1323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));1323 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1324 conf_set_changed_callback(conf_changed);1324 conf_set_changed_callback(conf_changed);
1325 // Set saveAction's initial state1325 // Set saveAction's initial state
1326 conf_changed();1326 conf_changed();
1327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);1327 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));1328 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1329 QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this);1329 QAction *searchAction = new QAction("Find", _("&Find"), Qt::CTRL + Qt::Key_F, this);
1330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));1330 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);1331 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));1332 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t