Skip to content

Commit

Permalink
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
torvalds committed Dec 18, 2016
2 parents 41e0e24 + 83c3a1b commit 37861ff
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
2 changes: 2 additions & 0 deletions scripts/kconfig/nconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* Derived from menuconfig.
*
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <string.h>
#include <stdlib.h>

Expand Down
15 changes: 11 additions & 4 deletions scripts/kconfig/nconf.gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window,
WINDOW *prompt_win;
WINDOW *form_win;
PANEL *panel;
int i, x, y;
int i, x, y, lines, columns, win_lines, win_cols;
int res = -1;
int cursor_position = strlen(init);
int cursor_form_win;
char *result = *resultp;

getmaxyx(stdscr, lines, columns);

if (strlen(init)+1 > *result_len) {
*result_len = strlen(init)+1;
*resultp = result = realloc(result, *result_len);
Expand All @@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window,
if (title)
prompt_width = max(prompt_width, strlen(title));

win_lines = min(prompt_lines+6, lines-2);
win_cols = min(prompt_width+7, columns-2);
prompt_lines = max(win_lines-6, 0);
prompt_width = max(win_cols-7, 0);

/* place dialog in middle of screen */
y = (getmaxy(stdscr)-(prompt_lines+4))/2;
x = (getmaxx(stdscr)-(prompt_width+4))/2;
y = (lines-win_lines)/2;
x = (columns-win_cols)/2;

strncpy(result, init, *result_len);

/* create the windows */
win = newwin(prompt_lines+6, prompt_width+7, y, x);
win = newwin(win_lines, win_cols, y, x);
prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2);
form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2);
keypad(form_win, TRUE);
Expand Down
19 changes: 14 additions & 5 deletions scripts/kconfig/qconf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ ConfigSettings::ConfigSettings()
QList<int> ConfigSettings::readSizes(const QString& key, bool *ok)
{
QList<int> result;
QStringList entryList = value(key).toStringList();
QStringList::Iterator it;

for (it = entryList.begin(); it != entryList.end(); ++it)
result.push_back((*it).toInt());
if (contains(key))
{
QStringList entryList = value(key).toStringList();
QStringList::Iterator it;

for (it = entryList.begin(); it != entryList.end(); ++it)
result.push_back((*it).toInt());

*ok = true;
}
else
*ok = false;

return result;
}
Expand Down Expand Up @@ -1014,7 +1022,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)

if (!objectName().isEmpty()) {
configSettings->beginGroup(objectName());
_showDebug = configSettings->value("/showDebug", false).toBool();
setShowDebug(configSettings->value("/showDebug", false).toBool());
configSettings->endGroup();
connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings()));
}
Expand Down Expand Up @@ -1474,6 +1482,7 @@ ConfigMainWindow::ConfigMainWindow(void)
optionMenu->addSeparator();
optionMenu->addActions(optGroup->actions());
optionMenu->addSeparator();
optionMenu->addAction(showDebugAction);

// create help menu
menu->addSeparator();
Expand Down

0 comments on commit 37861ff

Please sign in to comment.