summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
diff options
context:
space:
mode:
authorAntonis Tsiapaliokas <kok3rs@gmail.com>2011-08-16 01:26:21 +0300
committerQt by Nokia <qt-info@nokia.com>2011-08-24 06:51:17 +0200
commit41e5be37737b959c476275c6aa245b635b6e2a16 (patch)
tree3dcbaa82044478316f0d4c850306432286e5e3b2 /src/sql/kernel
parent4ef4f8f3e177e7e371232c49e614e6ebbf57e8b5 (diff)
Add operator== and operator!= to qsqlerror class
Merge-request: 44 Task-number: QTBUG-20543 Change-Id: I7b88985fe095ffd2e48ac05c82dc3f3a92dbb091 Reviewed-on: http://codereview.qt.nokia.com/3425 Reviewed-by: Charles Yin <charles.yin@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/sql/kernel')
-rw-r--r--src/sql/kernel/qsqlerror.cpp20
-rw-r--r--src/sql/kernel/qsqlerror.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index a8ffdffa8a..fd731e4974 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -124,6 +124,26 @@ QSqlError& QSqlError::operator=(const QSqlError& other)
}
/*!
+ Compare the \a other error's values to this error and returns true, if it equal.
+*/
+
+bool QSqlError::operator==(const QSqlError& other)
+{
+ return (errorType == other.errorType);
+}
+
+
+/*!
+ Compare the \a other error's values to this error and returns true if it is not equal.
+*/
+
+bool QSqlError::operator!=(const QSqlError& other)
+{
+ return (errorType != other.errorType);
+}
+
+
+/*!
Destroys the object and frees any allocated resources.
*/
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index fea3ca8526..c1df370a86 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -66,6 +66,8 @@ public:
int number = -1);
QSqlError(const QSqlError& other);
QSqlError& operator=(const QSqlError& other);
+ bool operator==(const QSqlError& other);
+ bool operator!=(const QSqlError& other);
~QSqlError();
QString driverText() const;