<commit_before>/*
 * This file is part of the KDE project.
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 * Copyright (C) 2008 <NAME> <uwolfer @ kde.org>
 * Copyright (C) 2009 <NAME> <adawit @ kde.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 */

#include "kwebpluginfactory.h"
#include "kwebpage.h"
#include "kwebview.h"

#include <kmimetypetrader.h>
#include <kservicetypetrader.h>
#include <QDebug>

#include <kio/job.h>
#include <kparts/part.h>

#include <QtCore/QListIterator>
#include <QtCore/QStringList>
#include <QtCore/QList>
#include <qmimedatabase.h>

#include <QWebPluginFactory>
#include <QWebFrame>
#include <QWebView>

#define QL1S(x)  QLatin1String(x)
#define QL1C(x)  QLatin1Char(x)

KWebPluginFactory::KWebPluginFactory(QObject *parent)
    : QWebPluginFactory(parent), d(0)
{
}

KWebPluginFactory::~KWebPluginFactory()
{
}

QObject *KWebPluginFactory::create(const QString &_mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const
{
    QString mimeType(_mimeType.trimmed());
    // If no mimetype is provided, we do our best to correctly determine it here...
    if (mimeType.isEmpty()) {
        // qDebug() << "Looking up missing mimetype for plugin resource:" << url;
        extractGuessedMimeType(url, &mimeType);<commit_msg>Adapt KParts includes to latest one-header-per-class change<commit_after>/*
 * This file is part of the KDE project.
 *
 * Copyright (C) 2008 <NAME> <<EMAIL>>
 * Copyright (C) 2008 <NAME> <uwolfer @ kde.org>
 * Copyright (C) 2009 <NAME> <adawit @ kde.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 */

#include "kwebpluginfactory.h"
#include "kwebpage.h"
#include "kwebview.h"

#include <kmimetypetrader.h>
#include <kservicetypetrader.h>
#include <QDebug>

#include <kio/job.h>
#include <kparts/readonlypart.h>
#include <kparts/openurlarguments.h>

#include <QtCore/QListIterator>
#include <QtCore/QStringList>
#include <QtCore/QList>
#include <qmimedatabase.h>

#include <QWebPluginFactory>
#include <QWebFrame>
#include <QWebView>

#define QL1S(x)  QLatin1String(x)
#define QL1C(x)  QLatin1Char(x)

KWebPluginFactory::KWebPluginFactory(QObject *parent)
    : QWebPluginFactory(parent), d(0)
{
}

KWebPluginFactory::~KWebPluginFactory()
{
}

QObject *KWebPluginFactory::create(const QString &_mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const
{
    QString mimeType(_mimeType.trimmed());
    // If no mimetype is provided, we do our best to correctly determine it here...
    if (mimeType.isEmpty()) {
        // qDebug() << "Looking up missing mimetype for plugin resource:" << url;
        extractGuessedMimeType(url, &mimeType);
{'fraction_non_alphanumeric': 0.1045027690825909, 'fraction_numerical': 0.01396580784974717, 'mean_word_length': 4.553475935828877, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 42, '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': '5143069', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1290, 'n_words': 467}