Commit 284026cd authored by Markus Heidelberg's avatar Markus Heidelberg Committed by Sam Ravnborg

kconfig: do not hardcode ".config" filename

Rather than hardcoding ".config" use conf_get_configname(), which also
respects the environment variable KCONFIG_CONFIG.

This fixes "make silentoldconfig" when KCONFIG_CONFIG is used and also
suggests the given filename for "Load" and "Save as" in qconf.
Signed-off-by: default avatarMarkus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 8d90c97e
...@@ -498,14 +498,15 @@ int main(int ac, char **av) ...@@ -498,14 +498,15 @@ int main(int ac, char **av)
conf_parse(name); conf_parse(name);
//zconfdump(stdout); //zconfdump(stdout);
if (sync_kconfig) { if (sync_kconfig) {
if (stat(".config", &tmpstat)) { name = conf_get_configname();
if (stat(name, &tmpstat)) {
fprintf(stderr, _("***\n" fprintf(stderr, _("***\n"
"*** You have not yet configured your kernel!\n" "*** You have not yet configured your kernel!\n"
"*** (missing kernel .config file)\n" "*** (missing kernel config file \"%s\")\n"
"***\n" "***\n"
"*** Please run some configurator (e.g. \"make oldconfig\" or\n" "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
"*** \"make menuconfig\" or \"make xconfig\").\n" "*** \"make menuconfig\" or \"make xconfig\").\n"
"***\n")); "***\n"), name);
exit(1); exit(1);
} }
} }
......
...@@ -1448,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void) ...@@ -1448,7 +1448,7 @@ ConfigMainWindow::ConfigMainWindow(void)
void ConfigMainWindow::loadConfig(void) void ConfigMainWindow::loadConfig(void)
{ {
QString s = QFileDialog::getOpenFileName(".config", NULL, this); QString s = QFileDialog::getOpenFileName(conf_get_configname(), NULL, this);
if (s.isNull()) if (s.isNull())
return; return;
if (conf_read(QFile::encodeName(s))) if (conf_read(QFile::encodeName(s)))
...@@ -1464,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void) ...@@ -1464,7 +1464,7 @@ void ConfigMainWindow::saveConfig(void)
void ConfigMainWindow::saveConfigAs(void) void ConfigMainWindow::saveConfigAs(void)
{ {
QString s = QFileDialog::getSaveFileName(".config", NULL, this); QString s = QFileDialog::getSaveFileName(conf_get_configname(), NULL, this);
if (s.isNull()) if (s.isNull())
return; return;
if (conf_write(QFile::encodeName(s))) if (conf_write(QFile::encodeName(s)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment