Skip to content

Commit

Permalink
- Update user source status on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryCasiano committed Feb 5, 2023
1 parent d71a55d commit 47fdbe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fedora/font-manager.spec
Expand Up @@ -8,7 +8,7 @@

Name: font-manager
Version: %{MajorVersion}.%{MinorVersion}.%{PatchVersion}.%{build_timestamp}
Release: 8
Release: 9
Summary: A simple font management application for Gtk+ Desktop Environments
License: GPLv3+
Url: http://fontmanager.github.io/
Expand Down Expand Up @@ -141,5 +141,5 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdat
%{_libdir}/thunarx-3/thunar-%{name}.so

%changelog
* Sat Feb 4 2023 JerryCasiano <JerryCasiano@gmail.com> 0.8.8-8
* Sat Feb 4 2023 JerryCasiano <JerryCasiano@gmail.com> 0.8.8-9
- Refer to https://github.com/FontManager/font-manager/commits/master for changes.
8 changes: 7 additions & 1 deletion src/font-manager/preferences/UserSources.vala
Expand Up @@ -34,7 +34,12 @@ namespace FontManager {
foreach (var path in this)
_items.add(new Source(File.new_for_path(path)));
_items.sort((a, b) => { return natural_sort(a.name, b.name); });
_items.foreach((item) => { add_item(item); });
var active = new Directories();
active.load();
_items.foreach((item) => {
item.active = (item.path in active);
add_item(item);
});
items_changed.connect(() => {
Idle.add(() => { save(); save_active_items(); return GLib.Source.REMOVE; });
});
Expand Down Expand Up @@ -123,6 +128,7 @@ namespace FontManager {
public static UserSourceRow from_item (Object item) {
Source source = (Source) item;
UserSourceRow row = new UserSourceRow();
message("%s : %s", source.name, source.active.to_string());
BindingFlags flags = BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE;
source.bind_property("icon-name", row.icon, "icon-name", flags);
source.bind_property("name", row.title, "label", flags);
Expand Down

0 comments on commit 47fdbe2

Please sign in to comment.