From a18f36048aa23fb088527c26274e49ce626ddf4d Mon Sep 17 00:00:00 2001 From: Emmanuel BOURGERIE Date: Wed, 27 Apr 2011 14:04:00 +1000 Subject: Fixed QTBUG-11935 Change-Id: Ia7bdb0ceecf2892f6be73d1816764a2bab6275f1 Merge-request: 1010 Reviewed-by: Charles Yin --- src/sql/drivers/mysql/qsql_mysql.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 495b1a6..2a969ee 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1374,12 +1374,16 @@ QStringList QMYSQLDriver::tables(QSql::TableType type) const } else { QSqlQuery q(createResult()); if(type & QSql::Tables) { - q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'BASE TABLE'")); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = ':schema' and table_type = 'BASE TABLE'"); + sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db)); + q.exec(sql); while(q.next()) tl.append(q.value(0).toString()); } if(type & QSql::Views) { - q.exec(QLatin1String("select table_name from information_schema.tables where table_type = 'VIEW'")); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = ':schema' and table_type = 'VIEW'"); + sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db)); + q.exec(sql); while(q.next()) tl.append(q.value(0).toString()); } -- cgit v0.12 From c0ca29efdeb442a6b88ccadff409e3f7ef828ce8 Mon Sep 17 00:00:00 2001 From: Emmanuel BOURGERIE Date: Wed, 27 Apr 2011 14:04:02 +1000 Subject: Fixed QTBUG-11935 : "With MySQL version > 50000 the QMYSQLDriver:: tables() returns tables in all databases on the server" This bugfix has been rewritten to match contributors advise. Change-Id: I3a9cf900ff7eae47c9ffdbcf34bcb1b4396d9837 Merge-request: 1010 Reviewed-by: Charles Yin --- src/sql/drivers/mysql/qsql_mysql.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 2a969ee..441e355 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1374,16 +1374,16 @@ QStringList QMYSQLDriver::tables(QSql::TableType type) const } else { QSqlQuery q(createResult()); if(type & QSql::Tables) { - QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = ':schema' and table_type = 'BASE TABLE'"); - sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db)); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = '") + QLatin1String(d->mysql->db) + QLatin1String("' and table_type = 'BASE TABLE'"); q.exec(sql); + while(q.next()) tl.append(q.value(0).toString()); } if(type & QSql::Views) { - QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = ':schema' and table_type = 'VIEW'"); - sql.replace(QLatin1String(":schema"), QLatin1String(d->mysql->db)); + QString sql = QLatin1String("select table_name from information_schema.tables where table_schema = '") + QLatin1String(d->mysql->db) + QLatin1String("' and table_type = 'VIEW'"); q.exec(sql); + while(q.next()) tl.append(q.value(0).toString()); } -- cgit v0.12 From f6b7ce204ee88be0fedb4cfcff382f208fa4ed33 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 27 Apr 2011 15:53:43 +1000 Subject: Clear the root index when the model is reset. Task-number: QTBUG-18839 Change-Id: I46608d7481d820fa74a9be60df1e018e70a761c6 Merge-request: 2598 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 5 +++++ .../qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 97ce059..4c839a1 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -1398,7 +1398,12 @@ void QDeclarativeVisualDataModel::_q_layoutChanged() void QDeclarativeVisualDataModel::_q_modelReset() { + Q_D(QDeclarativeVisualDataModel); + d->m_root = QModelIndex(); emit modelReset(); + emit rootIndexChanged(); + if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root)) + d->m_abstractItemModel->fetchMore(d->m_root); } void QDeclarativeVisualDataModel::_q_createdPackage(int index, QDeclarativePackage *package) diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index 85d7876..7b384f8 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -190,6 +190,11 @@ void tst_qdeclarativevisualdatamodel::rootIndex() QMetaObject::invokeMethod(obj, "setRootToParent"); QVERIFY(qvariant_cast(obj->rootIndex()) == QModelIndex()); + QMetaObject::invokeMethod(obj, "setRoot"); + QVERIFY(qvariant_cast(obj->rootIndex()) == model.index(0,0)); + model.clear(); // will emit modelReset() + QVERIFY(qvariant_cast(obj->rootIndex()) == QModelIndex()); + delete obj; } -- cgit v0.12 From 597acb83e032869325f97ef71d71bfa8da44cee2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 27 Apr 2011 12:56:58 +0200 Subject: Legal: add the license header to the hand-edits Reviewed-by: Trust Me --- src/3rdparty/phonon/phonon/audiooutputadaptor.cpp | 25 +++++++++++++++++++++++ src/3rdparty/phonon/phonon/audiooutputadaptor_p.h | 25 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/3rdparty/phonon/phonon/audiooutputadaptor.cpp b/src/3rdparty/phonon/phonon/audiooutputadaptor.cpp index 2c01773..959172d 100644 --- a/src/3rdparty/phonon/phonon/audiooutputadaptor.cpp +++ b/src/3rdparty/phonon/phonon/audiooutputadaptor.cpp @@ -1,3 +1,28 @@ +/* This file is part of the KDE project + The following license applies to the edits made to the generated + source code: + + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + Copyright (C) 2009 Matthias Kretz. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), Nokia Corporation + (or its successors, if any) and the KDE Free Qt Foundation, which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see . + +*/ /* * This file was generated by dbusidl2cpp version 0.4 * when processing input file org.kde.Phonon.AudioOutput.xml diff --git a/src/3rdparty/phonon/phonon/audiooutputadaptor_p.h b/src/3rdparty/phonon/phonon/audiooutputadaptor_p.h index 7178e9b..140a74f 100644 --- a/src/3rdparty/phonon/phonon/audiooutputadaptor_p.h +++ b/src/3rdparty/phonon/phonon/audiooutputadaptor_p.h @@ -1,3 +1,28 @@ +/* This file is part of the KDE project + The following license applies to the edits made to the generated + source code: + + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + Copyright (C) 2009 Matthias Kretz. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), Nokia Corporation + (or its successors, if any) and the KDE Free Qt Foundation, which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see . + +*/ /* * This file was generated by dbusidl2cpp version 0.4 * when processing input file org.kde.Phonon.AudioOutput.xml -- cgit v0.12