mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
Merge pull request #1740 from shenlebantongying/clean/qvector-gone
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled
clean: replace QVector & QPair in headers
This commit is contained in:
commit
ea4f45ad55
|
@ -8,3 +8,4 @@ b5349478cfb0dc2dd0de8c8e8aeebdd24cf7ac6b
|
|||
|
||||
# replace QVector & QPair
|
||||
3273f39dd73f4dba07fa95be2be74061f2690b2c
|
||||
44853544f850e1de90b341780168c04d089c37a1
|
||||
|
|
|
@ -105,9 +105,9 @@ class ArticleRequest: public Dictionary::DataRequest
|
|||
typedef QList< QString > Spacings;
|
||||
|
||||
/// Splits the given string into words and spacings between them.
|
||||
QPair< Words, Spacings > splitIntoWords( QString const & );
|
||||
std::pair< Words, Spacings > splitIntoWords( QString const & );
|
||||
|
||||
QPair< Words, Spacings > splittedWords;
|
||||
std::pair< Words, Spacings > splittedWords;
|
||||
int currentSplittedWordStart;
|
||||
int currentSplittedWordEnd;
|
||||
QString currentSplittedWordCompound;
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
#define __ARTICLE_NETMGR_HH_INCLUDED__
|
||||
|
||||
#include <QtNetwork>
|
||||
|
||||
#include <QSet>
|
||||
#include <QMap>
|
||||
#include <QPair>
|
||||
#include <QWebEngineUrlSchemeHandler>
|
||||
#include <QWebEngineUrlRequestJob>
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "dict/dictionary.hh"
|
||||
#include "article_maker.hh"
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <QFuture>
|
||||
#include <QList>
|
||||
#include <QSet>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
|
||||
/// A base for the dictionary which creates a btree index to look up
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
void getAllHeadwords( QSet< QString > & headwords );
|
||||
|
||||
/// Find all article links and/or headwords in the index
|
||||
void findArticleLinks( QVector< WordArticleLink > * articleLinks,
|
||||
void findArticleLinks( QList< WordArticleLink > * articleLinks,
|
||||
QSet< uint32_t > * offsets,
|
||||
QSet< QString > * headwords,
|
||||
QAtomicInt * isCancelled = 0 );
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
|
||||
/// Retrieve headwords for presented article addresses
|
||||
void
|
||||
getHeadwordsFromOffsets( QList< uint32_t > & offsets, QVector< QString > & headwords, QAtomicInt * isCancelled = 0 );
|
||||
getHeadwordsFromOffsets( QList< uint32_t > & offsets, QList< QString > & headwords, QAtomicInt * isCancelled = 0 );
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ inline void removeQueryItem( QUrl & url, QString const & key )
|
|||
url.setQuery( urlQuery );
|
||||
}
|
||||
|
||||
inline void setQueryItems( QUrl & url, QList< QPair< QString, QString > > const & query )
|
||||
inline void setQueryItems( QUrl & url, QList< std::pair< QString, QString > > const & query )
|
||||
{
|
||||
QUrlQuery urlQuery( url );
|
||||
urlQuery.setQueryItems( query );
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#define __CONFIG_HH_INCLUDED__
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
#include <QDateTime>
|
||||
|
@ -47,7 +47,7 @@ struct Path
|
|||
};
|
||||
|
||||
/// A list of paths where to search for the dictionaries
|
||||
typedef QVector< Path > Paths;
|
||||
typedef QList< Path > Paths;
|
||||
|
||||
/// A directory holding bunches of audiofiles, which is indexed into a separate
|
||||
/// dictionary.
|
||||
|
@ -72,7 +72,7 @@ struct SoundDir
|
|||
};
|
||||
|
||||
/// A list of SoundDirs
|
||||
typedef QVector< SoundDir > SoundDirs;
|
||||
typedef QList< SoundDir > SoundDirs;
|
||||
|
||||
struct DictionaryRef
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ struct Group
|
|||
QByteArray iconData;
|
||||
QKeySequence shortcut;
|
||||
QString favoritesFolder;
|
||||
QVector< DictionaryRef > dictionaries;
|
||||
QList< DictionaryRef > dictionaries;
|
||||
Config::MutedDictionaries mutedDictionaries; // Disabled via dictionary bar
|
||||
Config::MutedDictionaries popupMutedDictionaries; // Disabled via dictionary bar in popup
|
||||
|
||||
|
@ -125,7 +125,7 @@ struct Group
|
|||
};
|
||||
|
||||
/// All the groups
|
||||
struct Groups: public QVector< Group >
|
||||
struct Groups: public QList< Group >
|
||||
{
|
||||
unsigned nextId; // Id to use to create the group next time
|
||||
|
||||
|
@ -498,7 +498,7 @@ struct WebSite
|
|||
};
|
||||
|
||||
/// All the WebSites
|
||||
typedef QVector< WebSite > WebSites;
|
||||
typedef QList< WebSite > WebSites;
|
||||
|
||||
/// Any DICT server
|
||||
struct DictServer
|
||||
|
@ -539,14 +539,14 @@ struct DictServer
|
|||
};
|
||||
|
||||
/// All the DictServers
|
||||
typedef QVector< DictServer > DictServers;
|
||||
typedef QList< DictServer > DictServers;
|
||||
|
||||
/// Hunspell configuration
|
||||
struct Hunspell
|
||||
{
|
||||
QString dictionariesPath;
|
||||
|
||||
typedef QVector< QString > Dictionaries;
|
||||
typedef QList< QString > Dictionaries;
|
||||
|
||||
Dictionaries enabledDictionaries;
|
||||
|
||||
|
@ -562,7 +562,7 @@ struct Hunspell
|
|||
};
|
||||
|
||||
/// All the MediaWikis
|
||||
typedef QVector< MediaWiki > MediaWikis;
|
||||
typedef QList< MediaWiki > MediaWikis;
|
||||
|
||||
|
||||
/// Chinese transliteration configuration
|
||||
|
@ -755,7 +755,7 @@ struct Program
|
|||
}
|
||||
};
|
||||
|
||||
typedef QVector< Program > Programs;
|
||||
typedef QList< Program > Programs;
|
||||
|
||||
#ifndef NO_TTS_SUPPORT
|
||||
struct VoiceEngine
|
||||
|
@ -801,7 +801,7 @@ struct VoiceEngine
|
|||
}
|
||||
};
|
||||
|
||||
typedef QVector< VoiceEngine > VoiceEngines;
|
||||
typedef QList< VoiceEngine > VoiceEngines;
|
||||
#endif
|
||||
|
||||
struct HeadwordsDialog
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <QMap>
|
||||
#include <QStack>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <string>
|
||||
|
@ -58,7 +58,7 @@ struct EpwingHeadword
|
|||
|
||||
class EpwingBook
|
||||
{
|
||||
typedef QPair< int, int > EWPos;
|
||||
typedef std::pair< int, int > EWPos;
|
||||
|
||||
void setErrorString( QString const & func, EB_Error_Code code );
|
||||
|
||||
|
@ -79,10 +79,10 @@ class EpwingBook
|
|||
int monoWidth, monoHeight;
|
||||
QStringList imageCacheList, soundsCacheList, moviesCacheList, fontsCacheList;
|
||||
QMap< QString, QString > baseFontsMap, customFontsMap;
|
||||
QVector< int > refPages, refOffsets;
|
||||
QList< int > refPages, refOffsets;
|
||||
QMap< uint64_t, bool > allHeadwordPositions;
|
||||
QMap< uint64_t, bool > allRefPositions;
|
||||
QVector< EWPos > LinksQueue;
|
||||
QList< EWPos > LinksQueue;
|
||||
int refOpenCount, refCloseCount;
|
||||
static QMutex libMutex;
|
||||
QList< EpwingHeadword > candidateItems;
|
||||
|
@ -242,9 +242,9 @@ public:
|
|||
|
||||
QByteArray handleReference( EB_Hook_Code code, const unsigned int * argv );
|
||||
|
||||
bool getMatches( QString word, QVector< QString > & matches );
|
||||
bool getMatches( QString word, QList< QString > & matches );
|
||||
|
||||
bool getArticlePos( QString word, QVector< int > & pages, QVector< int > & offsets );
|
||||
bool getArticlePos( QString word, QList< int > & pages, QList< int > & offsets );
|
||||
QString repairSubBookDirectory( QString subBookDir );
|
||||
};
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ public:
|
|||
static quint32 findIdForLanguageCode3( std::string const & );
|
||||
|
||||
/// find id pairs like en-zh in dictioanry name
|
||||
static QPair< quint32, quint32 > findLangIdPairFromName( QString const & );
|
||||
static QPair< quint32, quint32 > findLangIdPairFromPath( std::string const & );
|
||||
static std::pair< quint32, quint32 > findLangIdPairFromName( QString const & );
|
||||
static std::pair< quint32, quint32 > findLangIdPairFromPath( std::string const & );
|
||||
|
||||
static quint32 guessId( const QString & lang );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __SPLITFILE_HH_INCLUDED__
|
||||
|
||||
#include <QFile>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
@ -19,8 +19,8 @@ class SplitFile
|
|||
{
|
||||
protected:
|
||||
|
||||
QVector< QFile * > files;
|
||||
QVector< quint64 > offsets;
|
||||
QList< QFile * > files;
|
||||
QList< quint64 > offsets;
|
||||
int currentFile;
|
||||
|
||||
void appendFile( const QString & name );
|
||||
|
|
Loading…
Reference in a new issue