Results 1 to 5 of 5

Thread: How can I watch for changing current directory?

  1. #1
    Join Date
    Sep 2011
    Location
    Ukraine, Kharkov
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How can I watch for changing current directory?

    Hello,

    I need to watch for changing current directory, when someone changed current directory of application. I found QFileSystemWatcher, but it can only watch for changes in current directory.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I watch for changing current directory?

    How can someone change the current directory behind your back? I don't think there are any facilities for monitoring the current working directory.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2011
    Location
    Ukraine, Kharkov
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I watch for changing current directory?

    We write the plugin system. Any plug-in can execute Qt::setCurrent, and other plug-ins need to respond of this event.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I watch for changing current directory?

    Wrap the call into your own call and let the plugins only use your call instead of the one that directly changes the current directory.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    UASlaX (6th September 2011)

  6. #5
    Join Date
    Sep 2011
    Location
    Ukraine, Kharkov
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I watch for changing current directory?

    Wrap the call into your own call and let the plugins only use your call instead of the one that directly changes the current directory.
    I already have internal function for set current directory. Some developers, sometimes, use setCurrent from Qt. I would use qt events and convert them in our events, when someone use not my function for change directory. Thanks, I understood, It's impossible with Qt.

Similar Threads

  1. Problems with the current working directory.
    By aarelovich in forum Qt Programming
    Replies: 1
    Last Post: 19th May 2011, 19:41
  2. Replies: 3
    Last Post: 5th January 2009, 21:55
  3. Getting Current Directory.
    By afflictedd2 in forum Qt Programming
    Replies: 2
    Last Post: 16th November 2008, 22:27
  4. Qt 4 current directory path
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2008, 18:58
  5. setting working directory for current process
    By mule in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2007, 13:54

Tags for this Thread

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.