Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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?


  • Moderators

    @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



  • 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


  • Lifetime Qt Champion

    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


  • Lifetime Qt Champion

    @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)?



  • @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.


Log in to reply