diff options
author | Rolf Eike Beer <eb@emlix.com> | 2024-12-19 08:20:34 +0100 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2025-01-10 23:01:22 +0900 |
commit | ad2091dee019a68145610081a75fae3b90f0c44d (patch) | |
tree | 9f0a9b94474f2a8be09745025ce7bd346f3e7dee /scripts | |
parent | 41a00051283e301f7e0009626ddf591542e30161 (diff) |
kconfig: qconf: use preferred form of QString API
A QString constructed from a character literal of length 0, i.e. "", is not
"null" for historical reasons. This does not matter here so use the preferred
method isEmpty() instead.
Also directly construct empty QString objects instead of passing in an empty
character literal that has to be parsed into an empty object first.
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Link: https://doc.qt.io/qt-6/qstring.html#distinction-between-null-and-empty-strings
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/qconf.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 6c92ef1e16efb..eaa465b0ccf9c 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1464,8 +1464,8 @@ void ConfigMainWindow::loadConfig(void) { QString str; - str = QFileDialog::getOpenFileName(this, "", configname); - if (str.isNull()) + str = QFileDialog::getOpenFileName(this, QString(), configname); + if (str.isEmpty()) return; if (conf_read(str.toLocal8Bit().constData())) @@ -1491,8 +1491,8 @@ void ConfigMainWindow::saveConfigAs(void) { QString str; - str = QFileDialog::getSaveFileName(this, "", configname); - if (str.isNull()) + str = QFileDialog::getSaveFileName(this, QString(), configname); + if (str.isEmpty()) return; if (conf_write(str.toLocal8Bit().constData())) { |