Results 1 to 4 of 4

Thread: how to get the added file name when using QFileSystemWatcher

  1. #1
    Join Date
    Dec 2006
    Posts
    36
    Thanked 1 Time in 1 Post

    Default how to get the added file name when using QFileSystemWatcher

    i use QFileSystemWatcher to watch some directory, when i add a file to it, I can get the signal well, but now the question is how to get the added file name? QFileSystemWatcher NOW seemed to have no method to do it directly.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to get the added file name when using QFileSystemWatcher

    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: how to get the added file name when using QFileSystemWatcher

    This feature, along other improvements have been suggested over and over again during the testing-cycle of Qt-4.2 preleases due to the inability of QFileSystemWatcher to provide more details about the event that caused the signal(s). Yet, as of now nothing indicates that these shortcomings will be addressed int Qt's near future releases. The solution is to build a custom class to carry out the monitoring of files and directories.

    This shouldn't be too hard using your operating systems native directoy-monitoring facilities if your code is only intended to run on a single platform. it will however be much more difficult to implement this as a platform independet solution. I needed to write such a class on linux a while ago, so I resorted to using fam (or gamin which is API compatible to fam) and it wasn't too much of labour implementing it.
    http://oss.sgi.com/projects/fam/faq.html

    good luck!

  4. #4
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: how to get the added file name when using QFileSystemWatcher

    The future looks dim on this one, task 182019 is set to "wont fix".

Similar Threads

  1. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 11:47
  2. How To Extract A File
    By deekayt in forum General Programming
    Replies: 7
    Last Post: 5th December 2006, 18:27
  3. Qt 3.3.4 -> Qt 4.1.2, moc file issue
    By philski in forum Qt Tools
    Replies: 1
    Last Post: 11th September 2006, 21:08
  4. SQLite-DB in a qrc file
    By Lykurg in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2006, 19:24
  5. Accessing DTD in an XML file via QtXml module?
    By jorma in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2006, 18:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.