Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-93085

renameOverwrite() must look for a symlink first

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Won't Do
    • Affects Version/s: 5.15.0 RC2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Linux
    • Platform/s:
      Linux/X11

      Description

      This is the exact location: https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qsavefile.cpp#n323.

      The `commit()` function seems to replace the original config file (if it exists). Now if the config file is actually a symlink, the symlink is replaced with the new file.

      So the following for example

      ~/.config/settings.conf --> ~/.dotfiles/.config/settings.conf (symlink)
      ~/.dotfiles/.config/settings.conf (actual file)
      

      turns into this after a `commit()`.

      ~/.config/settings.conf (new config file which is no longer a symlink)
      ~/.dotfiles/.config/settings.conf (original config file)
      

      I think the more appropriate action would be to traverse the symlink chain, then replace the actual file instead. This would help users who prefer to store all their configuration files (including the qt ones) at a separate location. 

      In particular, I think the problem is with the `renameOverwrite()` function. I am not sure where its definition is, but I hope the function is rectified so that symlinks are taken into consideration in the future.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            user9582793459 Marshall Cipriani
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes