<commit_before>//
// Copyright Renga Software LLC, 2016. All rights reserved.
//
// Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// Renga Software LLC  DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//

#include "stdafx.h"
#include "ModelExplorerPlugin.h"
#include "PluginToolButtons.h"
#include "RengaEventsHandler.h"
#include "ModelExplorerWidget.h"

#include <RengaAPI/Localization.h>
#include <RengaAPI/Message.h>

static const QString russianLocaleFileName = "modelexplorerplugin_ru.qm";
static const QString englishLocaleFileName = "modelexplorerplugin_en.qm";
static const QString defaultLocaleFileName = englishLocaleFileName;

static const QString c_russianLocale = "ru_RU";
static const QString c_englishLocale = "en_EN";

static const rengabase::String c_loadLocalizationFileError = L"Cannot open localization file.";
static const rengabase::String c_error = L"Error";

ModelExplorerPlugin::ModelExplorerPlugin()
{
//#ifdef _DEBUG
////   NOTE: To debug a plugin you should create a debug QApplication in the plugin, 
////   put the debug Qt dlls (can be found in separate repository) into the plugin folder (Renga installation folder/Plugins/PluginName), 
////   put qwindowsd.dll into the "platform" folder in the plugin folder
////   and set library paths to the application, as shown below
//  
//  QStringList paths = QCoreApplication::libraryPaths();
//  paths.append("your plugin folder path");
//  QCoreApplication::setLibraryPaths(paths);
//  
//  int argc = 0;
//  char** argv = 0;
//  m_pApp.reset(new QApplication(argc, argv));
//#endif
}

ModelExplorerPlugin::~ModelExplorerPlugin()
{}

bool ModelExplorerPlugin::initialize(const wchar_t* pluginPath)
{
	if(!loadTranslator(pluginPath))<commit_msg>- debug QApplication initialized in IPlugin::initialize method implementation<commit_after>//
// Copyright Renga Software LLC, 2016. All rights reserved.
//
// Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// Renga Software LLC  DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//

#include "stdafx.h"
#include "ModelExplorerPlugin.h"
#include "PluginToolButtons.h"
#include "RengaEventsHandler.h"
#include "ModelExplorerWidget.h"

#include <RengaAPI/Localization.h>
#include <RengaAPI/Message.h>

static const QString russianLocaleFileName = "modelexplorerplugin_ru.qm";
static const QString englishLocaleFileName = "modelexplorerplugin_en.qm";
static const QString defaultLocaleFileName = englishLocaleFileName;

static const QString c_russianLocale = "ru_RU";
static const QString c_englishLocale = "en_EN";

static const rengabase::String c_loadLocalizationFileError = L"Cannot open localization file.";
static const rengabase::String c_error = L"Error";

ModelExplorerPlugin::ModelExplorerPlugin()
{}

ModelExplorerPlugin::~ModelExplorerPlugin()
{}

bool ModelExplorerPlugin::initialize(const wchar_t* pluginPath)
{
#ifdef _DEBUG
  //   NOTE: To debug a plugin you should create a debug QApplication in the plugin, 
  //   put the debug Qt dlls (can be found in separate repository) into the plugin folder (Renga installation folder/Plugins/PluginName), 
  //   put qwindowsd.dll into the "platform" folder in the plugin folder
  //   and set library paths to the application, as shown below

  QStringList paths = QCoreApplication::libraryPaths();
  paths.append(QString::fromWCharArray(pluginPath));
  QCoreApplication::setLibraryPaths(paths);

  int argc = 0;
  char** argv = 0;
  m_pApp.reset(new QApplication(argc, argv));
#endif

	if(!loadTranslator(pluginPath))
{'fraction_non_alphanumeric': 0.09944903581267217, 'fraction_numerical': 0.003305785123966942, 'mean_word_length': 5.175170068027211, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2355941', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1084, 'n_words': 343}