<commit_before>/*
    knjobdata.cpp

    KNode, the KDE newsreader
    Copyright (c) 1999-2001 the KNode authors.
    See file AUTHORS for details

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, US
*/

#include <qstrlist.h>

#include "kngroup.h"
#include "knmime.h"
#include "knjobdata.h"
#include "knglobals.h"
#include "knnetaccess.h"

KNJobConsumer::KNJobConsumer()
{
  j_obs.setAutoDelete(false);
}


KNJobConsumer::~KNJobConsumer()
{
  for(KNJobData *j=j_obs.first(); j; j=j_obs.next())
    j->c_onsumer=0;
}


void KNJobConsumer::emitJob(KNJobData *j)
{
  if(j) {
    j_obs.append(j);
    knGlobals.netAccess->addJob(j);
  }
}


void KNJobConsumer::jobDone(KNJobData *j)
{
  if(j && j_obs.removeRef(j))
    processJob(j);
}


void KNJobConsumer::processJob(KNJobData *j)
{
  delete j;
}


// the assingment of a_ccount may cause race conditions, check again.... (CG)
KNJobData::KNJobData(jobType t, KNJobConsumer *c, KNServerInfo *a, KNJobItem *i)
 : t_ype(t), d_ata(i), a_ccount(a), c_anceled(false), c_onsumer(c)
{
  d_ata->setLocked(true);
}


<commit_msg>hmm, unintialized variables are not nice...<commit_after>/*
    knjobdata.cpp

    KNode, the KDE newsreader
    Copyright (c) 1999-2001 the KNode authors.
    See file AUTHORS for details

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, US
*/

#include <qstrlist.h>

#include "kngroup.h"
#include "knmime.h"
#include "knjobdata.h"
#include "knglobals.h"
#include "knnetaccess.h"

KNJobConsumer::KNJobConsumer()
{
  j_obs.setAutoDelete(false);
}


KNJobConsumer::~KNJobConsumer()
{
  for(KNJobData *j=j_obs.first(); j; j=j_obs.next())
    j->c_onsumer=0;
}


void KNJobConsumer::emitJob(KNJobData *j)
{
  if(j) {
    j_obs.append(j);
    knGlobals.netAccess->addJob(j);
  }
}


void KNJobConsumer::jobDone(KNJobData *j)
{
  if(j && j_obs.removeRef(j))
    processJob(j);
}


void KNJobConsumer::processJob(KNJobData *j)
{
  delete j;
}


// the assingment of a_ccount may cause race conditions, check again.... (CG)
KNJobData::KNJobData(jobType t, KNJobConsumer *c, KNServerInfo *a, KNJobItem *i)
 : t_ype(t), d_ata(i), a_ccount(a), c_anceled(false), a_uthError(false), c_onsumer(c)
{
  d_ata->setLocked(true);
}



{'fraction_non_alphanumeric': 0.11840796019900497, 'fraction_numerical': 0.015920398009950248, 'mean_word_length': 3.993377483443709, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '7015456', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1083, 'n_words': 314}