Closed probonopd closed 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.
Getting error: no member named 'modelFromPath' in 'Fm::FolderModel'
then.
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
)
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:
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?
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:
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...
Doh! I'll take a look
Thanks @moochris for having resolved this issue. :+1:
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.cc @moochris