<commit_before>#include "ui_addressbookmainwindow.h"
#include <QSettings>
#include <QFileInfo>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>
#include <QKeyEvent>
#include <QSqlTableModel>
#include <QSqlQuery>
#include <QDesktopServices>
#include <QUrl>
#include <QDir>
#include <cstdlib>
#include "addressbookmainwindow.h"
#include "setupdialog.h"
#include "addressdialog.h"
#include "nationalitymodel.h"
#include "basecombomodel.h"

#define QT_VERSION_COMPARISON QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
#if (QT_VERSION_COMPARISON)
#include <QUuid>
#else
#include <QTime>
#endif

namespace
{
	enum Columns
	{
		Id,
	};

	const int TEST_ADDRESSES_COUNT = 8;
	const QString DB_PATH_SETTING_KEY( "DBPath" );
	const QString COUNTRY_TABLE_NAME( "country" );
	const QString ADDRESS_FK_COL_NAME( "addressid" );

	const QStringList FIRST_NAMES( QStringList() << "Matthew" << "Robert" << "Daniel" << "Nicholas" << "Andrey" << "James" << "Christian" << "Noah"
													<< "Lauren" << "Anna" << "Victoria" << "Destiny" << "Mackenzie" << "Nicole" << "Christian" << "Stephanie"  );

	const QStringList LAST_NAMES( QStringList() << "Parks"  << "Lyons" << "Wiggins" << "Norman" << "Wilkerson" << "Harper" << "Gray" << "Clark"
												<< "Campbell"  << "Ray" << "Nelson" << "Powell" << "Murphy" << "Woods" << "Gaines" << "Fleming"  );

	const QStringList ADDRESS_LINE1_TEMPLATES( QStringList() << "Lemoyer Blvd Philadelphia" << "Cardigan St. Arlington" << "Bourg St Irving" << "Freeton Blvd Raleigh"
											   << "Lowel Rd Sunnyvale"  << "Warden ave Algonquin" << "ingston St. Hamilton" << "Third St Orlando" );

	const QStringList ADDRESS_LINE3_TEMPLATES( QStringList() << "Raleigh" << "Aurora" << "Pittsburgh" << "Orlando" << "St. Petersburg" << "Glendale" << "Fremont" << "Tacoma" );

	int randomNumber( const unsigned int maximum )
	{
		unsigned int key = 0;

#if (QT_VERSION_COMPARISON)
		key = qHash( QUuid::createUuid() );
#else
		key = qHash( QTime::currentTime() );
#endif
		srand( static_cast< unsigned int >( key ) );

		return ( rand() % maximum );
	}
<commit_msg>Refactored Qt4 compability code<commit_after>#include "ui_addressbookmainwindow.h"
#include <QSettings>
#include <QFileInfo>
#include <QSqlDatabase>
#include <QSqlError>
#include <QDebug>
#include <QKeyEvent>
#include <QSqlTableModel>
#include <QSqlQuery>
#include <QDesktopServices>
#include <QUrl>
#include <QDir>
#include <cstdlib>
#include "addressbookmainwindow.h"
#include "setupdialog.h"
#include "addressdialog.h"
#include "nationalitymodel.h"
#include "basecombomodel.h"

#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
#define USE_UUID
#include <QUuid>
#else
#include <QTime>
#endif

namespace
{
	enum Columns
	{
		Id,
	};

	const int TEST_ADDRESSES_COUNT = 8;
	const QString DB_PATH_SETTING_KEY( "DBPath" );
	const QString COUNTRY_TABLE_NAME( "country" );
	const QString ADDRESS_FK_COL_NAME( "addressid" );

	const QStringList FIRST_NAMES( QStringList() << "Matthew" << "Robert" << "Daniel" << "Nicholas" << "Andrey" << "James" << "Christian" << "Noah"
													<< "Lauren" << "Anna" << "Victoria" << "Destiny" << "Mackenzie" << "Nicole" << "Christian" << "Stephanie"  );

	const QStringList LAST_NAMES( QStringList() << "Parks"  << "Lyons" << "Wiggins" << "Norman" << "Wilkerson" << "Harper" << "Gray" << "Clark"
												<< "Campbell"  << "Ray" << "Nelson" << "Powell" << "Murphy" << "Woods" << "Gaines" << "Fleming"  );

	const QStringList ADDRESS_LINE1_TEMPLATES( QStringList() << "Lemoyer Blvd Philadelphia" << "Cardigan St. Arlington" << "Bourg St Irving" << "Freeton Blvd Raleigh"
											   << "Lowel Rd Sunnyvale"  << "Warden ave Algonquin" << "ingston St. Hamilton" << "Third St Orlando" );

	const QStringList ADDRESS_LINE3_TEMPLATES( QStringList() << "Raleigh" << "Aurora" << "Pittsburgh" << "Orlando" << "St. Petersburg" << "Glendale" << "Fremont" << "Tacoma" );

	int randomNumber( const unsigned int maximum )
	{
		unsigned int key = 0;

#ifdef USE_UUID
		key = qHash( QUuid::createUuid() );
#undef USE_UUID
#else
		key = qHash( QTime::currentTime() );
#endif
		srand( static_cast< unsigned int >( key ) );

		return ( rand() % maximum );
	}

{'fraction_non_alphanumeric': 0.1716686674669868, 'fraction_numerical': 0.003601440576230492, 'mean_word_length': 5.04644412191582, 'pattern_counts': {'":': 0, '<': 225, '<?xml version=': 0, '>': 35, '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': '4593064', 'n_tokens_mistral': 1692, 'n_tokens_neox': 1512, 'n_words': 362}