1. 21 8月, 2020 3 次提交
    • M
      kconfig: qconf: replace deprecated QString::sprintf() with QTextStream · 510bc3cb
      Masahiro Yamada 提交于
      QString::sprintf() is deprecated in the latest Qt version, and spawns
      a lot of warnings:
      
        HOSTCXX scripts/kconfig/qconf.o
      scripts/kconfig/qconf.cc: In member function ‘void ConfigInfoView::menuInfo()’:
      scripts/kconfig/qconf.cc:1090:61: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1090 |      head += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                             ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc:1099:60: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1099 |     head += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                            ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc:1127:90: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1127 |   debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno);
            |                                                                                          ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc: In member function ‘QString ConfigInfoView::debug_info(symbol*)’:
      scripts/kconfig/qconf.cc:1150:68: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1150 |    debug += QString().sprintf("prompt: <a href=\"m%s\">", sym->name);
            |                                                                    ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      scripts/kconfig/qconf.cc: In static member function ‘static void ConfigInfoView::expr_print_help(void*, symbol*, const char*)’:
      scripts/kconfig/qconf.cc:1225:59: warning: ‘QString& QString::sprintf(const char*, ...)’ is deprecated: Use asprintf(), arg() or QTextStream instead [-Wdeprecated-declarations]
       1225 |   *text += QString().sprintf("<a href=\"s%s\">", sym->name);
            |                                                           ^
      In file included from /usr/include/qt5/QtGui/qkeysequence.h:44,
                       from /usr/include/qt5/QtWidgets/qaction.h:44,
                       from /usr/include/qt5/QtWidgets/QAction:1,
                       from scripts/kconfig/qconf.cc:7:
      /usr/include/qt5/QtCore/qstring.h:382:14: note: declared here
        382 |     QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
            |              ^~~~~~~
      
      The documentation also says:
      "Warning: We do not recommend using QString::asprintf() in new Qt code.
      Instead, consider using QTextStream or arg(), both of which support
      Unicode strings seamlessly and are type-safe."
      
      Use QTextStream as suggested.
      Reported-by: NRobert Crawford <flacycads@cox.net>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      510bc3cb
    • M
      kconfig: qconf: remove redundant help in the info view · 68fd110b
      Masahiro Yamada 提交于
      The same information is repeated in the info view.
      
      Remove the second one.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      68fd110b
    • M
      kconfig: qconf: remove qInfo() to get back Qt4 support · 53efe2e7
      Masahiro Yamada 提交于
      qconf is supposed to work with Qt4 and Qt5, but since commit
      c4f7398b ("kconfig: qconf: make debug links work again"),
      building with Qt4 fails as follows:
      
        HOSTCXX scripts/kconfig/qconf.o
      scripts/kconfig/qconf.cc: In member function ‘void ConfigInfoView::clicked(const QUrl&)’:
      scripts/kconfig/qconf.cc:1241:3: error: ‘qInfo’ was not declared in this scope; did you mean ‘setInfo’?
       1241 |   qInfo() << "Clicked link is empty";
            |   ^~~~~
            |   setInfo
      scripts/kconfig/qconf.cc:1254:3: error: ‘qInfo’ was not declared in this scope; did you mean ‘setInfo’?
       1254 |   qInfo() << "Clicked symbol is invalid:" << data;
            |   ^~~~~
            |   setInfo
      make[1]: *** [scripts/Makefile.host:129: scripts/kconfig/qconf.o] Error 1
      make: *** [Makefile:606: xconfig] Error 2
      
      qInfo() does not exist in Qt4. In my understanding, these call-sites
      should be unreachable. Perhaps, qWarning(), assertion, or something
      is better, but qInfo() is not the right one to use here, I think.
      
      Fixes: c4f7398b ("kconfig: qconf: make debug links work again")
      Reported-by: NRonald Warsow <rwarsow@gmx.de>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      53efe2e7
  2. 18 8月, 2020 2 次提交
    • M
      kconfig: qconf: fix the popup menu in the ConfigInfoView window · 7d1300e6
      Masahiro Yamada 提交于
      I do not know when ConfigInfoView::createStandardContextMenu() is
      called.
      
      Because QTextEdit::createStandardContextMenu() is not virtual,
      ConfigInfoView::createStandardContextMenu() cannot override it.
      Even if right-click the ConfigInfoView window, the "Show Debug Info"
      menu does not show up.
      
      Build up the menu in the constructor, and invoke it from the
      contextMenuEvent().
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      7d1300e6
    • M
      kconfig: qconf: fix signal connection to invalid slots · d85de339
      Masahiro Yamada 提交于
      If you right-click in the ConfigList window, you will see the following
      messages in the console:
      
      QObject::connect: No such slot QAction::setOn(bool) in scripts/kconfig/qconf.cc:888
      QObject::connect:  (sender name:   'config')
      QObject::connect: No such slot QAction::setOn(bool) in scripts/kconfig/qconf.cc:897
      QObject::connect:  (sender name:   'config')
      QObject::connect: No such slot QAction::setOn(bool) in scripts/kconfig/qconf.cc:906
      QObject::connect:  (sender name:   'config')
      
      Right, there is no such slot in QAction. I think this is a typo of
      setChecked.
      
      Due to this bug, when you toggled the menu "Option->Show Name/Range/Data"
      the state of the context menu was not previously updated. Fix this.
      
      Fixes: d5d973c3 ("Port xconfig to Qt5 - Put back some of the old implementation(part 2)")
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      d85de339
  3. 14 8月, 2020 18 次提交
  4. 02 8月, 2020 1 次提交
  5. 01 8月, 2020 5 次提交
    • M
      Revert "kconfig: qconf: don't show goback button on splitMode" · 4b20e103
      Masahiro Yamada 提交于
      This reverts commit cc1c08ed.
      
      Maxim Levitsky reports 'make xconfig' crashes since that commit
      (https://lkml.org/lkml/2020/7/18/411)
      
      Or, the following is simple test code that makes it crash:
      
          menu "Menu"
      
          config FOO
                  bool "foo"
                  default y
      
          menuconfig BAR
                  bool "bar"
                  depends on FOO
      
          endmenu
      
      Select the Split View mode, and double-click "bar" in the right
      window, then you will see Segmentation fault.
      
      When 'last' is not set for symbolMode, the following code in
      ConfigList::updateList() calls firstChild().
      
        item = last ? last->nextSibling() : firstChild();
      
      However, the pointer returned by ConfigList::firstChild() does not
      seem to be compatible with (ConfigItem *), which seems another bug.
      
      I'd rather want to reconsider whether hiding the goback icon is the
      right thing to do.
      
      In the following test code, the Split View shows "Menu2" and "Menu3"
      in the right window. You can descend into "Menu3", but there is no way
      to ascend back to "Menu2" from "Menu3".
      
          menu "Menu1"
      
          config FOO
                  bool "foo"
                  default y
      
          menu "Menu2"
                  depends on FOO
      
          menu "Menu3"
      
          config BAZ
                  bool "baz"
      
          endmenu
      
          endmenu
      
          endmenu
      
      It is true that the goback button is currently not functional due to
      yet another bug, but hiding the problem is not the right way to go.
      
      Anyway, Segmentation fault is fatal. Revert the offending commit for
      now, and we should find the right solution.
      Reported-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      4b20e103
    • M
      Revert "kconfig: qconf: Change title for the item window" · 97bebbcd
      Masahiro Yamada 提交于
      This reverts commit 5752ff07.
      
      It added dead code to ConfigList:ConfigList().
      
      The constructor of ConfigList has the initializer, mode(singleMode).
      
          if (mode == symbolMode)
                 setHeaderLabels(QStringList() << "Item" << "Name" << "N" << "M" << "Y" << "Value");
          else
                 setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
      
      ... always takes the else part.
      
      The change to ConfigList::updateSelection() is strange too.
      When you click the split view icon for the first time, the titles in
      both windows show "Option". After you click something in the right
      window, the title suddenly changes to "Item".
      
      ConfigList::updateSelection() is not the right place to do this,
      at least. It was not a good idea, I think.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      97bebbcd
    • M
      kconfig: qconf: remove "goBack" debug message · ce02397f
      Masahiro Yamada 提交于
      Every time the goback icon is clicked, the annoying message "goBack"
      is displayed on the console.
      
      I guess this line is the left-over debug code of commit af737b4d
      ("kconfig: qconf: simplify the goBack() logic").
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      ce02397f
    • M
      kconfig: qconf: use delete[] instead of delete to free array · c9b09a92
      Masahiro Yamada 提交于
      cppcheck reports "Mismatching allocation and deallocation".
      
      $ cppcheck scripts/kconfig/qconf.cc
      Checking scripts/kconfig/qconf.cc ...
      scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
        delete data;
               ^
      scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data
       char *data = new char[count + 1];
                    ^
      scripts/kconfig/qconf.cc:1242:10: note: Mismatching allocation and deallocation: data
        delete data;
               ^
      scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
        delete data;
               ^
      scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and deallocation: data
       char *data = new char[count + 1];
                    ^
      scripts/kconfig/qconf.cc:1255:10: note: Mismatching allocation and deallocation: data
        delete data;
               ^
      
      Fixes: c4f7398b ("kconfig: qconf: make debug links work again")
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      c9b09a92
    • M
      kconfig: qconf: compile moc object separately · 0e912c03
      Masahiro Yamada 提交于
      Currently, qconf.moc is included from qconf.cc but they can be compiled
      independently.
      
      When you modify qconf.cc, qconf.moc does not need recompiling.
      
      Rename qconf.moc to qconf-moc.cc, and split it out as an independent
      compilation unit.
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      0e912c03
  6. 01 7月, 2020 8 次提交
  7. 08 4月, 2020 3 次提交