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

renameOverwrite() must look for a symlink first

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • 5.15.0 RC2
    • None
    • Linux
    • 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

            thiago Thiago Macieira
            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