Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: qconf: use QString to store path to configuration file

This is the native type used by the file dialogs and avoids any hassle with
filename encoding when converting this back and forth to a character array.

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Rolf Eike Beer and committed by
Masahiro Yamada
cdb37fe6 cdb1e767

+7 -19
+6 -18
scripts/kconfig/qconf.cc
··· 1381 1381 1382 1382 conf_set_changed_callback(conf_changed); 1383 1383 1384 - configname = xstrdup(conf_get_configname()); 1384 + configname = conf_get_configname(); 1385 1385 1386 1386 QAction *saveAsAction = new QAction("Save &As...", this); 1387 1387 connect(saveAsAction, &QAction::triggered, ··· 1520 1520 void ConfigMainWindow::loadConfig(void) 1521 1521 { 1522 1522 QString str; 1523 - QByteArray ba; 1524 - const char *name; 1525 1523 1526 1524 str = QFileDialog::getOpenFileName(this, "", configname); 1527 1525 if (str.isNull()) 1528 1526 return; 1529 1527 1530 - ba = str.toLocal8Bit(); 1531 - name = ba.data(); 1532 - 1533 - if (conf_read(name)) 1528 + if (conf_read(str.toLocal8Bit().constData())) 1534 1529 QMessageBox::information(this, "qconf", "Unable to load configuration!"); 1535 1530 1536 - free(configname); 1537 - configname = xstrdup(name); 1531 + configname = str; 1538 1532 1539 1533 ConfigList::updateListAllForAll(); 1540 1534 } 1541 1535 1542 1536 bool ConfigMainWindow::saveConfig(void) 1543 1537 { 1544 - if (conf_write(configname)) { 1538 + if (conf_write(configname.toLocal8Bit().constData())) { 1545 1539 QMessageBox::information(this, "qconf", "Unable to save configuration!"); 1546 1540 return false; 1547 1541 } ··· 1547 1553 void ConfigMainWindow::saveConfigAs(void) 1548 1554 { 1549 1555 QString str; 1550 - QByteArray ba; 1551 - const char *name; 1552 1556 1553 1557 str = QFileDialog::getSaveFileName(this, "", configname); 1554 1558 if (str.isNull()) 1555 1559 return; 1556 1560 1557 - ba = str.toLocal8Bit(); 1558 - name = ba.data(); 1559 - 1560 - if (conf_write(name)) { 1561 + if (conf_write(str.toLocal8Bit().constData())) { 1561 1562 QMessageBox::information(this, "qconf", "Unable to save configuration!"); 1562 1563 } 1563 1564 conf_write_autoconf(0); 1564 1565 1565 - free(configname); 1566 - configname = xstrdup(name); 1566 + configname = str; 1567 1567 } 1568 1568 1569 1569 void ConfigMainWindow::searchConfig(void)
+1 -1
scripts/kconfig/qconf.h
··· 237 237 class ConfigMainWindow : public QMainWindow { 238 238 Q_OBJECT 239 239 240 - char *configname; 240 + QString configname; 241 241 static QAction *saveAction; 242 242 static void conf_changed(bool); 243 243 public: