diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 181973509a05cc806e5e5ffbd8056dcc8da49494..7c5dc31c1d95d5ff0efa106ab38351d929c0ae08 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -143,11 +143,12 @@ help: # =========================================================================== # object files used by all kconfig flavours -common-objs := confdata.o expr.o symbol.o preprocess.o zconf.lex.o zconf.tab.o +common-objs := confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o \ + symbol.o -$(obj)/zconf.lex.o: $(obj)/zconf.tab.h -HOSTCFLAGS_zconf.lex.o := -I$(src) -HOSTCFLAGS_zconf.tab.o := -I$(src) +$(obj)/lexer.lex.o: $(obj)/parser.tab.h +HOSTCFLAGS_lexer.lex.o := -I$(src) +HOSTCFLAGS_parser.tab.o := -I$(src) # conf: Used for defconfig, oldconfig and related targets hostprogs-y += conf diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 999edb60cd53e9808cb8b156b80a6341f814cc46..8dde65bc3165b7d5c38ff92a2a9e18df8abeb469 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -172,7 +172,7 @@ struct symbol { * int "BAZ Value" * range 1..255 * - * Please, also check zconf.y:print_symbol() when modifying the + * Please, also check parser.y:print_symbol() when modifying the * list of property types! */ enum prop_type { diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/lexer.l similarity index 99% rename from scripts/kconfig/zconf.l rename to scripts/kconfig/lexer.l index b2d0a3b0bce92294a4d0c7a84ccef12c8ac8a131..c9df1c8b982494cecdf8751ccf0275e14c07d35e 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/lexer.l @@ -15,7 +15,7 @@ #include <unistd.h> #include "lkc.h" -#include "zconf.tab.h" +#include "parser.tab.h" #define YY_DECL static int yylex1(void) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 531ff7c57d92dce95e933fee200e6fc0ed3f13b4..d871539e4b457f517627e7f3f47a86134959dc77 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -90,7 +90,7 @@ void *xrealloc(void *p, size_t size); char *xstrdup(const char *s); char *xstrndup(const char *s, size_t n); -/* zconf.l */ +/* lexer.l */ int yylex(void); struct gstr { diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/parser.y similarity index 100% rename from scripts/kconfig/zconf.y rename to scripts/kconfig/parser.y diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 8be8a70c554284a55f46fee54652455ddf6f61e0..ce7fc87a49a7e9147ddfed74f4691d62532ed5fa 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1392,6 +1392,8 @@ ConfigMainWindow::ConfigMainWindow(void) conf_set_changed_callback(conf_changed); // Set saveAction's initial state conf_changed(); + configname = xstrdup(conf_get_configname()); + QAction *saveAsAction = new QAction("Save &As...", this); connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); QAction *searchAction = new QAction("&Find", this); @@ -1520,17 +1522,29 @@ ConfigMainWindow::ConfigMainWindow(void) void ConfigMainWindow::loadConfig(void) { - QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname()); - if (s.isNull()) + QString str; + QByteArray ba; + const char *name; + + str = QFileDialog::getOpenFileName(this, "", configname); + if (str.isNull()) return; - if (conf_read(QFile::encodeName(s))) + + ba = str.toLocal8Bit(); + name = ba.data(); + + if (conf_read(name)) QMessageBox::information(this, "qconf", "Unable to load configuration!"); + + free(configname); + configname = xstrdup(name); + ConfigView::updateListAll(); } bool ConfigMainWindow::saveConfig(void) { - if (conf_write(NULL)) { + if (conf_write(configname)) { QMessageBox::information(this, "qconf", "Unable to save configuration!"); return false; } @@ -1541,10 +1555,24 @@ bool ConfigMainWindow::saveConfig(void) void ConfigMainWindow::saveConfigAs(void) { - QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname()); - if (s.isNull()) + QString str; + QByteArray ba; + const char *name; + + str = QFileDialog::getSaveFileName(this, "", configname); + if (str.isNull()) return; - saveConfig(); + + ba = str.toLocal8Bit(); + name = ba.data(); + + if (conf_write(name)) { + QMessageBox::information(this, "qconf", "Unable to save configuration!"); + } + conf_write_autoconf(0); + + free(configname); + configname = xstrdup(name); } void ConfigMainWindow::searchConfig(void) diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 41df466e67d96cfd21e294d653ba6990f48b04a8..45bfe9b2b96655833cb674f6eb72d6a9d22d6bd4 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -291,6 +291,7 @@ public slots: class ConfigMainWindow : public QMainWindow { Q_OBJECT + char *configname; static QAction *saveAction; static void conf_changed(void); public: