summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qchar.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-05-02 16:30:04 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-22 20:56:38 +0200
commit2c9228973fc212db044add557839b15a8cb483c3 (patch)
treea67c402cb988461af3f4c0935c5a13a473768e6f /src/corelib/tools/qchar.h
parent1ca791faf5b89c35b4b39d443d2118a882c3946b (diff)
Deprecate {QString,QStringRef,QChar}::{to,from}Ascii
Make them call exactly their Latin 1 counterparts. For the QString functions that take a single char, also use fromAscii directly. Change-Id: I87645aba6ab9cde34c1df3cbc3a979fbd9e91f9d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qchar.h')
-rw-r--r--src/corelib/tools/qchar.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 63a8df32f4..c8cbd1d0cf 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -227,12 +227,17 @@ public:
inline UnicodeVersion unicodeVersion() const { return QChar::unicodeVersion(ucs); }
- inline char toAscii() const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED inline char toAscii() const { return toLatin1(); }
+#endif
inline char toLatin1() const;
inline ushort unicode() const { return ucs; }
inline ushort &unicode() { return ucs; }
- static inline QChar fromAscii(char c);
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED static inline QChar fromAscii(char c)
+ { return fromLatin1(c); }
+#endif
static inline QChar fromLatin1(char c);
inline bool isNull() const { return ucs == 0; }
@@ -337,10 +342,8 @@ private:
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
-inline char QChar::toAscii() const { return ucs > 0xff ? 0 : char(ucs); }
inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
-inline QChar QChar::fromAscii(char c) { return QChar(ushort(uchar(c))); }
inline void QChar::setCell(uchar acell)
{ ucs = ushort((ucs & 0xff00) + acell); }