惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
Latest news
Latest news
Microsoft Azure Blog
Microsoft Azure Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
M
MIT News - Artificial intelligence
V
Visual Studio Blog
N
Netflix TechBlog - Medium
P
Palo Alto Networks Blog
C
Cybersecurity and Infrastructure Security Agency CISA
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
V
Vulnerabilities – Threatpost
AWS News Blog
AWS News Blog
美团技术团队
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Stack Overflow Blog
Stack Overflow Blog
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
Lohrmann on Cybersecurity
B
Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
Hacker News - Newest:
Hacker News - Newest: "LLM"
Hugging Face - Blog
Hugging Face - Blog
O
OpenAI News
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
Google Online Security Blog
Google Online Security Blog
T
Tenable Blog
Attack and Defense Labs
Attack and Defense Labs
C
Cisco Blogs
G
GRAHAM CLULEY
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
Help Net Security
Help Net Security
The Last Watchdog
The Last Watchdog
S
Security @ Cisco Blogs
C
CERT Recently Published Vulnerability Notes
博客园 - 【当耐特】
T
Troy Hunt's Blog
Cloudbric
Cloudbric
IT之家
IT之家

Hub's wlog

Hub's wlog - Dia with GTK 3 Hub's wlog - Dev Log August 2023 Hub's wlog - libopenraw Rust with C API Hub's wlog - Niepce June 2023 updates Hub's wlog - Life update Hub's wlog - Niepce May 2023 updates Hub's wlog - Niepce April 2023 updates Hub's wlog - Niepce March 2023 updates Hub's wlog - Integrating the RawTherapee engine Hub's wlog - Niepce February 2023 updates Hub's wlog - Implementing i18n-format, a Rust procedural macro Hub's wlog - Niepce January 2023 updates Hub's wlog - i18n-format for Rust Hub's wlog - Introducing Toot That! Hub's wlog - Niepce December 2022 updates Hub's wlog - Niepce November 2022 updates Hub's wlog - Fall of releases Hub's wlog - Introducing Compiano Hub's wlog - RTKit, portals, and Pipewire Hub's wlog - Release day Hub's wlog - Update on Niepce Hub's wlog - New Again
Hub's wlog - Niepce July 2023 updates
:: Hubert Figuière · 2023-08-01 · via Hub's wlog

2023.08.01

This is the July 2023 update for Niepce.

The importer

Where we left, the workspace tree view didn't display the hierarchy.

First, I discovered bug in the SQL triggers for folder path update. I was missing the AFTER keyword to have it run after the update.

Workspace

Second, I need to specify a parent when adding items to the model, then locate the parent, add to it. The problem is that we get a list of folders in some order (I can order by any of the SQL columns). The problem is adding an item to a parent that is not yet int the model. There are few ways to go about it.

  1. Sort the folder list in order of a flattened tree. To be fair my SQL skills are not good enough, and I'm not even sure I can do that in sqlite. This would solve most of the problems.
  2. Sort the folder list once received. But this might not always work.
  3. Handle the case in the model: add with a placeholder parent and re-parent as needed when the parent is added.

For now I chose 3. The risk is that if the parent doesn't exist then the tree will stay lingering. It's just the view though.

Here is the result:

Workspace

Tree view cleanup

Back in November, I re-implemented the workspace tree view using gtk4::ListView. But it has some issues, due to limitations in the widget implementation, with the way the expander (the arrow to expand a sub-tree) is handled. The ListView expect to know whether it can be expanded when it is created in the factory. Either there is a model and it can be expanded, or there is no model, and it can't be. The problem is that if you don't want to have an expander because there is no children, you can't. Not with the API.

Can we hide the expander? The answer is yes. Simply in CSS set the icon source to none.

listview > row > box > treeexpander > expander {
	-gtk-icon-source: none;
}

This CSS selector grab just any expander in a list view. Now we need to do it as needed.

First give the list view a name: workspace. Then we'll programatically set a style for the row item when it doesn't have any children. We'll use nochildren, and add/remove the CSS class as needed. The bind and unbind are a good place.

listview#workspace > row > box.nochildren > treeexpander > expander {
	-gtk-icon-source: none;
}

Fixed Workspace

I suspect there might be a few update problems, likely when adding or removing items. We'll see. I will need to implement some testing at one point, but that's a topic for another day.

Also I fixed the display of item counts that didn't work with deeper levels of the tree. This was a long standing issue logic issue introduced with the move to GtkListView.

Build

Using the GNOME templates, I added CI so that we get builds and check automatically,

I also removed some no longer used C++ code.

Other

I then diverted my efforts into libopenraw trying to wrap up the Rust port by finishing the C API. I'll have a detailed post about that soon.

Thanks you for reading.