Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDir doesn't see some files
Forum Updated to NodeBB v4.3 + New Features

QDir doesn't see some files

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 390 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sucharek
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by mchinand
      #2

      @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.

      S 1 Reply Last reply
      3
      • M mchinand

        @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.

        S Offline
        S Offline
        Sucharek
        wrote on last edited by
        #3

        Hi @mchinand, thanks! It works perfectly.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved