mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
remove Q_COMPILER_INITIALIZER_LISTS flag to eliminate macro-redefinition warnings
This commit is contained in:
parent
443ee772a7
commit
cc1faba5d2
@ -134,10 +134,6 @@ macx {
|
|||||||
INCLUDEPATH += /usr/local/include
|
INCLUDEPATH += /usr/local/include
|
||||||
}
|
}
|
||||||
|
|
||||||
windows {
|
|
||||||
DEFINES *= Q_COMPILER_INITIALIZER_LISTS
|
|
||||||
}
|
|
||||||
|
|
||||||
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../hoedown/release/ -lhoedown
|
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../hoedown/release/ -lhoedown
|
||||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../hoedown/debug/ -lhoedown
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../hoedown/debug/ -lhoedown
|
||||||
else:unix: LIBS += -L$$OUT_PWD/../hoedown/ -lhoedown
|
else:unix: LIBS += -L$$OUT_PWD/../hoedown/ -lhoedown
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
extern VConfigManager vconfig;
|
extern VConfigManager vconfig;
|
||||||
|
|
||||||
const QVector<QPair<QString, QString>> VUtils::c_availableLanguages = {QPair<QString, QString>("en_US", "Englisth(US)"),
|
QVector<QPair<QString, QString>> VUtils::s_availableLanguages;
|
||||||
QPair<QString, QString>("zh_CN", "Chinese")};
|
|
||||||
|
|
||||||
const QString VUtils::c_imageLinkRegExp = QString("\\!\\[([^\\]]*)\\]\\(([^\\)\"]+)\\s*(\"(\\\\.|[^\"\\)])*\")?\\s*\\)");
|
const QString VUtils::c_imageLinkRegExp = QString("\\!\\[([^\\]]*)\\]\\(([^\\)\"]+)\\s*(\"(\\\\.|[^\"\\)])*\")?\\s*\\)");
|
||||||
|
|
||||||
@ -37,6 +36,16 @@ VUtils::VUtils()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VUtils::initAvailableLanguage()
|
||||||
|
{
|
||||||
|
if (!s_availableLanguages.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_availableLanguages.append(QPair<QString, QString>("en_US", "English (US)"));
|
||||||
|
s_availableLanguages.append(QPair<QString, QString>("zh_CN", "Chinese"));
|
||||||
|
}
|
||||||
|
|
||||||
QString VUtils::readFileFromDisk(const QString &filePath)
|
QString VUtils::readFileFromDisk(const QString &filePath)
|
||||||
{
|
{
|
||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
@ -370,16 +379,21 @@ QString VUtils::generateCopiedDirName(const QString &p_parentDirPath, const QStr
|
|||||||
|
|
||||||
const QVector<QPair<QString, QString>>& VUtils::getAvailableLanguages()
|
const QVector<QPair<QString, QString>>& VUtils::getAvailableLanguages()
|
||||||
{
|
{
|
||||||
return c_availableLanguages;
|
if (s_availableLanguages.isEmpty()) {
|
||||||
|
initAvailableLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
return s_availableLanguages;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VUtils::isValidLanguage(const QString &p_lang)
|
bool VUtils::isValidLanguage(const QString &p_lang)
|
||||||
{
|
{
|
||||||
for (auto const &lang : c_availableLanguages) {
|
for (auto const &lang : getAvailableLanguages()) {
|
||||||
if (lang.first == p_lang) {
|
if (lang.first == p_lang) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,8 +114,10 @@ public:
|
|||||||
static const QString c_fencedCodeBlockEndRegExp;
|
static const QString c_fencedCodeBlockEndRegExp;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static void initAvailableLanguage();
|
||||||
|
|
||||||
// <value, name>
|
// <value, name>
|
||||||
static const QVector<QPair<QString, QString>> c_availableLanguages;
|
static QVector<QPair<QString, QString>> s_availableLanguages;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString VUtils::directoryNameFromPath(const QString &p_path)
|
inline QString VUtils::directoryNameFromPath(const QString &p_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user