summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-09-30 13:01:05 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-09-30 13:01:05 (GMT)
commitc3ef2d3a6d9a6e35b05cbd8f370630d5dd85415e (patch)
treeb11aaa1acca5ffe30cbfe2ce42a00d3597fa6c45
parentaf1e344ac6046640ddb728f6017b3181469c241d (diff)
parent1a902e6dba504b4a25a218555bb326772b5b77a6 (diff)
downloadQt-c3ef2d3a6d9a6e35b05cbd8f370630d5dd85415e.zip
Qt-c3ef2d3a6d9a6e35b05cbd8f370630d5dd85415e.tar.gz
Qt-c3ef2d3a6d9a6e35b05cbd8f370630d5dd85415e.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
-rw-r--r--doc/src/qt4-intro.qdoc17
-rw-r--r--examples/webkit/googlechat/main.cpp15
-rw-r--r--src/gui/dialogs/qfiledialog.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/script/script.pro3
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp15
-rw-r--r--src/sql/drivers/tds/qsql_tds.h2
-rw-r--r--tests/auto/qdom/tst_qdom.cpp3
-rw-r--r--tests/auto/qfiledialog/tst_qfiledialog.cpp29
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp2
-rw-r--r--tools/qdoc3/htmlgenerator.cpp132
-rw-r--r--tools/qdoc3/htmlgenerator.h8
-rw-r--r--tools/qdoc3/node.cpp17
-rw-r--r--tools/qdoc3/node.h9
14 files changed, 212 insertions, 46 deletions
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 03d9b29..eafae14 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -605,21 +605,12 @@
functions to query audio devices for which audio formats they
support.
- \section1 Classes and Functions Introduced in 4.6
+ \section1 Classes, functions, and other items introduced in 4.6
- Links to class, function, and macro documentation.
+ Links to classes, function, and other items that were added in
+ 4.6.
- \section2 Classes
-
- Classes introduced in Qt 4.6.
-
- \sincelist classes
-
- \section2 Functions & Macros
-
- Fuctions and macros introduced in Qt 4.6.
-
- \sincelist functions
+ \sincelist 4.6
*/
diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp
index fd08114..9e235a9 100644
--- a/examples/webkit/googlechat/main.cpp
+++ b/examples/webkit/googlechat/main.cpp
@@ -43,10 +43,25 @@
#include <QNetworkProxyFactory>
#include "googlechat.h"
+#ifndef QT_NO_OPENSSL
+#include <QSslSocket>
+#endif
+
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
+#ifndef QT_NO_OPENSSL
+ if (!QSslSocket::supportsSsl()) {
+#endif
+ QMessageBox::information(0, "Google Talk client",
+ "Your system does not support SSL, "
+ "which is required to run this example.");
+ return -1;
+#ifndef QT_NO_OPENSSL
+ }
+#endif
+
QNetworkProxyFactory::setUseSystemConfigurationEnabled(true);
GoogleChat *chat = new GoogleChat;
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 14f19f2..297c900 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -317,6 +317,7 @@ QFileDialog::QFileDialog(QWidget *parent, Qt::WindowFlags f)
{
Q_D(QFileDialog);
d->init();
+ d->lineEdit()->selectAll();
}
/*!
@@ -334,6 +335,7 @@ QFileDialog::QFileDialog(QWidget *parent,
{
Q_D(QFileDialog);
d->init(directory, filter, caption);
+ d->lineEdit()->selectAll();
}
/*!
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index aec757f..b44ef7f 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -571,7 +571,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Mac},
{QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QApplicationPrivate::KB_All},
- {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win},
+ {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_S60},
{QKeySequence::Redo, 0, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Mac},//different priority from above
{QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QApplicationPrivate::KB_All},
{QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, QApplicationPrivate::KB_Mac},
@@ -600,7 +600,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Win},
{QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QApplicationPrivate::KB_KDE},
{QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac},
- {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
+ {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60},
{QKeySequence::Redo, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Mac}, //different priority from above
{QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Mac },//different priority from above
diff --git a/src/script/script.pro b/src/script/script.pro
index 6c6b701..659aa26 100644
--- a/src/script/script.pro
+++ b/src/script/script.pro
@@ -62,6 +62,9 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1
DEFINES += NDEBUG
+# Avoid JSC C API functions being exported.
+DEFINES += JS_EXPORT="" JS_EXPORTDATA=""
+
INCLUDEPATH += $$PWD
include(script.pri)
diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp
index 46508a0..2508833 100644
--- a/src/sql/drivers/tds/qsql_tds.cpp
+++ b/src/sql/drivers/tds/qsql_tds.cpp
@@ -754,7 +754,9 @@ QString QTDSDriver::formatValue(const QSqlField &field,
r = QLatin1String("NULL");
else if (field.type() == QVariant::DateTime) {
if (field.value().toDateTime().isValid()){
- r = field.value().toDateTime().toString(QLatin1String("'yyyyMMdd hh:mm:ss'"));
+ r = field.value().toDateTime().toString(QLatin1String("yyyyMMdd hh:mm:ss"));
+ r.prepend(QLatin1String("'"));
+ r.append(QLatin1String("'"));
} else
r = QLatin1String("NULL");
} else if (field.type() == QVariant::ByteArray) {
@@ -805,4 +807,15 @@ QSqlIndex QTDSDriver::primaryIndex(const QString& tablename) const
return idx;
}
+QString QTDSDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const
+{
+ QString res = identifier;
+ if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) {
+ res.replace(QLatin1Char('"'), QLatin1String("\"\""));
+ res.prepend(QLatin1Char('"')).append(QLatin1Char('"'));
+ res.replace(QLatin1Char('.'), QLatin1String("\".\""));
+ }
+ return res;
+}
+
QT_END_NAMESPACE
diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h
index 6001106..0ceae6d 100644
--- a/src/sql/drivers/tds/qsql_tds.h
+++ b/src/sql/drivers/tds/qsql_tds.h
@@ -116,6 +116,8 @@ public:
bool trimStrings) const;
QVariant handle() const;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const;
+
protected:
bool beginTransaction();
bool commitTransaction();
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index 6637202..6987186 100644
--- a/tests/auto/qdom/tst_qdom.cpp
+++ b/tests/auto/qdom/tst_qdom.cpp
@@ -1908,7 +1908,8 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co
QDomDocument d;
QVERIFY(d.setContent(xmlWithUnknownEncoding));
- QString dontAssert = d.toString(); // this should not assert
+ //QString dontAssert = d.toString(); // this should not assert
+ QVERIFY2(false, "Line above crashes but we still want to run all tests.");
QVERIFY(true);
}
diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp
index 1aa5ee1..f6b082f 100644
--- a/tests/auto/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp
@@ -169,6 +169,8 @@ private slots:
void task257579_sideBarWithNonCleanUrls();
void task259105_filtersCornerCases();
+ void QTBUG4419_lineEditSelectAll();
+
private:
QByteArray userSettings;
};
@@ -2153,5 +2155,32 @@ void tst_QFiledialog::task259105_filtersCornerCases()
filters->setCurrentIndex(1);
QCOMPARE(filters->currentText(), QLatin1String("Text Files"));
}
+
+void tst_QFiledialog::QTBUG4419_lineEditSelectAll()
+{
+ QString tempPath = QDir::tempPath();
+ QTemporaryFile *t;
+ t = new QTemporaryFile;
+ t->open();
+ QNonNativeFileDialog fd(0, "TestFileDialog", t->fileName());
+
+ fd.setDirectory(tempPath);
+ fd.setViewMode(QFileDialog::List);
+ fd.setAcceptMode(QFileDialog::AcceptSave);
+ fd.setFileMode(QFileDialog::AnyFile);
+
+ fd.show();
+ QApplication::setActiveWindow(&fd);
+ QTest::qWaitForWindowShown(&fd);
+ QTRY_COMPARE(fd.isVisible(), true);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+
+ QTest::qWait(250);
+ QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
+
+ QCOMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName());
+ QCOMPARE(tempPath + QChar('/') + lineEdit->selectedText(), t->fileName());
+}
+
QTEST_MAIN(tst_QFiledialog)
#include "tst_qfiledialog.moc"
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index 499fb0b..d9cab02 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -59,6 +59,8 @@
#include <windows.h>
#endif
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 5406017..2757cd8 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -330,7 +330,65 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
#ifdef ZZZ_QDOC_QML
findAllQmlClasses(tree->root());
#endif
- findAllSince(tree->root(),tree->version());
+ findAllSince(tree->root());
+
+#if 0
+ if (!sinceVersions.isEmpty()) {
+ SinceVersionMap::const_iterator v = sinceVersions.constEnd();
+ do {
+ --v;
+ qDebug() << "SINCE:" << v.key();
+ if (!v.value().isEmpty()) {
+ QString type;
+ SinceNodeMultiMap::const_iterator n = v.value().constBegin();
+ while (n != v.value().constEnd()) {
+ switch (n.value()->type()) {
+ case Node::Namespace:
+ type = "namespace";
+ break;
+ case Node::Class:
+ type = "class";
+ break;
+ case Node::Fake:
+ type = "fake";
+ break;
+ case Node::Enum:
+ type = "enum";
+ break;
+ case Node::Typedef:
+ type = "typedef";
+ break;
+ case Node::Function:
+ type = "function";
+ break;
+ case Node::Property:
+ type = "property";
+ break;
+ case Node::Variable:
+ type = "variable";
+ break;
+ case Node::Target:
+ type = "target";
+ break;
+ case Node::QmlProperty:
+ type = "QML property";
+ break;
+ case Node::QmlSignal:
+ type = "QML signal";
+ break;
+ case Node::QmlMethod:
+ type = "QML method";
+ break;
+ default:
+ type = "No type";
+ }
+ qDebug() << " " << type << n.key();
+ ++n;
+ }
+ }
+ } while (v != sinceVersions.constBegin());
+ }
+#endif
PageGenerator::generateTree(tree, marker);
@@ -655,21 +713,32 @@ int HtmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::SinceList:
{
- QList<Node*> values;
- if (atom->string() == "classes") {
- values = sinceClasses.values();
- }
- else if (atom->string() == "functions") {
- values = sinceFunctions.values();
- }
- if (!values.isEmpty()) {
- QMap<QString, const Node*> nodeMap;
- for (int i=0; i<values.size(); ++i) {
- const Node* n = values.at(i);
- nodeMap.insert(n->nameForLists(),n);
+ QList<Node*> nodes;
+ SinceVersionMap::const_iterator v;
+ v = sinceVersions.find(atom->string());
+ if ((v != sinceVersions.constEnd()) && !v.value().isEmpty()) {
+ for (int i=0; !Node::typeName(i).isEmpty(); i++) {
+ Node::Type t = (Node::Type) i;
+ SinceNodeMultiMap::const_iterator n=v.value().constBegin();
+ QMultiMap<QString, const Node*> nodeMap;
+ while (n != v.value().constEnd()) {
+ const Node* node = n.value();
+ if (node->type() == t)
+ nodeMap.insert(node->nameForLists(),node);
+ ++n;
+ }
+ if (!nodeMap.isEmpty()) {
+ out() << "<h2>"
+ << Node::typeName(i)
+ << " new in Qt "
+ << atom->string()
+ << "<h2>";
+ generateAnnotatedList(relative, marker, nodeMap);
+ nodeMap.clear();
+ }
}
- generateAnnotatedList(relative, marker, nodeMap);
}
+
}
break;
case Atom::Image:
@@ -3517,22 +3586,21 @@ void HtmlGenerator::findAllClasses(const InnerNode *node)
/*!
For generating the "Since x.y" page.
*/
-void HtmlGenerator::findAllSince(const InnerNode *node, QString version)
+void HtmlGenerator::findAllSince(const InnerNode *node)
{
- const QRegExp versionSeparator("[\\-\\.]");
- const int minorIndex = version.indexOf(versionSeparator);
- const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
- version = version.left(patchIndex);
-
NodeList::const_iterator c = node->childNodes().constBegin();
while (c != node->childNodes().constEnd()) {
- if (((*c)->access() != Node::Private) && ((*c)->since() == version)) {
+ QString sinceVersion = (*c)->since();
+ if (((*c)->access() != Node::Private) && !sinceVersion.isEmpty()) {
+ SinceVersionMap::iterator vmap = sinceVersions.find(sinceVersion);
+ if (vmap == sinceVersions.end())
+ vmap = sinceVersions.insert(sinceVersion,SinceNodeMultiMap());
if ((*c)->type() == Node::Function) {
FunctionNode *func = static_cast<FunctionNode *>(*c);
if ((func->status() > Node::Obsolete) &&
(func->metaness() != FunctionNode::Ctor) &&
(func->metaness() != FunctionNode::Dtor)) {
- sinceFunctions.insert(func->name(), func);
+ vmap.value().insert(func->name(),(*c));
}
}
else if ((*c)->url().isEmpty()) {
@@ -3542,17 +3610,33 @@ void HtmlGenerator::findAllSince(const InnerNode *node, QString version)
(*c)->parent()->type() == Node::Namespace &&
!(*c)->parent()->name().isEmpty())
className = (*c)->parent()->name()+"::"+className;
- sinceClasses.insert(className, *c);
+ vmap.value().insert(className,(*c));
}
}
+ else {
+ QString name = (*c)->name();
+ if ((*c)->parent() &&
+ (*c)->parent()->type() == Node::Namespace &&
+ !(*c)->parent()->name().isEmpty())
+ name = (*c)->parent()->name()+"::"+name;
+ vmap.value().insert(name,(*c));
+ qDebug() << "GOT HEAH" << name;
+ }
if ((*c)->isInnerNode()) {
- findAllSince(static_cast<InnerNode *>(*c),version);
+ findAllSince(static_cast<InnerNode *>(*c));
}
}
++c;
}
}
+#if 0
+ const QRegExp versionSeparator("[\\-\\.]");
+ const int minorIndex = version.indexOf(versionSeparator);
+ const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
+ version = version.left(patchIndex);
+#endif
+
void HtmlGenerator::findAllFunctions(const InnerNode *node)
{
NodeList::ConstIterator c = node->childNodes().begin();
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index 24e2986..3f6e564 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -67,6 +67,9 @@ struct NavigationBar
};
#endif
+typedef QMultiMap<QString, Node*> SinceNodeMultiMap;
+typedef QMap<QString, SinceNodeMultiMap> SinceVersionMap;
+
class HelpProjectWriter;
class HtmlGenerator : public PageGenerator
@@ -216,7 +219,7 @@ class HtmlGenerator : public PageGenerator
#ifdef ZZZ_QDOC_QML
void findAllQmlClasses(const InnerNode *node);
#endif
- void findAllSince(const InnerNode *node, QString version);
+ void findAllSince(const InnerNode *node);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
virtual QString getLink(const Atom *atom,
@@ -286,8 +289,7 @@ class HtmlGenerator : public PageGenerator
#endif
QMap<QString, QMap<QString, const Node *> > funcIndex;
QMap<Text, const Node *> legaleseTexts;
- QMap<QString, Node*> sinceClasses;
- QMap<QString, Node*> sinceFunctions;
+ SinceVersionMap sinceVersions;
};
#define HTMLGENERATOR_ADDRESS "address"
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index b44ede0..d547d20 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -48,6 +48,23 @@
QT_BEGIN_NAMESPACE
+QString Node::typeNames[] =
+ {
+ "Namespaces",
+ "Classes",
+ "Fake",
+ "Enums",
+ "Typedefs",
+ "Functions and Macros",
+ "Properties",
+ "Variables",
+ "Targets",
+ "Qml Properties",
+ "Qml Signals",
+ "Qml Methods",
+ ""
+ };
+
/*!
\class Node
\brief A node in a Tree.
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index fdef920..09f38d2 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -76,9 +76,11 @@ class Node
Target,
QmlProperty,
QmlSignal,
- QmlMethod
+ QmlMethod,
+ LastType
#else
- Target
+ Target,
+ LastType
#endif
};
@@ -173,10 +175,13 @@ class Node
virtual QString fileBase() const;
+ static QString typeName(int i) { return typeNames[i]; }
+
protected:
Node(Type type, InnerNode *parent, const QString& name);
private:
+ static QString typeNames[];
#ifdef Q_WS_WIN
Type typ;
Access acc;