Skip to content

Commit c9b2dc2

Browse files
author
Qt Continuous Integration System
committed
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Backport more imports directory caching changes. Fix more test DEPLOYMENT statements for Symbian Fix deployment for declarative tests, examples on Symbian Fix StrictlyEnforceRange with snapOneItem/Row and header behavior, pt 2 Backport imports directory caching performance optimization
2 parents ea99fab + 3f42986 commit c9b2dc2

File tree

79 files changed

+304
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+304
-145
lines changed

examples/declarative/cppextensions/imageprovider/imageprovider.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ symbian:{
2424

2525
importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
2626
importFiles.path = ImageProviderCore
27-
DEPLOYMENT = importFiles
27+
DEPLOYMENT += importFiles
2828
}

examples/declarative/cppextensions/qwidgets/qwidgets.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ symbian:{
2020
importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
2121
importFiles.path = QWidgets
2222

23-
DEPLOYMENT = importFiles
23+
DEPLOYMENT += importFiles
2424
}

src/declarative/graphicsitems/qdeclarativegridview.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,17 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
10811081
tempPosition -= bias;
10821082
}
10831083
FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
1084+
if (!topItem && strictHighlightRange && currentItem) {
1085+
// StrictlyEnforceRange always keeps an item in range
1086+
updateHighlight();
1087+
topItem = currentItem;
1088+
}
10841089
FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
1090+
if (!bottomItem && strictHighlightRange && currentItem) {
1091+
// StrictlyEnforceRange always keeps an item in range
1092+
updateHighlight();
1093+
bottomItem = currentItem;
1094+
}
10851095
qreal pos;
10861096
if (topItem && bottomItem && strictHighlightRange) {
10871097
qreal topPos = qMin(topItem->rowPos() - highlightStart, -maxExtent);

src/declarative/graphicsitems/qdeclarativelistview.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,10 +1324,20 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
13241324
tempPosition -= bias;
13251325
}
13261326
FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
1327+
if (!topItem && strictHighlightRange && currentItem) {
1328+
// StrictlyEnforceRange always keeps an item in range
1329+
updateHighlight();
1330+
topItem = currentItem;
1331+
}
13271332
FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
1333+
if (!bottomItem && strictHighlightRange && currentItem) {
1334+
// StrictlyEnforceRange always keeps an item in range
1335+
updateHighlight();
1336+
bottomItem = currentItem;
1337+
}
13281338
qreal pos;
13291339
bool isInBounds = -position() > maxExtent && -position() <= minExtent;
1330-
if (topItem && isInBounds) {
1340+
if (topItem && (isInBounds || strictHighlightRange)) {
13311341
if (topItem->index == 0 && header && tempPosition+highlightStart < header->position()+header->size()/2 && !strictHighlightRange) {
13321342
pos = isRightToLeft() ? - header->position() + highlightStart - size() : header->position() - highlightStart;
13331343
} else {

src/declarative/qml/qdeclarativedirparser.cpp

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141

4242
#include "private/qdeclarativedirparser_p.h"
4343
#include "qdeclarativeerror.h"
44+
#include <private/qdeclarativeglobal_p.h>
4445

4546
#include <QtCore/QTextStream>
47+
#include <QtCore/QFile>
4648
#include <QtCore/QtDebug>
4749

4850
QT_BEGIN_NAMESPACE
@@ -66,6 +68,16 @@ void QDeclarativeDirParser::setUrl(const QUrl &url)
6668
_url = url;
6769
}
6870

71+
QString QDeclarativeDirParser::fileSource() const
72+
{
73+
return _filePathSouce;
74+
}
75+
76+
void QDeclarativeDirParser::setFileSource(const QString &filePath)
77+
{
78+
_filePathSouce = filePath;
79+
}
80+
6981
QString QDeclarativeDirParser::source() const
7082
{
7183
return _source;
@@ -92,6 +104,23 @@ bool QDeclarativeDirParser::parse()
92104
_plugins.clear();
93105
_components.clear();
94106

107+
if (_source.isEmpty() && !_filePathSouce.isEmpty()) {
108+
QFile file(_filePathSouce);
109+
if (!QDeclarative_isFileCaseCorrect(_filePathSouce)) {
110+
QDeclarativeError error;
111+
error.setDescription(QString::fromUtf8("cannot load module \"$$URI$$\": File name case mismatch for \"%1\"").arg(_filePathSouce));
112+
_errors.prepend(error);
113+
return false;
114+
} else if (file.open(QFile::ReadOnly)) {
115+
_source = QString::fromUtf8(file.readAll());
116+
} else {
117+
QDeclarativeError error;
118+
error.setDescription(QString::fromUtf8("module \"$$URI$$\" definition \"%1\" not readable").arg(_filePathSouce));
119+
_errors.prepend(error);
120+
return false;
121+
}
122+
}
123+
95124
QTextStream stream(&_source);
96125
int lineNumber = 0;
97126

@@ -214,9 +243,16 @@ bool QDeclarativeDirParser::hasError() const
214243
return false;
215244
}
216245

217-
QList<QDeclarativeError> QDeclarativeDirParser::errors() const
246+
QList<QDeclarativeError> QDeclarativeDirParser::errors(const QString &uri) const
218247
{
219-
return _errors;
248+
QList<QDeclarativeError> errors = _errors;
249+
for (int i = 0; i < errors.size(); ++i) {
250+
QDeclarativeError &e = errors[i];
251+
QString description = e.description();
252+
description.replace(QLatin1String("$$URI$$"), uri);
253+
e.setDescription(description);
254+
}
255+
return errors;
220256
}
221257

222258
QList<QDeclarativeDirParser::Plugin> QDeclarativeDirParser::plugins() const

src/declarative/qml/qdeclarativedirparser_p.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ class QDeclarativeDirParser
7373
QString source() const;
7474
void setSource(const QString &source);
7575

76+
QString fileSource() const;
77+
void setFileSource(const QString &filePath);
78+
7679
bool isParsed() const;
7780
bool parse();
7881

7982
bool hasError() const;
80-
QList<QDeclarativeError> errors() const;
83+
QList<QDeclarativeError> errors(const QString &uri) const;
8184

8285
struct Plugin
8386
{
@@ -116,6 +119,7 @@ class QDeclarativeDirParser
116119
QList<QDeclarativeError> _errors;
117120
QUrl _url;
118121
QString _source;
122+
QString _filePathSouce;
119123
QList<Component> _components;
120124
QList<Plugin> _plugins;
121125
unsigned _isParsed: 1;

0 commit comments

Comments
 (0)