GSoC 22 – The Closing Blog Post
In the summer of 2022, I participated in Google’s Summer of Code, contributing
to the Thunar file manager at XFCE, with the help
of my mentor Alexander Schwinn.
It’s been about a month since my GSoC term was officially over, and after a hectic
couple weeks, I’ve finally decided to sit down and write down the closing blog post.
New features in Thunar
I’ll start off by introducing the features that I worked on, and a rough idea
of how the implementation for the same works. Of these, undo-redo and file
counts for folders are already merged on master and have been released with
Xfce 4.18. The tour probably does a much
better job than I will here, so be sure to go through it as well!
Undo-redo
This is the big one. While adding support for undo and redo, one of the most
crucial things for me was doing it in an elegant way that would make it easy to
have multi-level undo and redo.
How we decided to do this was to maintain a global linked list, containing
information about the last performed operation, including what type of an
operation it was, what files were involved in it, etc. This allowed it to be as
trivial as moving a few pointers around to keep track of the state of the
system once an undo or a redo is performed. The actual undo/redo operation is
simply executing either the inverse of the last performed operation, or
executing the exact same operation that was last undone.
I’m of course glossing over a lot of the details that made this a fair bit
harder than we had initially anticipated. Nonetheless, with some help from
Alex, we were able to ship this in time for the 4.18 release! :raised_hands:
File counts for folders
Adding file counts for features was just a little addition to help better
utilize the ‘size’ column for folders, which was essentially wasted space earlier.
It was essential to be asynchronous with its implementation, which turned out
to be a bit trickier than I had initially expected. It mostly boiled down to a
line of conversions between file abstractions that I had taken for granted
would have a low overhead (spoiler alert: they did not have a low overhead).
Gallery view
I was less than confident when first approaching Gallery view, since I thought
I’d have to create an entire view from scratch. Luckily, that really wasn’t
necessary. I was able to make a new view based off the same abstract view class
that the existing icon view used. This is probably better for multiple reasons,
since building on existing things makes for much simpler design for the new
additions, and easier code review as well.
While I initially had envisioned a masonry image gallery, like the kind you
would see on sites such as Pinterest, the abstract icon view lent itself much
better to a square icon based gallery, similar to what most Android phone
galleries have by default these days.
The gallery view PR is not yet merged into master, needing a few minor fixes on
the dialog tooltips (which I’ve sadly been a bit too busy to work on yet),
before it’s completely ready.
Not all smooth sailing
While I had initially hoped to complete what I had mapped out in my GSoC
proposal in my summer vacations itself, that didn’t work out as intended.
Once my semester at college started, I started struggling a bit to balance
my academics and my GSoC commitments, but I was steadily making progress.
GSoC being flexible with its contributor timelines this year was an absolute
life-saver, since I had to extend my deadline multiple times in order to
hit the milestones on my proposal.
The lowest point was when in the midst of all this, some personal family issues
cropped up and I essentially went incommunicado for almost a week. This
would’ve been enough to fail my proposal in some organizations, but Alex still
gave me a chance to make up on lost time when I was back, and for that I’m
incredibly grateful. I was able to capitalize on this opportunity and get
plenty of work done, though it was really quite hard (and probably not very
good for my health long term :sweat_smile:).
Advice for others
I recently received an email from someone who was looking to contribute to XFCE in this year’s
GSoC, and wanted some advice. I’ll relay part of what I wrote back over here:
I’d say the most important thing is to dive into it while still knowing that
you don’t know anything :PTry at a problem with your intuition for what might work. If you get stuck,
push for another 15-20 mins and note down what you try. In this time you
should be consulting documentation, StackOverflow, Github issues etc.
If you still aren’t able to figure it out, send a message on
the XFCE IRC/Matrix channel, and be descriptive about what you tried, why you
think it should work, and why you think it might not have worked. The mentors
are incredibly helpful, and you’ll often get an answer that will deepen your
understanding of the system and coding in general.
In addition, I’d also like to stress that communication is key!. Your
mentors are there to help you, and they want nothing more than a successful and
productive summer for the both of you. Raising issues that you’re facing as
early as you can allows the both of you to think about and discuss how to
tackle them.
Acknowledgements
I’m incredibly grateful to my mentor Alexander Schwinn, who is one of the most
helpful people I’ve had the pleasure of working with. He’s been incredibly kind
and polite, more than one could reasonably expect out of anyone given the
circumstances.
I’m also very thankful for all the help I’ve received from the dedicated XFCE
community, including Sergios Kefalidis, Yonghwa Hong, Gaël Bonithon, and many
others.
Finally, I’d like to thank Google Summer of Code for the wonderful opportunity,
which has definitely been a fantastic hands-on learning experience for me.