zero copy ok for phrases
This commit is contained in:
parent
244778eb50
commit
23bc60e3cd
|
|
@ -190,6 +190,7 @@ bool DatabasePrivate::getCurrectScheema()
|
|||
|
||||
// TODO: change logs must not be in model
|
||||
int changeLogTypeId = qRegisterMetaType<ChangeLogTable*>();
|
||||
|
||||
currentModel.append(
|
||||
new TableModel(changeLogTypeId, __CHANGE_LOG_TABLE_NAME));
|
||||
tables.insert(ChangeLogTable::staticMetaObject.className(),
|
||||
|
|
|
|||
|
|
@ -229,7 +229,13 @@ DatabaseModel *DatabaseModel::modelByName(const QString &name)
|
|||
|
||||
void DatabaseModel::deleteAllModels()
|
||||
{
|
||||
qDeleteAll(_models.values());
|
||||
QMapIterator<QString, DatabaseModel*> i(_models);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
// cout << i.key() << ": " << i.value() << endl;
|
||||
delete i.value();
|
||||
}
|
||||
// qDeleteAll(_models.values());
|
||||
_models.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
17
src/query.h
17
src/query.h
|
|
@ -73,9 +73,6 @@ public:
|
|||
Query<T> *where(const ConditionalPhrase &ph);
|
||||
Query<T> *setWhere(const ConditionalPhrase &ph);
|
||||
|
||||
Query<T> *include(TableSetBase *t);
|
||||
Query<T> *include(Table *t);
|
||||
|
||||
//data selecting
|
||||
T *first();
|
||||
QList<T*> toList(int count = -1);
|
||||
|
|
@ -496,20 +493,6 @@ Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::orderBy(const PhraseList &ph)
|
|||
return this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::include(TableSetBase *t)
|
||||
{
|
||||
Q_D(Query);
|
||||
return this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Q_OUTOFLINE_TEMPLATE Query<T> *Query<T>::include(Table *t)
|
||||
{
|
||||
Q_D(Query);
|
||||
return this;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
Q_OUTOFLINE_TEMPLATE int Query<T>::update(const AssignmentPhraseList &ph)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void MainTest::testDate()
|
|||
|
||||
db.postTable()->append(newPost);
|
||||
|
||||
db.saveChanges();
|
||||
db.saveChanges(true);
|
||||
|
||||
auto q = db.postTable()->query()
|
||||
->setWhere(Post::idField() == newPost->id())
|
||||
|
|
@ -269,4 +269,13 @@ void MainTest::emptyDatabase()
|
|||
QTEST_ASSERT(commentsCount == 6);
|
||||
}
|
||||
|
||||
void MainTest::cleanupTestCase()
|
||||
{
|
||||
post->deleteLater();
|
||||
user->deleteLater();
|
||||
|
||||
qDeleteAll(TableModel::allModels());
|
||||
DatabaseModel::deleteAllModels();
|
||||
}
|
||||
|
||||
QTEST_MAIN(MainTest)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ private slots:
|
|||
void selectWithInvalidRelation();
|
||||
void modifyPost();
|
||||
void emptyDatabase();
|
||||
|
||||
void cleanupTestCase();
|
||||
};
|
||||
|
||||
#endif // MAINTEST_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue