summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-01-31 18:31:58 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-14 15:25:37 +0100
commit5d593da3d31a0c6adffb449db3ceb65328b87cd6 (patch)
tree9ceedd7af91e7fcdf60d91e9d3af8f0ad8fa74fd /src/corelib/tools/qbytearray.h
parent75286739de854d761bbfcababa50d1bc6dfda12a (diff)
Remove constructors taking implicit string sizes
Constructors taking explicit sizes got a default -1 size argument that triggers length calculation from nul-terminated strings. This imposes a slight change in behavior: negative size arguments would previously be ignored and generate an empty string whereas with this patch we expect to see a nul-terminated string. On the other hand, keeping the previous behavior could effectively hide errors in user code and I can't find a good reason to support it. Documentation for the constructors was updated and made more consistent between the classes. Change-Id: I738ac3298cffe3221c8a56e85ba2102623e7b67d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.h')
-rw-r--r--src/corelib/tools/qbytearray.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 5efeb6025e..c4feb63814 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -180,8 +180,7 @@ private:
public:
inline QByteArray();
- QByteArray(const char *);
- QByteArray(const char *, int size);
+ QByteArray(const char *, int size = -1);
QByteArray(int size, char c);
QByteArray(int size, Qt::Initialization);
inline QByteArray(const QByteArray &);