mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
clean: delete stub_msvc.h
This commit is contained in:
parent
112874b0e3
commit
8f6ef372be
|
@ -4,9 +4,6 @@
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <string>
|
#include <string>
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
|
|
||||||
|
@ -31,10 +28,9 @@ std::string c_string( const QString & str )
|
||||||
return std::string( str.toUtf8().constData() );
|
return std::string( str.toUtf8().constData() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool endsWithIgnoreCase( const string & str1, string str2 )
|
bool endsWithIgnoreCase( QByteArrayView str, QByteArrayView extension )
|
||||||
{
|
{
|
||||||
return ( str1.size() >= (unsigned)str2.size() )
|
return ( str.size() >= extension.size() ) && str.last( extension.size() ).compare( extension, Qt::CaseInsensitive );
|
||||||
&& ( strcasecmp( str1.c_str() + ( str1.size() - str2.size() ), str2.data() ) == 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString escapeAmps( QString const & str )
|
QString escapeAmps( QString const & str )
|
||||||
|
|
|
@ -40,7 +40,7 @@ inline QString rstrip( const QString & str )
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string c_string( const QString & str );
|
std::string c_string( const QString & str );
|
||||||
bool endsWithIgnoreCase( const string & str1, string str2 );
|
bool endsWithIgnoreCase( QByteArrayView str, QByteArrayView extension );
|
||||||
/**
|
/**
|
||||||
* remove punctuation , space, symbol
|
* remove punctuation , space, symbol
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,9 +16,6 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QSemaphore>
|
#include <QSemaphore>
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QAtomicInt>
|
#include <QAtomicInt>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
|
@ -23,10 +23,6 @@
|
||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace DictdFiles {
|
namespace DictdFiles {
|
||||||
|
|
||||||
using std::map;
|
using std::map;
|
||||||
|
|
|
@ -27,10 +27,6 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QSemaphore>
|
#include <QSemaphore>
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
#include <QAtomicInt>
|
#include <QAtomicInt>
|
||||||
|
@ -1741,7 +1737,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
|
||||||
|
|
||||||
int extSize = ( uncompressedDsl ? 4 : 7 );
|
int extSize = ( uncompressedDsl ? 4 : 7 );
|
||||||
if ( fileName.size() - extSize >= 5
|
if ( fileName.size() - extSize >= 5
|
||||||
&& strncasecmp( fileName.c_str() + fileName.size() - extSize - 5, "_abrv", 5 ) == 0 ) {
|
&& qstrnicmp( fileName.c_str() + fileName.size() - extSize - 5, "_abrv", 5 ) == 0 ) {
|
||||||
// It is, skip it
|
// It is, skip it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,12 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtCore5Compat/QTextCodec>
|
#include <QtCore5Compat/QTextCodec>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
// POSIX symbol unavailable on Windows needed for eb headers
|
||||||
#include <stub_msvc.h>
|
#ifdef Q_OS_WIN
|
||||||
|
#ifndef _SSIZE_T
|
||||||
|
#define _SSIZE_T
|
||||||
|
#define ssize_t long
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <eb/eb.h>
|
#include <eb/eb.h>
|
||||||
|
|
|
@ -39,9 +39,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Gls {
|
namespace Gls {
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,6 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define OV_EXCLUDE_STATIC_CALLBACKS
|
#define OV_EXCLUDE_STATIC_CALLBACKS
|
||||||
#include <vorbis/vorbisfile.h>
|
#include <vorbis/vorbisfile.h>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
|
@ -23,9 +23,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <list>
|
#include <list>
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "globalregex.hh"
|
#include "globalregex.hh"
|
||||||
#include "tiff.hh"
|
#include "tiff.hh"
|
||||||
|
|
|
@ -19,12 +19,6 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "utils.hh"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Sdict {
|
namespace Sdict {
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,6 @@
|
||||||
#include "tiff.hh"
|
#include "tiff.hh"
|
||||||
#include "utils.hh"
|
#include "utils.hh"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "iconv.hh"
|
#include "iconv.hh"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
|
@ -30,9 +30,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QSemaphore>
|
#include <QSemaphore>
|
||||||
|
|
|
@ -27,9 +27,6 @@
|
||||||
#include "tiff.hh"
|
#include "tiff.hh"
|
||||||
#include "ftshelpers.hh"
|
#include "ftshelpers.hh"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
|
|
|
@ -17,10 +17,6 @@
|
||||||
#include "ftshelpers.hh"
|
#include "ftshelpers.hh"
|
||||||
#include "htmlescape.hh"
|
#include "htmlescape.hh"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
|
@ -19,9 +19,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "utils.hh"
|
#include "utils.hh"
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include <stub_msvc.h>
|
|
||||||
#endif
|
|
||||||
// Language codes
|
// Language codes
|
||||||
|
|
||||||
QMap< QString, GDLangCode > LangCoder::LANG_CODE_MAP = {
|
QMap< QString, GDLangCode > LangCoder::LANG_CODE_MAP = {
|
||||||
|
@ -231,10 +228,10 @@ QString LangCoder::intToCode2( quint32 val )
|
||||||
|
|
||||||
quint32 LangCoder::findIdForLanguage( gd::wstring const & lang )
|
quint32 LangCoder::findIdForLanguage( gd::wstring const & lang )
|
||||||
{
|
{
|
||||||
const auto langFolded = Utf8::encode( lang );
|
const auto langFolded = QByteArrayView( Utf8::encode( lang ) );
|
||||||
|
|
||||||
for ( auto const & lc : LANG_CODE_MAP ) {
|
for ( auto const & lc : LANG_CODE_MAP ) {
|
||||||
if ( strcasecmp( langFolded.c_str(), lc.lang.c_str() ) == 0 ) {
|
if ( langFolded.compare( lc.lang, Qt::CaseInsensitive ) ) {
|
||||||
return code2toInt( lc.code2.toStdString().c_str() );
|
return code2toInt( lc.code2.toStdString().c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#if !defined(strcasecmp)
|
|
||||||
# define strcasecmp _strcmpi
|
|
||||||
#endif
|
|
||||||
#if !defined(strncasecmp)
|
|
||||||
# define strncasecmp _strnicmp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _SSIZE_T
|
|
||||||
#define _SSIZE_T
|
|
||||||
#define ssize_t long
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in a new issue