Skip to content

fix(tray): include QFileInfo in asyncimageresponse.cpp - #11456

Open
christian-heusel wants to merge 1 commit into
nextcloud:masterfrom
christian-heusel:fix/qfileinfo-include-qt612
Open

christian-heusel wants to merge 1 commit into
nextcloud:masterfrom
christian-heusel:fix/qfileinfo-include-qt612

Conversation

@christian-heusel

@christian-heusel christian-heusel commented Nov 30, 2026 •

Copy link
Copy Markdown

Resolves

No issue

Compile error:

[ 36%] Building CXX object src/gui/CMakeFiles/nextcloudCore.dir/cloudproviders/cloudprovidermanager.cpp.o
/build/nextcloud-client/src/nextcloud-client/src/gui/tray/asyncimageresponse.cpp: In member function ‘void AsyncImageResponse::processNextImage()’:
/build/nextcloud-client/src/nextcloud-client/src/gui/tray/asyncimageresponse.cpp:81:49: error: invalid use of incomplete type ‘class QFileInfo’
   81 |         const auto fileInfo = QFileInfo(filePath);
      |                                                 ^
In file included from /usr/include/qt6/QtWidgets/qfileiconprovider.h:10,
                 from /usr/include/qt6/QtWidgets/QFileIconProvider:1,
                 from /build/nextcloud-client/src/nextcloud-client/src/gui/tray/asyncimageresponse.h:10,
                 from /build/nextcloud-client/src/nextcloud-client/src/gui/tray/asyncimageresponse.cpp:6:
/usr/include/qt6/QtGui/qabstractfileiconprovider.h:15:7: note: forward declaration of ‘class QFileInfo’
   15 | class QFileInfo;
      |       ^~~~~~~~~
make[2]: *** [src/gui/CMakeFiles/nextcloudCore.dir/build.make:1960: src/gui/CMakeFiles/nextcloudCore.dir/tray/asyncimageresponse.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 36%] Linking CXX static library ../lib/libtestutils.a
[ 36%] Built target testutils
make[1]: *** [CMakeFiles/Makefile2:2878: src/gui/CMakeFiles/nextcloudCore.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Summary

AsyncImageResponse::processNextImage() constructs a QFileInfo but the file never included <QFileInfo>, instead it relied on the header being pulled in transitively via <QFileIconProvider>.

With Qt 6.12, qabstractfileiconprovider.h only forward-declares QFileInfo, so the build fails with "invalid use of incomplete type 'class QFileInfo'".

TODO

  • ...

Checklist

AI (if applicable)

`AsyncImageResponse::processNextImage()` constructs a `QFileInfo` but
the file never included `<QFileInfo>`, instead it relied on the header
being pulled in transitively via `<QFileIconProvider>`.

With Qt 6.12, `qabstractfileiconprovider.h` only forward-declares
`QFileInfo`, so the build fails with "invalid use of incomplete type
'class QFileInfo'".

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Christian Heusel <christian@heusel.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant