<commit_before>/* font styles */

#include <QApplication>
#include <QSettings>
#include <QTemporaryFile>

#include "base.h"
#include "state.h"

// ---------------------------------------------------------------------
// reads and updates style.cfg file
void Config::initstyle()
{
  QString f=ConfigPath.filePath("style.cfg");
  QSettings *s=new QSettings(f,QSettings::IniFormat);
  QString h,t,w;

  EditFore.set(s->value("Edit/fore","0 0 0").toString());
  EditBack.set(s->value("Edit/back","255 255 255").toString());
  EditHigh.set(s->value("Edit/high","240 240 232").toString());

  TermFore.set(s->value("Term/fore","0 0 0").toString());
  TermBack.set(s->value("Term/back","255 255 255").toString());
  TermHigh.set(s->value("Term/high","240 240 232").toString());

  QString def=TermFore.read();

  adverbStyle.set(s->value("Class/adverb",def).toString());
  commentStyle.set(s->value("Class/comment",def).toString());
  //CommentMulti.set(s->value("Class/",def).toString());
  conjunctionStyle.set(s->value("Class/conjunction",def).toString());
  controlStyle.set(s->value("Class/control",def).toString());
  functionStyle.set(s->value("Class/function",def).toString());
  nounStyle.set(s->value("Class/noun",def).toString());
  noundefStyle.set(s->value("Class/noundef",def).toString());
  numberStyle.set(s->value("Class/number",def).toString());
  stringStyle.set(s->value("Class/string",def).toString());
  verbStyle.set(s->value("Class/verb",def).toString());

  //if (s->allKeys().contains("Edit/high")) return;
<commit_msg>set default style<commit_after>/* font styles */

#include <QApplication>
#include <QSettings>
#include <QTemporaryFile>

#include "base.h"
#include "state.h"

// ---------------------------------------------------------------------
// reads and updates style.cfg file
void Config::initstyle()
{
  QString f=ConfigPath.filePath("style.cfg");
  QSettings *s=new QSettings(f,QSettings::IniFormat);
  QString h,t,w;

  EditFore.set(s->value("Edit/fore","0 0 0").toString());
  EditBack.set(s->value("Edit/back","221 252 222").toString());
  EditHigh.set(s->value("Edit/high","240 240 232").toString());

  TermFore.set(s->value("Term/fore","0 0 0").toString());
  TermBack.set(s->value("Term/back","252 252 221").toString());
  TermHigh.set(s->value("Term/high","240 240 232").toString());

  QString def=TermFore.read();

  adverbStyle.set(s->value("Class/adverb","221 68 68").toString());
  commentStyle.set(s->value("Class/comment","136 136 136 italic").toString());
  conjunctionStyle.set(s->value("Class/conjunction","221 153 153").toString());
  controlStyle.set(s->value("Class/control","255 0 0").toString());
  functionStyle.set(s->value("Class/function","0 0 255").toString());
  nounStyle.set(s->value("Class/noun","0 0 255 bold").toString());
  noundefStyle.set(s->value("Class/noundef","0 0 255").toString());
  numberStyle.set(s->value("Class/number","160 32 240").toString());
  stringStyle.set(s->value("Class/string","0 0 255").toString());
  verbStyle.set(s->value("Class/verb","0 153 102").toString());

  if (s->allKeys().contains("Edit/high")) return;

{'fraction_non_alphanumeric': 0.2648005148005148, 'fraction_numerical': 0.04794079794079794, 'mean_word_length': 4.532028469750889, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 44, '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': '5856564', 'n_tokens_mistral': 1131, 'n_tokens_neox': 997, 'n_words': 145}