Merged develop into feature

--HG--
branch : feature
This commit is contained in:
Bojan Kverh 2016-07-21 08:30:51 +02:00
commit 4138d30fb6
63 changed files with 1001 additions and 684 deletions

View File

@ -238,7 +238,7 @@ GCC_DEBUG_CXXFLAGS += \
-Wmissing-include-dirs \
-Wpacked \
-Wredundant-decls \
-Winline \
# -Winline \
-Winvalid-pch \
-Wunsafe-loop-optimizations \
-Wlong-long \
@ -427,7 +427,7 @@ CLANG_DEBUG_CXXFLAGS += \
-Winherited-variadic-ctor \
-Winit-self \
-Winitializer-overrides \
-Winline \
# -Winline \
-Wint-conversion \
-Wint-conversions \
-Wint-to-pointer-cast \
@ -641,7 +641,7 @@ ICC_DEBUG_CXXFLAGS += \
-Weffc++ \
-Wextra-tokens \
-Wformat \
#-Winline \
# -Winline \
-Wmain \
-Wmissing-declarations \
-Wmissing-prototypes \

View File

@ -79,25 +79,25 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
Q_UNUSED(context)
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
if ((type == QtDebugMsg) && msg.contains("::connect"))
if ((type == QtDebugMsg) && msg.contains(QStringLiteral("::connect")))
{
type = QtWarningMsg;
}
#if !defined(V_NO_DEBUG)
#if !defined(V_NO_ASSERT)
// I have decided to hide this annoing message for release builds.
if ((type == QtWarningMsg) && msg.contains("setGeometryDp: Unable to set geometry"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("setGeometry: Unable to set geometry")))
{
type = QtDebugMsg;
}
#endif //!defined(V_NO_DEBUG)
#endif //!defined(V_NO_ASSERT)
#if defined(Q_OS_MAC)
# if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
// Try hide very annoying, Qt related, warnings in Mac OS X
// QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)
// https://bugreports.qt.io/browse/QTBUG-42846
if ((type == QtWarningMsg) && msg.contains("QNSView"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QNSView")))
{
type = QtDebugMsg;
}
@ -106,7 +106,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// Hide Qt bug 'Assertion when reading an icns file'
// https://bugreports.qt.io/browse/QTBUG-45537
// Remove after Qt fix will be released
if ((type == QtWarningMsg) && msg.contains("QICNSHandler::read()"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QICNSHandler::read()")))
{
type = QtDebugMsg;
}
@ -115,7 +115,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// this is another one that doesn't make sense as just a debug message. pretty serious
// sign of a problem
// http://www.developer.nokia.com/Community/Wiki/QPainter::begin:Paint_device_returned_engine_%3D%3D_0_(Known_Issue)
if ((type == QtDebugMsg) && msg.contains("QPainter::begin") && msg.contains("Paint device returned engine"))
if ((type == QtDebugMsg) && msg.contains(QStringLiteral("QPainter::begin"))
&& msg.contains(QStringLiteral("Paint device returned engine")))
{
type = QtWarningMsg;
}
@ -123,8 +124,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// This qWarning about "Cowardly refusing to send clipboard message to hung application..."
// is something that can easily happen if you are debugging and the application is paused.
// As it is so common, not worth popping up a dialog.
if ((type == QtWarningMsg) && QString(msg).contains("QClipboard::event")
&& QString(msg).contains("Cowardly refusing"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QClipboard::event"))
&& msg.contains(QStringLiteral("Cowardly refusing")))
{
type = QtDebugMsg;
}

View File

@ -257,46 +257,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast \
-Wmissing-prototypes # rcc folder
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -311,6 +272,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
DEFINES += V_NO_DEBUG
} else {

View File

@ -2002,7 +2002,7 @@ void TMainWindow::ShowHeaderUnits(QTableWidget *table, int column, const QString
SCASSERT(table != nullptr);
QString header = table->horizontalHeaderItem(column)->text();
const int index = header.indexOf(QLatin1Literal("("));
const int index = header.indexOf(QLatin1String("("));
if (index != -1)
{
header.remove(index-1, 100);
@ -2026,7 +2026,7 @@ void TMainWindow::SetCurrentFile(const QString &fileName)
if (curFile.isEmpty())
{
shownName = tr("untitled");
mType == MeasurementsType::Standard ? shownName += QLatin1Literal(".vst") : shownName += QLatin1Literal(".vit");
mType == MeasurementsType::Standard ? shownName += QLatin1String(".vst") : shownName += QLatin1String(".vit");
ui->lineEditPathToFile->setText(tr("<Empty>"));
ui->lineEditPathToFile->setToolTip(tr("File was not saved yet."));
ui->lineEditPathToFile->setCursorPosition(0);
@ -2055,7 +2055,7 @@ void TMainWindow::SetCurrentFile(const QString &fileName)
#if defined(Q_OS_MAC)
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
QLatin1Literal("/../Resources/measurements.icns"));
QLatin1String("/../Resources/measurements.icns"));
QIcon icon;
if (not curFile.isEmpty())
{

54
src/app/tape/warnings.pri Normal file
View File

@ -0,0 +1,54 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast \
-Wmissing-prototypes # rcc folder
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -75,25 +75,25 @@ Q_DECL_CONSTEXPR auto DAYS_TO_KEEP_LOGS = 3;
inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
if ((type == QtDebugMsg) && msg.contains("::connect"))
if ((type == QtDebugMsg) && msg.contains(QStringLiteral("::connect")))
{
type = QtWarningMsg;
}
#if !defined(V_NO_DEBUG)
#if !defined(V_NO_ASSERT)
// I have decided to hide this annoing message for release builds.
if ((type == QtWarningMsg) && msg.contains("setGeometryDp: Unable to set geometry"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("setGeometry: Unable to set geometry")))
{
type = QtDebugMsg;
}
#endif //!defined(V_NO_DEBUG)
#endif //!defined(V_NO_ASSERT)
#if defined(Q_OS_MAC)
# if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) && QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
// Try hide very annoying, Qt related, warnings in Mac OS X
// QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)
// https://bugreports.qt.io/browse/QTBUG-42846
if ((type == QtWarningMsg) && msg.contains("QNSView"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QNSView")))
{
type = QtDebugMsg;
}
@ -102,7 +102,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// Hide Qt bug 'Assertion when reading an icns file'
// https://bugreports.qt.io/browse/QTBUG-45537
// Remove after Qt fix will be released
if ((type == QtWarningMsg) && msg.contains("QICNSHandler::read()"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QICNSHandler::read()")))
{
type = QtDebugMsg;
}
@ -111,7 +111,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// this is another one that doesn't make sense as just a debug message. pretty serious
// sign of a problem
// http://www.developer.nokia.com/Community/Wiki/QPainter::begin:Paint_device_returned_engine_%3D%3D_0_(Known_Issue)
if ((type == QtDebugMsg) && msg.contains("QPainter::begin") && msg.contains("Paint device returned engine"))
if ((type == QtDebugMsg) && msg.contains(QStringLiteral("QPainter::begin"))
&& msg.contains(QStringLiteral("Paint device returned engine")))
{
type = QtWarningMsg;
}
@ -119,8 +120,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
// This qWarning about "Cowardly refusing to send clipboard message to hung application..."
// is something that can easily happen if you are debugging and the application is paused.
// As it is so common, not worth popping up a dialog.
if ((type == QtWarningMsg) && QString(msg).contains("QClipboard::event")
&& QString(msg).contains("Cowardly refusing"))
if ((type == QtWarningMsg) && msg.contains(QStringLiteral("QClipboard::event"))
&& msg.contains(QStringLiteral("Cowardly refusing")))
{
type = QtDebugMsg;
}
@ -132,7 +133,7 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
const bool isGuiThread = instance && (QThread::currentThread() == instance->thread());
{
QString debugdate = "[" + QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss");
QString debugdate = "[" + QDateTime::currentDateTime().toString(QStringLiteral("yyyy.MM.dd hh:mm:ss"));
switch (type)
{

View File

@ -43,11 +43,11 @@
//must be the same order as PaperSizeTemplate constants
const DialogLayoutSettings::FormatsVector DialogLayoutSettings::pageFormatNames =
DialogLayoutSettings::FormatsVector () << QLatin1Literal("A0")
<< QLatin1Literal("A1")
<< QLatin1Literal("A2")
<< QLatin1Literal("A3")
<< QLatin1Literal("A4")
DialogLayoutSettings::FormatsVector () << QLatin1String("A0")
<< QLatin1String("A1")
<< QLatin1String("A2")
<< QLatin1String("A3")
<< QLatin1String("A4")
<< QApplication::translate("DialogLayoutSettings", "Letter")
<< QApplication::translate("DialogLayoutSettings", "Legal")
<< QApplication::translate("DialogLayoutSettings", "Roll 24in")

View File

@ -67,7 +67,7 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget *
ui->lineEditFileName->setValidator( new QRegExpValidator(QRegExp(baseFilenameRegExp), this));
#endif
const QString mask = fileName+QLatin1Literal("_");
const QString mask = fileName+QLatin1String("_");
if (VApplication::IsGUIMode())
{
ui->lineEditFileName->setText(mask);
@ -299,15 +299,15 @@ bool DialogSaveLayout::TestPdf()
QVector<std::pair<QString, QString>> DialogSaveLayout::InitAvailFormats()
{
QVector<std::pair<QString, QString>> list;
list.append(std::make_pair(tr("Svg files (*.svg)"), QLatin1Literal(".svg")));
list.append(std::make_pair(tr("PDF files (*.pdf)"), QLatin1Literal(".pdf")));
list.append(std::make_pair(tr("Images (*.png)"), QLatin1Literal(".png")));
list.append(std::make_pair(tr("Wavefront OBJ (*.obj)"), QLatin1Literal(".obj")));
list.append(std::make_pair(tr("Svg files (*.svg)"), QLatin1String(".svg")));
list.append(std::make_pair(tr("PDF files (*.pdf)"), QLatin1String(".pdf")));
list.append(std::make_pair(tr("Images (*.png)"), QLatin1String(".png")));
list.append(std::make_pair(tr("Wavefront OBJ (*.obj)"), QLatin1String(".obj")));
if (SupportPSTest())
{
list.append(std::make_pair(tr("PS files (*.ps)"), QLatin1Literal(".ps")));
list.append(std::make_pair(tr("EPS files (*.eps)"), QLatin1Literal(".eps")));
list.append(std::make_pair(tr("PS files (*.ps)"), QLatin1String(".ps")));
list.append(std::make_pair(tr("EPS files (*.eps)"), QLatin1String(".eps")));
}
list.append(std::make_pair(tr("DXF files (*.dxf)"), QLatin1Literal(".dxf")));
list.append(std::make_pair(tr("DXF files (*.dxf)"), QLatin1String(".dxf")));
return list;
}

View File

@ -3020,7 +3020,7 @@ bool MainWindow::SavePattern(const QString &fileName, QString &error)
const bool result = doc->SaveDocument(fileName, error);
if (result)
{
if (tempInfo.suffix() != QLatin1Literal("autosave"))
if (tempInfo.suffix() != QLatin1String("autosave"))
{
setCurrentFile(fileName);
helpLabel->setText(tr("File saved"));
@ -4419,7 +4419,7 @@ QString MainWindow::GetPatternFileName()
{
shownName = StrippedName(curFile);
}
shownName += QLatin1Literal("[*]");
shownName += QLatin1String("[*]");
return shownName;
}
@ -4437,10 +4437,10 @@ QString MainWindow::GetMeasurementFileName()
if(mChanges)
{
shownName += QLatin1Literal("*");
shownName += QLatin1String("*");
}
shownName += QLatin1Literal("]");
shownName += QLatin1String("]");
return shownName;
}
}
@ -4460,7 +4460,7 @@ void MainWindow::UpdateWindowTitle()
#if defined(Q_OS_MAC)
static QIcon fileIcon = QIcon(QApplication::applicationDirPath() +
QLatin1Literal("/../Resources/Valentina.icns"));
QLatin1String("/../Resources/Valentina.icns"));
QIcon icon;
if (not curFile.isEmpty())
{

View File

@ -979,7 +979,7 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &pr
#ifdef Q_OS_WIN
printer->setOutputFileName(outputFileName);
#else
printer->setOutputFileName(outputFileName + QLatin1Literal(".pdf"));
printer->setOutputFileName(outputFileName + QLatin1String(".pdf"));
#endif
#ifdef Q_OS_MAC

View File

@ -67,52 +67,10 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS+= \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
}
}
@ -128,6 +86,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
DEFINES += V_NO_DEBUG
} else {

View File

@ -0,0 +1,57 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS+= \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
-isystem "$${OUT_PWD}/../../libs/vtools/$${UI_DIR}" \ # For VTools UI files
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -355,7 +355,7 @@ bool VPattern::SaveDocument(const QString &fileName, QString &error) const
}
const bool saved = VAbstractPattern::SaveDocument(fileName, error);
if (saved && QFileInfo(fileName).suffix() != QLatin1Literal("autosave"))
if (saved && QFileInfo(fileName).suffix() != QLatin1String("autosave"))
{
modified = false;
}

View File

@ -48,37 +48,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -93,6 +63,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -339,13 +339,13 @@ bool FvUpdater::xmlParseFeed()
if (m_xml.isStartElement())
{
if (m_xml.name() == QLatin1Literal("item"))
if (m_xml.name() == QLatin1String("item"))
{
xmlEnclosureUrl.clear();
xmlEnclosureVersion.clear();
xmlEnclosurePlatform.clear();
}
else if (m_xml.name() == QLatin1Literal("enclosure"))
else if (m_xml.name() == QLatin1String("enclosure"))
{
const QXmlStreamAttributes attribs = m_xml.attributes();
const QString fervorPlatform = QStringLiteral("fervor:platform");
@ -381,7 +381,7 @@ bool FvUpdater::xmlParseFeed()
}
else if (m_xml.isEndElement())
{
if (m_xml.name() == QLatin1Literal("item"))
if (m_xml.name() == QLatin1String("item"))
{
// That's it - we have analyzed a single <item> and we'll stop
// here (because the topmost is the most recent one, and thus

View File

@ -0,0 +1,45 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -56,43 +56,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -107,6 +71,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

51
src/libs/ifc/warnings.pri Normal file
View File

@ -0,0 +1,51 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -57,7 +57,7 @@ void VAbstractConverter::Convert()
}
QString error;
const QString backupFileName = fileName + QLatin1Literal(".backup");
const QString backupFileName = fileName + QLatin1String(".backup");
if (SafeCopy(fileName, backupFileName, error) == false)
{
const QString errorMsg(tr("Error creating a backup file: %1.").arg(error));

View File

@ -164,7 +164,7 @@ QStringList VAbstractPattern::ListMeasurements() const
const QList<QString> tValues = tokens.values();
for (int j = 0; j < tValues.size(); ++j)
{
if (tValues.at(j) == QLatin1Literal("-"))
if (tValues.at(j) == QLatin1String("-"))
{
continue;
}
@ -1232,11 +1232,11 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag)
element = createElement(TagGradation);
QDomElement heights = createElement(TagHeights);
heights.setAttribute(AttrAll, QLatin1Literal("true"));
heights.setAttribute(AttrAll, QLatin1String("true"));
element.appendChild(heights);
QDomElement sizes = createElement(TagSizes);
sizes.setAttribute(AttrAll, QLatin1Literal("true"));
sizes.setAttribute(AttrAll, QLatin1String("true"));
element.appendChild(sizes);
break;
}

View File

@ -771,7 +771,7 @@ bool VDomDocument::SafeCopy(const QString &source, const QString &destination, Q
qt_ntfs_permission_lookup++; // turn checking on
#endif /*Q_OS_WIN32*/
QTemporaryFile destFile(destination + QLatin1Literal(".XXXXXX"));
QTemporaryFile destFile(destination + QLatin1String(".XXXXXX"));
destFile.setAutoRemove(false);
if (not destFile.open())
{

View File

@ -139,9 +139,7 @@ template <typename T>
*/
inline void VDomDocument::SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
{
QString val = QString().setNum(value);
val = val.replace(",", ".");
domElement.setAttribute(name, val);
domElement.setAttribute(name, QString().setNum(value).replace(QLatin1String(","), QLatin1String(".")));
}
//---------------------------------------------------------------------------------------------------------------------
@ -156,16 +154,7 @@ inline void VDomDocument::SetAttribute<QString>(QDomElement &domElement, const Q
template <>
inline void VDomDocument::SetAttribute<bool>(QDomElement &domElement, const QString &name, const bool &value) const
{
QString string;
if (value)
{
string = "true";
}
else
{
string = "false";
}
domElement.setAttribute(name, string);
domElement.setAttribute(name, value ? QStringLiteral("true") : QStringLiteral("false"));
}
//---------------------------------------------------------------------------------------------------------------------
@ -173,14 +162,8 @@ template <>
inline void VDomDocument::SetAttribute<MeasurementsType>(QDomElement &domElement, const QString &name,
const MeasurementsType &value) const
{
if (value == MeasurementsType::Standard)
{
domElement.setAttribute(name, "standard");
}
else
{
domElement.setAttribute(name, "individual");
}
domElement.setAttribute(name, value == MeasurementsType::Standard ? QStringLiteral("standard") :
QStringLiteral("individual"));
}
#ifdef Q_CC_GNU

View File

@ -181,7 +181,7 @@ void VPatternConverter::ApplyPatches()
catch (VException &e)
{
QString error;
const QString backupFileName = fileName + QLatin1Literal(".backup");
const QString backupFileName = fileName + QLatin1String(".backup");
if (SafeCopy(backupFileName, fileName, error) == false)
{
const QString errorMsg(tr("Error restoring backup file: %1.").arg(error));
@ -896,7 +896,7 @@ void VPatternConverter::ParseModelingToV0_2_4(const QDomElement &modeling)
QDomElement node = modeling.firstChild().toElement();
while (not node.isNull())
{
if (node.tagName() == QLatin1Literal("tools"))
if (node.tagName() == QLatin1String("tools"))
{
const quint32 toolId = node.attribute(QStringLiteral("id")).toUInt();
QVector<quint32> children;

View File

@ -110,7 +110,7 @@ void VVITConverter::ApplyPatches()
catch (VException &e)
{
QString error;
const QString backupFileName = fileName + QLatin1Literal(".backup");
const QString backupFileName = fileName + QLatin1String(".backup");
if (SafeCopy(backupFileName, fileName, error) == false)
{
const QString errorMsg(tr("Error restoring backup file: %1.").arg(error));

View File

@ -104,7 +104,7 @@ void VVSTConverter::ApplyPatches()
catch (VException &e)
{
QString error;
const QString backupFileName = fileName + QLatin1Literal(".backup");
const QString backupFileName = fileName + QLatin1String(".backup");
if (SafeCopy(backupFileName, fileName, error) == false)
{
const QString errorMsg(tr("Error restoring backup file: %1.").arg(error));

View File

@ -65,34 +65,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -107,6 +80,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noStripDebugSymbols {
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -43,34 +43,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -85,6 +58,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -49,34 +49,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -91,6 +64,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -45,34 +45,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -87,6 +60,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -48,48 +48,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in the global list. Compromise decision is to delete them from the local list.
QMAKE_CXXFLAGS -= \
-Wlong-long \
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast \
-Wmissing-prototypes # rcc folder
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -104,6 +63,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
QMAKE_CXXFLAGS -= -O2 # Disable default optimization level
QMAKE_CXXFLAGS += -O3 # For vlayout library enable speed optimizations

View File

@ -0,0 +1,56 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in the global list. Compromise decision is to delete them from the local list.
QMAKE_CXXFLAGS -= \
-Wlong-long \
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast \
-Wmissing-prototypes # rcc folder
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -44,13 +44,13 @@ QString compilerString()
#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them
QString iccCompact;
#ifdef __INTEL_CLANG_COMPILER
iccCompact = QLatin1Literal("Clang");
iccCompact = QLatin1String("Clang");
#elif defined(__INTEL_MS_COMPAT_LEVEL)
iccCompact = QLatin1Literal("Microsoft");
iccCompact = QLatin1String("Microsoft");
#elif defined(__GNUC__)
iccCompact = QLatin1Literal("GCC");
iccCompact = QLatin1String("GCC");
#else
iccCompact = QLatin1Literal("no");
iccCompact = QLatin1String("no");
#endif
QString iccVersion;
if (__INTEL_COMPILER >= 1300)

View File

@ -79,6 +79,12 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv)
// Connect this slot with VApplication::aboutToQuit.
Settings()->sync();
});
#if !defined(V_NO_ASSERT)
// Ignore SSL-related warnings
// See issue #528: Error: QSslSocket: cannot resolve SSLv2_client_method.
qputenv("QT_LOGGING_RULES", "qt.network.ssl.warning=false");
#endif //!defined(V_NO_ASSERT)
}
//---------------------------------------------------------------------------------------------------------------------
@ -102,12 +108,12 @@ QString VAbstractApplication::translationsPath(const QString &locale) const
QString mainPath;
if (locale.isEmpty())
{
mainPath = QApplication::applicationDirPath() + QLatin1Literal("/../Resources") + trPath;
mainPath = QApplication::applicationDirPath() + QLatin1String("/../Resources") + trPath;
}
else
{
mainPath = QApplication::applicationDirPath() + QLatin1Literal("/../Resources") + trPath + QLatin1Literal("/")
+ locale + QLatin1Literal(".lproj");
mainPath = QApplication::applicationDirPath() + QLatin1String("/../Resources") + trPath + QLatin1String("/")
+ locale + QLatin1String(".lproj");
}
QDir dirBundle(mainPath);
if (dirBundle.exists())

View File

@ -156,10 +156,10 @@ bool VLockGuard<Guarded>::TryLock(const QString &lockName, int stale, int timeou
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
lockFile = lockName + QLatin1Literal(".lock");
lockFile = lockName + QLatin1String(".lock");
#if defined(Q_OS_UNIX)
QFileInfo info(lockFile);
lockFile = info.absolutePath() + QLatin1Literal("/.") + info.fileName();
lockFile = info.absolutePath() + QLatin1String("/.") + info.fileName();
#endif
lock.reset(new QLockFile(lockFile));

View File

@ -51,39 +51,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -102,12 +70,13 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
DEFINES += V_NO_DEBUG
# do nothing
} else {
noCrashReports{
DEFINES += V_NO_DEBUG
}
!macx:!win32-msvc*{
# Turn on debug symbols in release mode on Unix systems.
# On Mac OS X temporarily disabled. TODO: find way how to strip binary file.

View File

@ -0,0 +1,47 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -498,6 +498,10 @@ qreal estimate(int elen, qreal *e)
return Q;
}
#if defined(Q_CC_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
qreal incircleadapt(qreal *pa, qreal *pb, qreal *pc, qreal *pd, qreal permanent)
{
INEXACT qreal adx, bdx, cdx, ady, bdy, cdy;
@ -1031,6 +1035,9 @@ qreal incircleadapt(qreal *pa, qreal *pb, qreal *pc, qreal *pd, qreal permanent)
return finnow[finlength - 1];
}
#if defined(Q_CC_GNU)
#pragma GCC diagnostic pop
#endif
qreal incircle(qreal *pa, qreal *pb, qreal *pc, qreal *pd)
{

View File

@ -43,34 +43,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -85,6 +58,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -46,34 +46,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -88,6 +61,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -63,45 +63,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
# Key -isystem disable checking errors in system headers.
$$GCC_DEBUG_CXXFLAGS \ # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wswitch-default
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
@ -116,6 +78,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
!macx:!win32-msvc*{
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing

View File

@ -0,0 +1,52 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
# Key -isystem disable checking errors in system headers.
$$GCC_DEBUG_CXXFLAGS \ # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wswitch-default
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -179,7 +179,7 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type)
line->RefreshGeometry();
if (buildMidpoint)
{
SetFormula(currentLength + QLatin1Literal("/2"));
SetFormula(currentLength + QLatin1String("/2"));
}
prepare = true;
this->setModal(true);

View File

@ -640,7 +640,7 @@ bool DialogDetail::DetailIsValid() const
QByteArray byteArray;
QBuffer buffer(&byteArray);
pixmap.save(&buffer, "PNG");
QString url = QString("<img src=\"data:image/png;base64,") + byteArray.toBase64() + QLatin1Literal("\"/> ");
QString url = QString("<img src=\"data:image/png;base64,") + byteArray.toBase64() + QLatin1String("\"/> ");
if(CreateDetail().ContourPoints(data).count() < 3)
{

View File

@ -934,6 +934,6 @@ void DialogSplinePath::ShowPointIssue(const QString &pName)
}
else
{
item->setText(pName + QLatin1Literal("(!)"));
item->setText(pName + QLatin1String("(!)"));
}
}

View File

@ -53,42 +53,7 @@ INCLUDEPATH += $$PWD/../vpatterndb
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
# -isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -103,6 +68,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,50 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
# -isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -45,39 +45,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -92,6 +60,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,47 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wundefined-reinterpret-cast
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -51,34 +51,7 @@ $$enable_ccache()
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes
}
*-icc-*{
QMAKE_CXXFLAGS += \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -90,6 +63,10 @@ CONFIG(debug, debug|release){
!win32-msvc*:CONFIG += silent
DEFINES += QT_NO_DEBUG_OUTPUT
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -0,0 +1,42 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
# -isystem key works only for headers. In some cases it's not enough. But we can't delete this warnings and
# want them in global list. Compromise decision delete them from local list.
QMAKE_CXXFLAGS -= \
-Wmissing-prototypes
}
*-icc-*{
QMAKE_CXXFLAGS += \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}

View File

@ -92,41 +92,7 @@ DEFINES += TS_DIR=\\\"$${PWD}/../../../share/translations\\\"
CONFIG(debug, debug|release){
# Debug mode
unix {
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details.
-Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
}
include(warnings.pri)
} else {
*-g++{
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
@ -140,6 +106,10 @@ CONFIG(debug, debug|release){
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
}
checkWarnings{
unix:include(warnings.pri)
}
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
# do nothing
} else {

View File

@ -55,7 +55,7 @@ QString AbstractTest::ValentinaPath() const
{
const QString path = QStringLiteral("/../../../app/valentina/bin/valentina");
#ifdef Q_OS_WIN
return QApplication::applicationDirPath() + path + QLatin1Literal(".exe");
return QApplication::applicationDirPath() + path + QLatin1String(".exe");
#else
return QApplication::applicationDirPath() + path;
#endif
@ -66,7 +66,7 @@ QString AbstractTest::TapePath() const
{
const QString path = QStringLiteral("/../../../app/tape/bin/tape");
#ifdef Q_OS_WIN
return QApplication::applicationDirPath() + path + QLatin1Literal(".exe");
return QApplication::applicationDirPath() + path + QLatin1String(".exe");
#else
return QApplication::applicationDirPath() + path;
#endif

View File

@ -431,7 +431,7 @@ int TST_MeasurementRegExp::LoadMeasurements(const QString &checkedSystem, const
const QString path = TranslationsPath();
const QString file = QString("measurements_%1_%2.qm").arg(checkedSystem).arg(checkedLocale);
if (QFileInfo(path+QLatin1Literal("/")+file).size() <= 34)
if (QFileInfo(path+QLatin1String("/")+file).size() <= 34)
{
const QString message = QString("Translation for system = %1 and locale = %2 is empty. \nFull path: %3/%4")
.arg(checkedSystem)
@ -482,7 +482,7 @@ int TST_MeasurementRegExp::LoadVariables(const QString &checkedLocale)
const QString path = TranslationsPath();
const QString file = QString("valentina_%1.qm").arg(checkedLocale);
if (QFileInfo(path+QLatin1Literal("/")+file).size() <= 34)
if (QFileInfo(path+QLatin1String("/")+file).size() <= 34)
{
const QString message = QString("Translation variables for locale = %1 is empty. \nFull path: %2/%3")
.arg(checkedLocale)
@ -660,7 +660,7 @@ void TST_MeasurementRegExp::CheckUnderlineExists() const
while (i != data.constEnd())
{
const QString translated = trMs->InternalVarToUser(i.key());
if ((translated.right(1) == QLatin1Literal("_")) != i.value())
if ((translated.right(1) == QLatin1String("_")) != i.value())
{
const QString message = QString("String '%1' doesn't contain underline. Original string is '%2'")
.arg(translated).arg(i.key());
@ -676,11 +676,11 @@ void TST_MeasurementRegExp::CheckInternalVaribleRegExp() const
const QString regex = QStringLiteral("(.){1,}_(.){1,}$");
foreach(const QString &var, builInVariables)
{
const QString sourceRegex = QLatin1Literal("^") + var + regex;
const QString sourceRegex = QLatin1String("^") + var + regex;
const QRegularExpression sourceRe(sourceRegex);
const QString translated = trMs->InternalVarToUser(var);
const QString translationRegex = QLatin1Literal("^") + translated + regex;
const QString translationRegex = QLatin1String("^") + translated + regex;
const QRegularExpression translationRe(translationRegex);
const QStringList originalNames = AllGroupNames() + builInFunctions + builInVariables;

View File

@ -212,6 +212,6 @@ void TST_QmuParserErrorMsg::CheckStrings(int code, bool tok, bool pos)
const QString translated = (*msg)[code];
const QString message = QString("String: '%1'.").arg(translated);
QVERIFY2((translated.indexOf(QLatin1Literal("$TOK$")) != -1) == tok, qUtf8Printable(message));
QVERIFY2((translated.indexOf(QLatin1Literal("$POS$")) != -1) == pos, qUtf8Printable(message));
QVERIFY2((translated.indexOf(QLatin1String("$TOK$")) != -1) == tok, qUtf8Printable(message));
QVERIFY2((translated.indexOf(QLatin1String("$POS$")) != -1) == pos, qUtf8Printable(message));
}

View File

@ -116,7 +116,7 @@ void TST_TSTranslation::CheckEmptyToolButton()
continue;
}
if (source == QLatin1Literal("..."))
if (source == QLatin1String("..."))
{
const QDomElement translationTag = message.firstChildElement(TagTranslation);
if (translationTag.hasAttribute(AttrType))
@ -210,7 +210,7 @@ void TST_TSTranslation::CheckPlaceMarkerExist()
for (int i = 1; i <= 99; ++i)
{
const QString marker = QLatin1Literal("%") + QString().setNum(i);
const QString marker = QLatin1String("%") + QString().setNum(i);
const bool sourceMark = source.indexOf(marker) != -1;
if (sourceMark)
{
@ -218,8 +218,8 @@ void TST_TSTranslation::CheckPlaceMarkerExist()
if (sourceMarkCount != i)
{
const QString message = QString("In source string '%1' was missed place marker ")
.arg(source) + QLatin1Literal("'%") + QString().setNum(sourceMarkCount) +
QLatin1Literal("'.");
.arg(source) + QLatin1String("'%") + QString().setNum(sourceMarkCount) +
QLatin1String("'.");
QFAIL(qUtf8Printable(message));
}
}
@ -231,8 +231,8 @@ void TST_TSTranslation::CheckPlaceMarkerExist()
if (translationMarkCount != i)
{
const QString message = QString("In translation string '%1' was missed place marker ")
.arg(translation) + QLatin1Literal("'%") + QString().setNum(translationMarkCount) +
QLatin1Literal("'.");
.arg(translation) + QLatin1String("'%") + QString().setNum(translationMarkCount) +
QLatin1String("'.");
QFAIL(qUtf8Printable(message));
}
}
@ -241,8 +241,8 @@ void TST_TSTranslation::CheckPlaceMarkerExist()
{
const QString message =
QString("Compare to source string in the translation string '%1' was missed place marker ")
.arg(translation) + QLatin1Literal("'%") + QString().setNum(sourceMarkCount) +
QLatin1Literal("'.");
.arg(translation) + QLatin1String("'%") + QString().setNum(sourceMarkCount) +
QLatin1String("'.");
QFAIL(qUtf8Printable(message));
}
}

View File

@ -51,7 +51,7 @@ void TST_ValentinaCommandLine::init()
}
if (not CopyRecursively(QApplication::applicationDirPath() + QDir::separator() +
QLatin1Literal("tst_valentina"),
QLatin1String("tst_valentina"),
QApplication::applicationDirPath() + QDir::separator() + tmpTestFolder))
{
QFAIL("Fail to prepare test files for testing.");
@ -66,7 +66,7 @@ void TST_ValentinaCommandLine::init()
}
if (not CopyRecursively(QApplication::applicationDirPath() + QDir::separator() +
QLatin1Literal("tst_valentina_collection"),
QLatin1String("tst_valentina_collection"),
QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder))
{
QFAIL("Fail to prepare collection files for testing.");
@ -199,25 +199,25 @@ void TST_ValentinaCommandLine::TestMode_data() const
QTest::newRow("Issue #256. Correct individual measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1Literal("issue_256_correct.vit"))
QLatin1String("issue_256_correct.vit"))
<< true
<< V_EX_OK;
QTest::newRow("Issue #256. Wrong individual measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1Literal("issue_256_wrong.vit"))
QLatin1String("issue_256_wrong.vit"))
<< false
<< V_EX_NOINPUT;
QTest::newRow("Issue #256. Correct standard measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1Literal("issue_256_correct.vst"))
QLatin1String("issue_256_correct.vst"))
<< true
<< V_EX_OK;
QTest::newRow("Issue #256. Wrong standard measurements.")<< "issue_256.val"
<< QString("--test;;-m;;%1").arg(tmp + QDir::separator() +
QLatin1Literal("issue_256_wrong.vst"))
QLatin1String("issue_256_wrong.vst"))
<< false
<< V_EX_NOINPUT;
@ -254,7 +254,7 @@ void TST_ValentinaCommandLine::TestOpenCollection_data() const
QTest::addColumn<int>("exitCode");
const QString tmp = QApplication::applicationDirPath() + QDir::separator() + tmpTestCollectionFolder;
const QString testGOST = QString("--test;;-m;;%1").arg(tmp + QDir::separator() + QLatin1Literal("GOST_man_ru.vst"));
const QString testGOST = QString("--test;;-m;;%1").arg(tmp + QDir::separator() + QLatin1String("GOST_man_ru.vst"));
const QString keyTest = QStringLiteral("--test");
QTest::newRow("bra") << "bra.val" << keyTest << true << V_EX_OK;

View File

@ -0,0 +1,49 @@
#Turn on compilers warnings.
*-g++{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
# do nothing
} else {
#gccs 4.8.0 Address Sanitizer
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
QMAKE_LFLAGS += -fsanitize=address
}
}
clang*{
QMAKE_CXXFLAGS += \
# Key -isystem disable checking errors in system headers.
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$CLANG_DEBUG_CXXFLAGS \ # See common.pri for more details.
-Wno-gnu-zero-variadic-macro-arguments\ # See macros QSKIP
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}
*-icc-*{
QMAKE_CXXFLAGS += \
-isystem "$${OUT_PWD}/$${UI_DIR}" \
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
$$ICC_DEBUG_CXXFLAGS
checkWarnings{ # For enable run qmake with CONFIG+=checkWarnings
QMAKE_CXXFLAGS += -Werror
}
}