summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-09-30 12:40:55 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-09-30 12:40:55 (GMT)
commit1a902e6dba504b4a25a218555bb326772b5b77a6 (patch)
tree5799841909416b19f713652da25868a1e367a856
parentdcbba3c0b603ad3b38c0d3ed128b230857cb38be (diff)
parent59623e45ee31892c9ef210f8d7e396ccb0fe31a5 (diff)
downloadQt-1a902e6dba504b4a25a218555bb326772b5b77a6.zip
Qt-1a902e6dba504b4a25a218555bb326772b5b77a6.tar.gz
Qt-1a902e6dba504b4a25a218555bb326772b5b77a6.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--examples/webkit/googlechat/main.cpp15
-rw-r--r--src/sql/drivers/tds/qsql_tds.cpp15
-rw-r--r--src/sql/drivers/tds/qsql_tds.h2
3 files changed, 31 insertions, 1 deletions
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/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();