helloSystem / Filer

A file manager that can also render the desktop
GNU General Public License v2.0
31 stars 9 forks source link

Do not show mounted disks in ~/Desktop #67

Closed probonopd closed 3 years ago

probonopd commented 3 years ago

Now the volumes show up not only on the Desktop (where they should) but also when one goes to ~/Desktop in Filer. They should not be shown in the latter location.

image

cc @moochris

ghost commented 3 years ago

This should be easy to fix - use a FolderModel directly in desktopwindow.cpp instead of a CachedFolderModel.

The latter is cached by the path when first created for the desktop window and gets reused when you browse to the desktop folder.

probonopd commented 3 years ago

Getting error: no member named 'modelFromPath' in 'Fm::FolderModel' then.

ghost commented 3 years ago

I mean it's simple but you need to change it a little more - you want model_ to be a FolderModel now.

You don't need modelFromPath() for FolderModel - you can just initialise it in the constructor and then (where you currently call modelFromPath():

FmFolder* folder = fm_folder_from_path(fm_path_get_desktop());
model_->setFolder(folder);
model_->addComputerFiles();

same further down in DesktopWindow::setDesktopFolder() (but with path)

ghost commented 3 years ago

In fact I think folder_ is already the folder you need for the above

edit - nevermind... this is stored after the model is created... :smile:

probonopd commented 3 years ago

Getting a segfault now. Suspect it may have to do with what is going on in DesktopWindow::~DesktopWindow()? I never know what I have to do in ~ (this is the nice thing about Python - you don't have to deal with such things).

Would you be able to send a PR?

ghost commented 3 years ago

Yes, no problem - leave it with me.

Yes, I agree, writing Python is always a relief after writing C++ for so long and dealing with all that stuff :smile:

probonopd commented 3 years ago

Now we have an "interesting" side effect @moochris: When you go to ~/Desktop and press F5 there to refresh, then the volumes disappear from the desktop.

I hope this is fixable...

ghost commented 3 years ago

Doh! I'll take a look

probonopd commented 3 years ago

Thanks @moochris for having resolved this issue. :+1: