<commit_before>using Gtk;
using GLib;

public class MainWindow : Gtk.Window {

	private Gdk.Pixbuf file_pixbuf;
    private Gdk.Pixbuf folder_pixbuf;

	private Gtk.ListStore store = new Gtk.ListStore (4, typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof(GLib.AppInfo));

	private Gdk.Pixbuf find_icon (string name, IconTheme theme) {
		try {
			Gdk.Pixbuf icon_px;
			icon_px = theme.load_icon (name, 48, Gtk.IconLookupFlags.FORCE_SVG);
			icon_px = icon_px.scale_simple (48, 48, Gdk.InterpType.BILINEAR);
			return icon_px;
		} catch (Error e) {
			return file_pixbuf.scale_simple (48, 48, Gdk.InterpType.BILINEAR);
		}
	}

	private void fill_store () {
		IconTheme theme = Gtk.IconTheme.get_default ();
		store.clear ();
		
		GLib.List<GLib.AppInfo> infolist = GLib.AppInfo.get_all ();
		infolist.foreach ((appinfo) => {
			if (appinfo.should_show ()) {
				TreeIter iter;
				string name;
				string icon;
				string disc;
				Gdk.Pixbuf icon_px;
				
				name = appinfo.get_display_name ();
				disc = "";//appinfo.get_des ();
				icon = appinfo.get_icon ().to_string ();
				icon_px = find_icon(icon, theme);
				
				store.append (out iter);
				store.set (iter, 0, disc, 1, name, 2, icon_px, 3, appinfo);
			}
		});
	}

	private void icon_activate (TreePath path) {
		try {
			TreeIter iter;
			store.get_iter (out iter, path);
			GLib.Value info_v;
			store.get_value (iter, 3, out info_v);
			GLib.AppInfo info = (GLib.AppInfo) info_v;
			info.launch (null, null);
		} catch (Error e) {
			stderr.printf ("Could not load icon: %s\n", e.message);
		}
		Gtk.main_quit ();
	}
	
	public void sortf (TreeIter a, TreeIter b) {
	}

	public MainWindow() {
		try {
			file_pixbuf = new Gdk.Pixbuf.from_file ("/usr/share/ALaunch/gnome-fs-regular.png");
			folder_pixbuf = new Gdk.Pixbuf.from_file ("/usr/share/ALaunch/gnome-fs-directory.png");
		} catch (Error e) {
			stderr.printf ("Could not load icon: %s\n", e.message);
		}
		this.title = "ALaunch";
		this.set_type_hint (Gdk.WindowTypeHint.DOCK);
		this.destroy.connect (Gtk.main_quit);
		
		Gdk.Screen screen = Gdk.Screen.get_default ();
		this.set_default_size (screen.get_width (), screen.get_height ());
		
		fill_store ();
		
		IconView iconview = new IconView ();
		iconview.set_model (store);
		iconview.set_activate_on_single_click (true);
		iconview.set_selection_mode (SelectionMode.SINGLE);
		iconview.set_text_column (1);
		iconview.set_pixbuf_column (2);
		iconview.item_activated.connect (icon_activate);
		
		ScrolledWindow sw = new ScrolledWindow (null, null);
		sw.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
		sw.add (iconview);
		
		Box box = new Box (Orientation.VERTICAL, 1);
		box.pack_start (sw, true, true, 0);
		this.add (box);
	}

}

void main(string[] args) {
	Gtk.init (ref args);
	MainWindow win = new MainWindow ();
	win.show_all ();
	Gtk.main ();
}
<commit_msg>Change the icon size and sort the icons<commit_after>using Gtk;
using GLib;

public class MainWindow : Gtk.Window {

	private Gdk.Pixbuf file_pixbuf;
    private Gdk.Pixbuf folder_pixbuf;

	private Gtk.ListStore store = new Gtk.ListStore (4, typeof (string), typeof (string), typeof (Gdk.Pixbuf), typeof(GLib.AppInfo));

	private Gdk.Pixbuf find_icon (string name, IconTheme theme) {
		try {
			Gdk.Pixbuf icon_px;
			icon_px = theme.load_icon (name, 64, Gtk.IconLookupFlags.FORCE_SVG);
			icon_px = icon_px.scale_simple (64, 64, Gdk.InterpType.BILINEAR);
			return icon_px;
		} catch (Error e) {
			return file_pixbuf.scale_simple (64, 64, Gdk.InterpType.BILINEAR);
		}
	}

	private void fill_store () {
		IconTheme theme = Gtk.IconTheme.get_default ();
		store.clear ();
		
		GLib.List<GLib.AppInfo> infolist = GLib.AppInfo.get_all ();
		infolist.foreach ((appinfo) => {
			if (appinfo.should_show ()) {
				TreeIter iter;
				string name;
				string icon;
				string disc;
				Gdk.Pixbuf icon_px;
				
				name = appinfo.get_display_name ();
				disc = "";//appinfo.get_des ();
				icon = appinfo.get_icon ().to_string ();
				icon_px = find_icon(icon, theme);
				
				store.append (out iter);
				store.set (iter, 0, disc, 1, name, 2, icon_px, 3, appinfo);
			}
		});
	}

	private void icon_activate (TreePath path) {
		try {
			TreeIter iter;
			store.get_iter (out iter, path);
			GLib.Value info_v;
			store.get_value (iter, 3, out info_v);
			GLib.AppInfo info = (GLib.AppInfo) info_v;
			info.launch (null, null);
		} catch (Error e) {
			stderr.printf ("Could not load icon: %s\n", e.message);
		}
		Gtk.main_quit ();
	}
	
	public void sortf (TreeIter a, TreeIter b) {
	}

	public MainWindow() {
		try {
			file_pixbuf = new Gdk.Pixbuf.from_file ("/usr/share/ALaunch/gnome-fs-regular.png");
			folder_pixbuf = new Gdk.Pixbuf.from_file ("/usr/share/ALaunch/gnome-fs-directory.png");
		} catch (Error e) {
			stderr.printf ("Could not load icon: %s\n", e.message);
		}
		this.title = "ALaunch";
		this.set_type_hint (Gdk.WindowTypeHint.DOCK);
		this.destroy.connect (Gtk.main_quit);
		
		Gdk.Screen screen = Gdk.Screen.get_default ();
		this.set_default_size (screen.get_width (), screen.get_height ());

		store.set_sort_column_id (1, SortType.ASCENDING);
		fill_store ();
		
		IconView iconview = new IconView ();
		iconview.set_model (store);
		iconview.set_activate_on_single_click (true);
		iconview.set_selection_mode (SelectionMode.SINGLE);
		iconview.set_text_column (1);
		iconview.set_pixbuf_column (2);
		iconview.item_activated.connect (icon_activate);
		
		ScrolledWindow sw = new ScrolledWindow (null, null);
		sw.set_policy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
		sw.add (iconview);
		
		Box box = new Box (Orientation.VERTICAL, 1);
		box.pack_start (sw, true, true, 0);
		this.add (box);
	}

}

void main(string[] args) {
	Gtk.init (ref args);
	MainWindow win = new MainWindow ();
	win.show_all ();
	Gtk.main ();
}

{'fraction_non_alphanumeric': 0.13647301478171192, 'fraction_numerical': 0.007047095221725679, 'mean_word_length': 3.6440542697525937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1236457', 'n_tokens_mistral': 2485, 'n_tokens_neox': 2150, 'n_words': 476}