elementary / files

File browser designed for elementary OS
https://elementary.io
GNU General Public License v3.0
330 stars 78 forks source link

Remote locations' icons change to a question mark after disconnecting them #2129

Open TomiOhl opened 1 year ago

TomiOhl commented 1 year ago

What Happened?

The icons of bookmarked remote locations icons change to a question mark after closing and reopening Files. See the two items above the trash: image

Steps to Reproduce

  1. Open files, connect to a server via sftp or ssh.
  2. Bookmark the directory.
  3. Notice that it will appear on the sidebar with a cloud icon.
  4. Disconnect it and close Files.
  5. Open files again.
  6. Notice that the newly bookmarked icon is no longer a cloud, rather a question mark. (7. If you connect to it again and refresh, it will become a cloud icon again.)

Note: if you don't disconnect it in step 4, after reopening the generic folder icon will appear instead of the question mark.

Expected Behavior

The icon should stay a cloud icon.

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

jeremypw commented 1 year ago

Not so easy to fix as it is not possible to determine for sure what icon to use. The file could be either a share (cloud icon), folder (folder icon) or a regular file (mimetype icon). Or it may no longer exist on the server. Also some indication that it is currently inaccessible seems reasonable. The file type could be guessed from the URL I suppose but may not be accurate. Perhaps a more informative "broken connection" icon would be better?

TomiOhl commented 1 year ago

Well as a general solution I think the best would be to just use the cloud icon indicating that it's a remote location. I'm pretty sure it worked exactly like that earlier. I don't think a "broken connection" icon would be appropriate - I'm not sure how are most people using these remote locations, but most of the time I have them unmounted and only mount them when needed. A small indicator to the cloud icon could be added to signalize that it's unmounted, but I think that would be just unnecessary clutter.

jeremypw commented 1 year ago

Currently the cloud is only used for a share (remote mount) bookmark, if you bookmark a remote folder or remote (e.g.) text file then the folder or text-file icon is used (at least for SMB connections). So showing a cloud for a disconnected remote bookmark would mean that the icon changes when you connect. Otherwise it means showing a cloud for all remote bookmarks.

jeremypw commented 1 year ago

On an SFTP/SSH connect currently showing a cloud for both shares and folders but mimetype for regular files. So maybe for consistency it would be better just to show a cloud for all remote locations?

TomiOhl commented 1 year ago

Was just writing the same thing. Showing just a cloud icon would be more consistent and certainly better than showing question marks (since it's infeasible to get file info without connection). Another solution could be to store the mimetype. It would still be uncertain whether the file still exists on the server but it's still something.

jeremypw commented 1 year ago

Seems only SMB connections show folder locations as a folder. All the other connection types show folders as a cloud (and the folder icon in the view has a cloud imprint). I would need to check the code for an explanation. Presumably can only get the relevant fileinfo over SMB and the mimetype is being guessed from the extension.

jeremypw commented 1 year ago

Looks like there is an issue bookmarking remote regular files other than on SMB anyway - clicking on them tries to open them as folders. If this cannot be fixed may have to disable bookmarking remote regular files.

jeremypw commented 1 year ago

At the moment I want to focus on developing the Gtk4 version (a very big job) so not sure there will be another Gtk3 beyond the upcoming version 6.4.0 unless there are critical fixes.

TomiOhl commented 1 year ago

Understandable, looking forward to the GTK4 version - if this fix does not make it into this release, it will appear in the next one, be it GTK4 or not, won't it?

jeremypw commented 1 year ago

Difficult to say. The first Gtk4 release will be concentrating on not introducing regressions. However, I will try to fix those bugs that can be fixed while changing code that is going to have to be changed anyway.