<commit_before>/**
* @Author: <NAME> <marius>
* @Date:   12-10-2016 09:10:48
* @Email:  <EMAIL>
* @Last modified by:   marius
* @Last modified time: 12-10-2016 11:10:22
* @License: MIT
*/


#include "cade-window-list.h"
#include "cade-window-controller.h"
#include "cade-window-list-element.h"
#include "cade-app-window.h"
#include <gtk/gtk.h>

struct _CadeWindowList {
  GtkBox parent_instance;
  CadeWindowController *controller;
};

struct _CadeWindowListClass {
  GtkBoxClass parent_class;
};

G_DEFINE_TYPE (CadeWindowList, cade_window_list, GTK_TYPE_BOX)

static gboolean _cade_window_list_refresh_windows(gpointer list)
{
  CadeWindowList *self = CADE_WINDOW_LIST(list);

  GList *windows = cade_window_controller_get_all_windows(self->controller);
  GList *existing = gtk_container_get_children(GTK_CONTAINER(self));
  GList *existingIter;
  GList *iter = windows;

  guint activeWindow = cade_window_controller_get_active_id(self->controller);

  while(iter != NULL)
  {
    CadeAppWindow *win = CADE_APP_WINDOW(iter->data);
    gchar *title = cade_app_window_get_name(win);
    guint id = cade_app_window_get_id(win);

    existingIter = existing;
    gboolean alreadyInList = FALSE;
    while(existingIter != NULL)
    {
      guint existingID = cade_window_list_element_get_id(CADE_WINDOW_LIST_ELEMENT(existingIter->data));<commit_msg>`cade-shell` will no longer appear in windowlist<commit_after>/**
* @Author: <NAME> <marius>
* @Date:   12-10-2016 09:10:48
* @Email:  <EMAIL>
* @Last modified by:   marius
* @Last modified time: 12-10-2016 13:10:29
* @License: MIT
*/


#include "cade-window-list.h"
#include "cade-window-controller.h"
#include "cade-window-list-element.h"
#include "cade-app-window.h"
#include <gtk/gtk.h>

struct _CadeWindowList {
  GtkBox parent_instance;
  CadeWindowController *controller;
};

struct _CadeWindowListClass {
  GtkBoxClass parent_class;
};

G_DEFINE_TYPE (CadeWindowList, cade_window_list, GTK_TYPE_BOX)

static gboolean _cade_window_list_refresh_windows(gpointer list)
{
  CadeWindowList *self = CADE_WINDOW_LIST(list);

  GList *windows = cade_window_controller_get_all_windows(self->controller);
  GList *existing = gtk_container_get_children(GTK_CONTAINER(self));
  GList *existingIter;
  GList *iter = windows;

  guint activeWindow = cade_window_controller_get_active_id(self->controller);

  while(iter != NULL)
  {
    CadeAppWindow *win = CADE_APP_WINDOW(iter->data);
    gchar *title = cade_app_window_get_name(win);
    gboolean alreadyInList = FALSE;

    if(strcmp(title, "cade-shell") == 0)
      alreadyInList = TRUE;
    guint id = cade_app_window_get_id(win);

    existingIter = existing;
    while(existingIter != NULL && alreadyInList == FALSE)
    {
      guint existingID = cade_window_list_element_get_id(CADE_WINDOW_LIST_ELEMENT(existingIter->data));
{'fraction_non_alphanumeric': 0.11646017699115044, 'fraction_numerical': 0.020176991150442476, 'mean_word_length': 5.322147651006712, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '515147', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1029, 'n_words': 184}