<commit_before>#include <glib.h>
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QDebug>
#include <QList>
#include <QMessageBox>

#include "utils/utils.h"
#include "seafile-applet.h"
#include "ccnet-init.h"
#include "ui/init-seafile-dialog.h"

#if defined(Q_OS_WIN32)
#include "utils/registry.h"
#include <shlobj.h>
#include <shlwapi.h>
#endif

#include "configurator.h"


namespace {

#if defined(Q_OS_WIN32)

const char *kVirtualDriveGUID = "F817C393-A76E-435E-B6B1-485844BC9C2E";
const char *kMyComputerNamespacePath =
    "Software\\Microsoft\\Windows\\CurrentVersion"
    "\\Explorer\\MyComputer\\Namespace";

const char* const kPreconfigureDirectory = "PreconfigureDirectory";
QString getPreconfigureDirectory()
{
    RegElement reg(HKEY_CURRENT_USER, "SOFTWARE\\Seafile", kPreconfigureDirectory, "");
    if (!reg.exists()) {
        return QString();
    }
    reg.read();
    return reg.stringValue();
}
#endif

} // namespace


Configurator::Configurator()
    : ccnet_dir_(defaultCcnetDir()),<commit_msg>Use HKLM for PreconfigureDirectory entry<commit_after>#include <glib.h>
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QDebug>
#include <QList>
#include <QMessageBox>

#include "utils/utils.h"
#include "seafile-applet.h"
#include "ccnet-init.h"
#include "ui/init-seafile-dialog.h"

#if defined(Q_OS_WIN32)
#include "utils/registry.h"
#include <shlobj.h>
#include <shlwapi.h>
#endif

#include "configurator.h"


namespace {

#if defined(Q_OS_WIN32)

const char *kVirtualDriveGUID = "F817C393-A76E-435E-B6B1-485844BC9C2E";
const char *kMyComputerNamespacePath =
    "Software\\Microsoft\\Windows\\CurrentVersion"
    "\\Explorer\\MyComputer\\Namespace";

const char* const kPreconfigureDirectory = "PreconfigureDirectory";
QString getPreconfigureDirectory()
{
    RegElement reg(HKEY_LOCAL_MACHINE, "SOFTWARE\\Seafile", kPreconfigureDirectory, "");
    if (!reg.exists()) {
        return QString();
    }
    reg.read();
    return reg.stringValue();
}
#endif

} // namespace


Configurator::Configurator()
    : ccnet_dir_(defaultCcnetDir()),
{'fraction_non_alphanumeric': 0.145985401459854, 'fraction_numerical': 0.02281021897810219, 'mean_word_length': 5.283667621776504, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '7420890', 'n_tokens_mistral': 827, 'n_tokens_neox': 795, 'n_words': 145}