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. Editing files (via SMB) with Qt Creator on Ubuntu - very slow to save/autosave
Forum Updated to NodeBB v4.3 + New Features

Editing files (via SMB) with Qt Creator on Ubuntu - very slow to save/autosave

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 992 Views 1 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.
  • AggsA Offline
    AggsA Offline
    Aggs
    wrote on last edited by
    #1

    I have some source files that are on a server running samba. I am editing them using the text editor in Qt Creator (version 4.8.2, based on Qt 5.12.1) running on an Ubuntu (version 18.04.2) machine. I have also tried editing them using Qt Creator on a Windows machine.

    On Windows, saving the files takes about a second. (with the SMB server physically located in the room next door so very quick ping times) Which is expected behaviour.

    On Ubuntu, things get confusing.
    If I connect to the SMB share using the "Connect to server" box in Nautilus (which mounts in gvfs folder), I can open the files but when saving, Qt Creator says it does not have permission to write to the files on the SMB share. But if I open the files in gedit, make changes and press save, it writes to the files without any problems.

    If I connect to the SMB share using "mount -t cifs", I can open the files in Qt Creator, edit them but then saving them causes Qt Creator to stop responding for about 30 seconds (writing to the file does complete successfully, it just takes a long time). When Qt Creator does the periodic autosaves it also stops responding for about 30 seconds each time. And again, if I edit the files with gedit, everything works as expected and writing to the files only takes a second.

    This problem only seems to occur when using Qt Creator to edit the files. Writing to files on a SMB share with other software seems to work fine. Which suggests that the SMB settings are ok.

    What does Qt Creator do differently when it tries to save a file?

    JKSHJ 1 Reply Last reply
    0
    • AggsA Aggs

      I have some source files that are on a server running samba. I am editing them using the text editor in Qt Creator (version 4.8.2, based on Qt 5.12.1) running on an Ubuntu (version 18.04.2) machine. I have also tried editing them using Qt Creator on a Windows machine.

      On Windows, saving the files takes about a second. (with the SMB server physically located in the room next door so very quick ping times) Which is expected behaviour.

      On Ubuntu, things get confusing.
      If I connect to the SMB share using the "Connect to server" box in Nautilus (which mounts in gvfs folder), I can open the files but when saving, Qt Creator says it does not have permission to write to the files on the SMB share. But if I open the files in gedit, make changes and press save, it writes to the files without any problems.

      If I connect to the SMB share using "mount -t cifs", I can open the files in Qt Creator, edit them but then saving them causes Qt Creator to stop responding for about 30 seconds (writing to the file does complete successfully, it just takes a long time). When Qt Creator does the periodic autosaves it also stops responding for about 30 seconds each time. And again, if I edit the files with gedit, everything works as expected and writing to the files only takes a second.

      This problem only seems to occur when using Qt Creator to edit the files. Writing to files on a SMB share with other software seems to work fine. Which suggests that the SMB settings are ok.

      What does Qt Creator do differently when it tries to save a file?

      JKSHJ Online
      JKSHJ Online
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @Aggs said in Editing files (via SMB) with Qt Creator on Ubuntu - very slow to save/autosave:

      What does Qt Creator do differently when it tries to save a file?

      My first thought is to check the ownership Qt Creator executable. Does it have the same owner as gedit?

      Anyway, in case nobody here can answer your question, try subscribing to the Qt Creator mailing list and ask there: https://lists.qt-project.org/listinfo/qt-creator

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      3
      • AggsA Offline
        AggsA Offline
        Aggs
        wrote on last edited by
        #3

        The executables are both run as my local user account (not root).

        The ownership of the actual executable files is as follows: (not really sure why this would matter though?)
        Qt Creator: -rwxrwxr-x 1 root root
        gedit: -rwxr-xr-x 1 root root

        aha_1980A 2 Replies Last reply
        0
        • AggsA Aggs

          The executables are both run as my local user account (not root).

          The ownership of the actual executable files is as follows: (not really sure why this would matter though?)
          Qt Creator: -rwxrwxr-x 1 root root
          gedit: -rwxr-xr-x 1 root root

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi @Aggs,

          @JKSH's suggestion is good; only the developers know the internals exactly.

          From my memory, I only know they are implementing an "atomic" save mechanism, which has lead to problems in the past, but was improved over time. Your use-case is simply a bit unusual (well, I use Creator in Windows too with network shares, but so far not from Linux).

          If I remember correctly, this atomic save means the file contents is save in a temporary file which then replaces the old file on one step. But as said, I'm not too deep in this and might also be wrong here.

          Regards

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • AggsA Aggs

            The executables are both run as my local user account (not root).

            The ownership of the actual executable files is as follows: (not really sure why this would matter though?)
            Qt Creator: -rwxrwxr-x 1 root root
            gedit: -rwxr-xr-x 1 root root

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Aggs

            Just one more question: Are you using the Clang Code Model? Can you try turning it off and see if that helps (Help > About Plugins > Clang Code Model)?

            Qt has to stay free or it will die.

            AggsA 1 Reply Last reply
            1
            • aha_1980A aha_1980

              @Aggs

              Just one more question: Are you using the Clang Code Model? Can you try turning it off and see if that helps (Help > About Plugins > Clang Code Model)?

              AggsA Offline
              AggsA Offline
              Aggs
              wrote on last edited by Aggs
              #6

              @aha_1980 said in Editing files (via SMB) with Qt Creator on Ubuntu - very slow to save/autosave:

              Just one more question: Are you using the Clang Code Model? Can you try turning it off and see if that helps (Help > About Plugins > Clang Code Model)?

              Yes, however turning it off does not help. It still takes a long time to save a file.

              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