Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    QFileSystemWatcher

    General and Desktop
    5
    10
    4123
    Loading More Posts
    • 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.
    • P
      paganotti last edited by

      Good Morning, today I'm trying to do something test using QFileSystemWatcher class.
      Is It possible to know what file is been deleted, renamed, modified programmaticaly in signal directoryChanged and it is possible to know what operation is applied to that file?
      For example if I rename a file test.txt contained in a folder called share, can I know via API that file test.txt is renamed instantly?

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

        Why not add all the files in the dir to the watcher and catch fileChanged() signal?

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • P
          paganotti last edited by

          With fileChanged() is it possible know also the operation over that file? For example when renamed file test.txt to test2.txt, FileChanded() says me I have renamed that file test.txt to test2.txt? Can you post me a snippet, please? Thank you so much.

          1 Reply Last reply Reply Quote 0
          • G
            goetz last edited by

            You have read the documentation of "QFileSystemWatcher::fileChanged() ":http://doc.qt.nokia.com/4.7/qfilesystemwatcher.html#fileChanged, haven't you?

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply Reply Quote 0
            • P
              paganotti last edited by

              I have read the documentation. FileChanged says me that something is success on that file, but it doesn't say me exactly the operation: rename, delete or modify. I need know exacly what it is happened on that file.

              1 Reply Last reply Reply Quote 0
              • G
                goetz last edited by

                You'll have to check this yourself.

                There are some issues in the bug tracker that are related to your problem:

                • "QTBUG-2264":http://bugreports.qt.nokia.com/browse/QTBUG-2264
                • "QTBUG-172":http://bugreports.qt.nokia.com/browse/QTBUG-172, you might want to re-open this one

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply Reply Quote 0
                • S
                  stukdev last edited by

                  So there isn't a way to do this?

                  1 Reply Last reply Reply Quote 0
                  • G
                    goetz last edited by

                    No, unfortunately, there is no builtin way to get this information, sorry.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply Reply Quote 0
                    • D
                      dangelog last edited by

                      Not in Qt as of now. KDE does something better with KDirWatch.

                      Software Engineer
                      KDAB (UK) Ltd., a KDAB Group company

                      1 Reply Last reply Reply Quote 0
                      • A
                        andre last edited by

                        I have requested "bug 172":http://bugreports.qt.nokia.com/browse/QTBUG-172 be re-opened. That has been done. You can vote for it now, if you want. Don't count on this being fixed any time soon though, seeing that the priority is not that high.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post