Results 1 to 3 of 3

Thread: QFileSystemModel update problem for shared network (samba) location

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QFileSystemModel update problem for shared network (samba) location

    I'm using QFileSystemModel and QTreeView to display files tree from a shared network location (Samba).
    Qt Code:
    1. Model->setRootPath("//HostName");
    2. TreeView->setModel(Model);
    3. TreeView->setRootIndex(Model->index("//HostName"));
    To copy to clipboard, switch view to plain text mode 
    The code works fine and I got the file tree. However, it can not automatically pick up the changes there. For example, if I create a new file there, the tree don't display this new file.

    When I set the path to a directory on local hard drive, like "D:/temp". It works. It picks up the changes and update itself.

    Any idea how can I pick up changes from a shared network location and refresh the model/tree?

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFileSystemModel update problem for shared network (samba) location

    You could trigger the refresh manually if you changed something on the fs (assuming to change comes not from "outside")

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileSystemModel update problem for shared network (samba) location

    It doesn't work on networked file systems as it has no way of knowing when something has been changed. On a local file system, the OS will inform if something changes as all file i/o go through the OS.

Similar Threads

  1. QFileSystemModel and network resources
    By Talei in forum Newbie
    Replies: 0
    Last Post: 5th May 2010, 19:02
  2. Replies: 4
    Last Post: 11th March 2010, 13:52
  3. problem with window.location in QWebPage
    By speedy_gonzales in forum Qt Webkit
    Replies: 0
    Last Post: 24th February 2010, 05:40
  4. Known problem with filters and QFileSystemModel?
    By Kumosan in forum Qt Programming
    Replies: 3
    Last Post: 27th August 2009, 08:14
  5. Mac OS X - Accessing Windows Samba Shares
    By marcel in forum General Programming
    Replies: 1
    Last Post: 11th April 2007, 00:28

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.