QDir doesn't see some files
Solved
General and Desktop
-
Hello, I'm making a sorting system, but I came across a problem.
When I'm sorting the files, some don't get picked up by QDir.
The files are some shortcuts - HP Smart, Arduino IDE, Spotify. These don't get picked up by QDir.
I'm getting the files like this:QDir downloads(mainPath); qDebug() << downloads.entryList(extentions /*.lnk files*/, QDir::Files); //picks up everyting except the shortcuts I listed
Am I doing something wrong?
-
@Sucharek said in QDir doesn't see some files:
qDebug() << downloads.entryList(extentions /.lnk files/, QDir::Files); //picks up everyting except the shortcuts I listed
Try it with:
downloads.entryList(extentions, QDir::Files | QDir::System);
From the documentation, the QDir::System filter includes
List system files (on Unix, FIFOs, sockets and device files are included; on Windows, .lnk files are included)
Also, QFileInfo might be useful to you in handling/opening the .lnk files.