Skip to content

VFolderMenu: Add const to local QString to fix compilation with Qt 6.7

ivan tkachenko requested to merge work/ratijas/fix-compilation into master

C++ ternary on line 601 does not like that QStringBuilders refer to strings of different constness.


The error itself:

/home/ratijas/kde/src6/kservice/src/sycoca/vfolder_menu.cpp: In member function ‘void VFolderMenu::mergeMenus(QDomElement&, QString&)’:
/home/ratijas/kde/src6/kservice/src/sycoca/vfolder_menu.cpp:601:56: error: operands to ‘?:’ have different types ‘QStringBuilder<QString&, const QString&>’ and ‘QStringBuilder<const QString&, const QString&>’
  601 |                     const QString fileToAdd = relative ? dir + file : menuDir + file;
      |                                               ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Merge request reports

Loading