diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-17 19:30:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-12-17 19:30:24 -0500 |
commit | 37861ffa8c28e6c479cf04a70b7d6cc33d23c2a8 (patch) | |
tree | e64a32611c1a79cf6b45de4632b7016ead4d608a | |
parent | 41e0e24b450fadc079dfb659d81f3076afcfbd8a (diff) | |
parent | 83c3a1bad224189f22ca2c1955337c3478bd3ab2 (diff) |
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig updates from Michal Marek:
- 'make xconfig' gui fixes
- 'make nconfig' fix for options with long prompts
- fix 'make nconfig' warning when pkg-config forces -D_GNU_SOURCE
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
xconfig: fix missing suboption and help panels on first run
xconfig: fix 'Show Debug' functionality
kconfig/nconf: Fix hang when editing symbol with a long prompt
Scripts: kconfig: nconf: fix _GNU_SOURCE redefined warning
-rw-r--r-- | scripts/kconfig/nconf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/nconf.gui.c | 15 | ||||
-rw-r--r-- | scripts/kconfig/qconf.cc | 19 |
3 files changed, 27 insertions, 9 deletions
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index d42d534a66cd..a9bc5334a478 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
@@ -5,7 +5,9 @@ | |||
5 | * Derived from menuconfig. | 5 | * Derived from menuconfig. |
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | #ifndef _GNU_SOURCE | ||
8 | #define _GNU_SOURCE | 9 | #define _GNU_SOURCE |
10 | #endif | ||
9 | #include <string.h> | 11 | #include <string.h> |
10 | #include <stdlib.h> | 12 | #include <stdlib.h> |
11 | 13 | ||
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c index 8275f0e55106..4b2f44c20caf 100644 --- a/scripts/kconfig/nconf.gui.c +++ b/scripts/kconfig/nconf.gui.c | |||
@@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window, | |||
364 | WINDOW *prompt_win; | 364 | WINDOW *prompt_win; |
365 | WINDOW *form_win; | 365 | WINDOW *form_win; |
366 | PANEL *panel; | 366 | PANEL *panel; |
367 | int i, x, y; | 367 | int i, x, y, lines, columns, win_lines, win_cols; |
368 | int res = -1; | 368 | int res = -1; |
369 | int cursor_position = strlen(init); | 369 | int cursor_position = strlen(init); |
370 | int cursor_form_win; | 370 | int cursor_form_win; |
371 | char *result = *resultp; | 371 | char *result = *resultp; |
372 | 372 | ||
373 | getmaxyx(stdscr, lines, columns); | ||
374 | |||
373 | if (strlen(init)+1 > *result_len) { | 375 | if (strlen(init)+1 > *result_len) { |
374 | *result_len = strlen(init)+1; | 376 | *result_len = strlen(init)+1; |
375 | *resultp = result = realloc(result, *result_len); | 377 | *resultp = result = realloc(result, *result_len); |
@@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window, | |||
386 | if (title) | 388 | if (title) |
387 | prompt_width = max(prompt_width, strlen(title)); | 389 | prompt_width = max(prompt_width, strlen(title)); |
388 | 390 | ||
391 | win_lines = min(prompt_lines+6, lines-2); | ||
392 | win_cols = min(prompt_width+7, columns-2); | ||
393 | prompt_lines = max(win_lines-6, 0); | ||
394 | prompt_width = max(win_cols-7, 0); | ||
395 | |||
389 | /* place dialog in middle of screen */ | 396 | /* place dialog in middle of screen */ |
390 | y = (getmaxy(stdscr)-(prompt_lines+4))/2; | 397 | y = (lines-win_lines)/2; |
391 | x = (getmaxx(stdscr)-(prompt_width+4))/2; | 398 | x = (columns-win_cols)/2; |
392 | 399 | ||
393 | strncpy(result, init, *result_len); | 400 | strncpy(result, init, *result_len); |
394 | 401 | ||
395 | /* create the windows */ | 402 | /* create the windows */ |
396 | win = newwin(prompt_lines+6, prompt_width+7, y, x); | 403 | win = newwin(win_lines, win_cols, y, x); |
397 | prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2); | 404 | prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2); |
398 | form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); | 405 | form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); |
399 | keypad(form_win, TRUE); | 406 | keypad(form_win, TRUE); |
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index fc5555992220..ae6c72546411 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc | |||
@@ -65,11 +65,19 @@ ConfigSettings::ConfigSettings() | |||
65 | QList<int> ConfigSettings::readSizes(const QString& key, bool *ok) | 65 | QList<int> ConfigSettings::readSizes(const QString& key, bool *ok) |
66 | { | 66 | { |
67 | QList<int> result; | 67 | QList<int> result; |
68 | QStringList entryList = value(key).toStringList(); | ||
69 | QStringList::Iterator it; | ||
70 | 68 | ||
71 | for (it = entryList.begin(); it != entryList.end(); ++it) | 69 | if (contains(key)) |
72 | result.push_back((*it).toInt()); | 70 | { |
71 | QStringList entryList = value(key).toStringList(); | ||
72 | QStringList::Iterator it; | ||
73 | |||
74 | for (it = entryList.begin(); it != entryList.end(); ++it) | ||
75 | result.push_back((*it).toInt()); | ||
76 | |||
77 | *ok = true; | ||
78 | } | ||
79 | else | ||
80 | *ok = false; | ||
73 | 81 | ||
74 | return result; | 82 | return result; |
75 | } | 83 | } |
@@ -1014,7 +1022,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) | |||
1014 | 1022 | ||
1015 | if (!objectName().isEmpty()) { | 1023 | if (!objectName().isEmpty()) { |
1016 | configSettings->beginGroup(objectName()); | 1024 | configSettings->beginGroup(objectName()); |
1017 | _showDebug = configSettings->value("/showDebug", false).toBool(); | 1025 | setShowDebug(configSettings->value("/showDebug", false).toBool()); |
1018 | configSettings->endGroup(); | 1026 | configSettings->endGroup(); |
1019 | connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); | 1027 | connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); |
1020 | } | 1028 | } |
@@ -1474,6 +1482,7 @@ ConfigMainWindow::ConfigMainWindow(void) | |||
1474 | optionMenu->addSeparator(); | 1482 | optionMenu->addSeparator(); |
1475 | optionMenu->addActions(optGroup->actions()); | 1483 | optionMenu->addActions(optGroup->actions()); |
1476 | optionMenu->addSeparator(); | 1484 | optionMenu->addSeparator(); |
1485 | optionMenu->addAction(showDebugAction); | ||
1477 | 1486 | ||
1478 | // create help menu | 1487 | // create help menu |
1479 | menu->addSeparator(); | 1488 | menu->addSeparator(); |