summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-01 04:01:37 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-01 04:01:37 (GMT)
commit1f80cbaa0e2f6aea288753fa94b6277a2fbd676d (patch)
treede6487c9ed7f47b7d8420770a0ea38c16612e21a /src
parentb2d9dc8c487a8b87347a7d45a6c4f9dc827ddbfe (diff)
parent28635d8aeefbd0aa807f333769a0ab9fea9324b0 (diff)
downloadQt-1f80cbaa0e2f6aea288753fa94b6277a2fbd676d.zip
Qt-1f80cbaa0e2f6aea288753fa94b6277a2fbd676d.tar.gz
Qt-1f80cbaa0e2f6aea288753fa94b6277a2fbd676d.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/network/ssl/qsslerror.cpp15
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp12
3 files changed, 21 insertions, 10 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index a1c3e4e..4dbd6dc 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -1047,7 +1047,9 @@ int QHeaderView::visualIndex(int logicalIndex) const
/*!
Returns the logicalIndex for the section at the given \a visualIndex
- position, or -1 otherwise.
+ position, or -1 if visualIndex < 0 or visualIndex >= QHeaderView::count().
+
+ Note that the visualIndex is not affected by hidden sections.
\sa visualIndex(), sectionPosition()
*/
diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp
index 69d2ccd..d47c91d 100644
--- a/src/network/ssl/qsslerror.cpp
+++ b/src/network/ssl/qsslerror.cpp
@@ -105,10 +105,8 @@ public:
};
/*!
- Constructs a QSslError object. The two optional arguments specify the \a
- error that occurred, and which \a certificate the error relates to.
+ Constructs a QSslError object with no error and default certificate.
- \sa QSslCertificate
*/
// RVCT compiler in debug build does not like about default values in const-
@@ -120,6 +118,11 @@ QSslError::QSslError()
d->certificate = QSslCertificate();
}
+/*!
+ Constructs a QSslError object. The argument specifies the \a
+ error that occurred.
+
+*/
QSslError::QSslError(SslError error)
: d(new QSslErrorPrivate)
{
@@ -127,6 +130,12 @@ QSslError::QSslError(SslError error)
d->certificate = QSslCertificate();
}
+/*!
+ Constructs a QSslError object. The two arguments specify the \a
+ error that occurred, and which \a certificate the error relates to.
+
+ \sa QSslCertificate
+*/
QSslError::QSslError(SslError error, const QSslCertificate &certificate)
: d(new QSslErrorPrivate)
{
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 742d596..2692c96 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -323,12 +323,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni
colSize *= 2; // a tiny bit faster, since it saves a SQLGetData() call
}
}
- char* buf = new char[colSize];
+ QVarLengthArray<char> buf(colSize);
while (true) {
r = SQLGetData(hStmt,
column+1,
unicode ? SQL_C_WCHAR : SQL_C_CHAR,
- (SQLPOINTER)buf,
+ (SQLPOINTER)buf.data(),
colSize,
&lengthIndicator);
if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) {
@@ -343,11 +343,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni
// colSize-1: remove 0 termination when there is more data to fetch
int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-2 : colSize-1) : lengthIndicator;
if (unicode) {
- fieldVal += QString((QChar*) buf, rSize / 2);
+ fieldVal += QString((const QChar*) buf.constData(), rSize / 2);
} else {
- fieldVal += QString::fromAscii(buf, rSize);
+ fieldVal += QString::fromAscii(buf.constData(), rSize);
}
- if (lengthIndicator - fieldVal.size() <= 0) {
+ memset(buf.data(), 0, colSize);
+ if (lengthIndicator < colSize) {
// workaround for Drivermanagers that don't return SQL_NO_DATA
break;
}
@@ -359,7 +360,6 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni
break;
}
}
- delete[] buf;
return fieldVal;
}