Skip to content

Commit 5453a3d

Browse files
committed
Merge tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kconfig updates from Masahiro Yamada: - rename lexer and parse files - fix 'Save as' menu of xconfig * tag 'kconfig-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix 'Save As' menu of xconfig kconfig: rename zconf.y to parser.y kconfig: rename zconf.l to lexer.l
2 parents add8462 + 8741908 commit 5453a3d

File tree

7 files changed

+44
-14
lines changed

7 files changed

+44
-14
lines changed

scripts/kconfig/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ help:
143143

144144
# ===========================================================================
145145
# object files used by all kconfig flavours
146-
common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o
146+
common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \
147+
symbol.o
147148

148-
$(obj)/zconf.lex.o: $(obj)/zconf.tab.h
149-
HOSTCFLAGS_zconf.lex.o := -I$(src)
150-
HOSTCFLAGS_zconf.tab.o := -I$(src)
149+
$(obj)/lexer.lex.o: $(obj)/parser.tab.h
150+
HOSTCFLAGS_lexer.lex.o := -I$(src)
151+
HOSTCFLAGS_parser.tab.o := -I$(src)
151152

152153
# conf: Used for defconfig, oldconfig and related targets
153154
hostprogs-y += conf

scripts/kconfig/expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ struct symbol {
172172
* int "BAZ Value"
173173
* range 1..255
174174
*
175-
* Please, also check zconf.y:print_symbol() when modifying the
175+
* Please, also check parser.y:print_symbol() when modifying the
176176
* list of property types!
177177
*/
178178
enum prop_type {

scripts/kconfig/zconf.l renamed to scripts/kconfig/lexer.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <unistd.h>
1616

1717
#include "lkc.h"
18-
#include "zconf.tab.h"
18+
#include "parser.tab.h"
1919

2020
#define YY_DECL static int yylex1(void)
2121

scripts/kconfig/lkc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void *xrealloc(void *p, size_t size);
9090
char *xstrdup(const char *s);
9191
char *xstrndup(const char *s, size_t n);
9292

93-
/* zconf.l */
93+
/* lexer.l */
9494
int yylex(void);
9595

9696
struct gstr {
File renamed without changes.

scripts/kconfig/qconf.cc

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,8 @@ ConfigMainWindow::ConfigMainWindow(void)
13921392
conf_set_changed_callback(conf_changed);
13931393
// Set saveAction's initial state
13941394
conf_changed();
1395+
configname = xstrdup(conf_get_configname());
1396+
13951397
QAction *saveAsAction = new QAction("Save &As...", this);
13961398
connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs()));
13971399
QAction *searchAction = new QAction("&Find", this);
@@ -1520,17 +1522,29 @@ ConfigMainWindow::ConfigMainWindow(void)
15201522

15211523
void ConfigMainWindow::loadConfig(void)
15221524
{
1523-
QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname());
1524-
if (s.isNull())
1525+
QString str;
1526+
QByteArray ba;
1527+
const char *name;
1528+
1529+
str = QFileDialog::getOpenFileName(this, "", configname);
1530+
if (str.isNull())
15251531
return;
1526-
if (conf_read(QFile::encodeName(s)))
1532+
1533+
ba = str.toLocal8Bit();
1534+
name = ba.data();
1535+
1536+
if (conf_read(name))
15271537
QMessageBox::information(this, "qconf", "Unable to load configuration!");
1538+
1539+
free(configname);
1540+
configname = xstrdup(name);
1541+
15281542
ConfigView::updateListAll();
15291543
}
15301544

15311545
bool ConfigMainWindow::saveConfig(void)
15321546
{
1533-
if (conf_write(NULL)) {
1547+
if (conf_write(configname)) {
15341548
QMessageBox::information(this, "qconf", "Unable to save configuration!");
15351549
return false;
15361550
}
@@ -1541,10 +1555,24 @@ bool ConfigMainWindow::saveConfig(void)
15411555

15421556
void ConfigMainWindow::saveConfigAs(void)
15431557
{
1544-
QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname());
1545-
if (s.isNull())
1558+
QString str;
1559+
QByteArray ba;
1560+
const char *name;
1561+
1562+
str = QFileDialog::getSaveFileName(this, "", configname);
1563+
if (str.isNull())
15461564
return;
1547-
saveConfig();
1565+
1566+
ba = str.toLocal8Bit();
1567+
name = ba.data();
1568+
1569+
if (conf_write(name)) {
1570+
QMessageBox::information(this, "qconf", "Unable to save configuration!");
1571+
}
1572+
conf_write_autoconf(0);
1573+
1574+
free(configname);
1575+
configname = xstrdup(name);
15481576
}
15491577

15501578
void ConfigMainWindow::searchConfig(void)

scripts/kconfig/qconf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ public slots:
291291
class ConfigMainWindow : public QMainWindow {
292292
Q_OBJECT
293293

294+
char *configname;
294295
static QAction *saveAction;
295296
static void conf_changed(void);
296297
public:

0 commit comments

Comments
 (0)