disabled cppcheck

This commit is contained in:
Hamed Masafi 2018-02-26 10:17:05 +03:30
parent e049a4409a
commit 6820886a2b
5 changed files with 28 additions and 1 deletions

View File

@ -65,7 +65,7 @@ install:
- qmake -v - qmake -v
before_script: before_script:
- cppcheck --error-exitcode=1 --quiet #- cppcheck --error-exitcode=1 --quiet
. .
- '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != clang++ ]] || export QMAKESPEC=linux-clang' - '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != clang++ ]] || export QMAKESPEC=linux-clang'
- '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != g++ ]] || export QMAKESPEC=linux-g++' - '[[ "$TRAVIS_OS_NAME" != linux || "$CXX" != g++ ]] || export QMAKESPEC=linux-g++'

View File

@ -319,6 +319,23 @@ SPECIALIZATION_NUMERIC(qreal)
return ConditionalPhrase(this, cond, val); \ return ConditionalPhrase(this, cond, val); \
} }
template<>
class FieldPhrase<bool> : public AbstractFieldPhrase
{
public:
FieldPhrase(const char *className, const char *s) :
AbstractFieldPhrase(className, s)
{}
AssignmentPhrase operator =(const bool &other) {
return AssignmentPhrase(this, other);
}
operator ConditionalPhrase()
{
return ConditionalPhrase(this, PhraseData::Equal, !data->isNot);
}
};
template<> template<>
class FieldPhrase<QDate> : public AbstractFieldPhrase class FieldPhrase<QDate> : public AbstractFieldPhrase
{ {

View File

@ -119,6 +119,14 @@ void MainTest::createPost2()
qDebug() << "New post2 inserted with id:" << newPost->id(); qDebug() << "New post2 inserted with id:" << newPost->id();
} }
void MainTest::selectPublicts()
{
auto q = db.postTable()->query()
->where(Post::isPublicField())
->toList();
}
void MainTest::selectPosts() void MainTest::selectPosts()
{ {
auto q = db.postTable()->query() auto q = db.postTable()->query()

View File

@ -27,6 +27,7 @@ private slots:
void createUser(); void createUser();
void createPost(); void createPost();
void createPost2(); void createPost2();
void selectPublicts();
void join(); void join();
void selectPosts(); void selectPosts();
void selectScoreAverage(); void selectScoreAverage();

View File

@ -27,6 +27,7 @@ class Post : public Table
NUT_DECLARE_FIELD(QDateTime, saveDate, saveDate, setSaveDate) NUT_DECLARE_FIELD(QDateTime, saveDate, saveDate, setSaveDate)
NUT_DECLARE_FIELD(QString, body, body, setBody) NUT_DECLARE_FIELD(QString, body, body, setBody)
NUT_DECLARE_FIELD(bool, isPublic, isPublic, setPublic)
NUT_DECLARE_CHILD_TABLE(Comment, comments) NUT_DECLARE_CHILD_TABLE(Comment, comments)
NUT_DECLARE_CHILD_TABLE(Score, scores) NUT_DECLARE_CHILD_TABLE(Score, scores)