Changeset 73:85d8decd3656 in SMSSender for lib/libdatatypes/src/exceptions/eexception.cpp


Ignore:
Timestamp:
Feb 10, 2010 7:11:29 PM (9 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
3.0
Convert:
svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@72
Message:
  • Backupversion only! Before removal of QObject as parent of EException
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libdatatypes/src/exceptions/eexception.cpp

    r72 r73  
    88#include "eexception.h"
    99
    10 #include <QObject>
    11 
    1210EException::EException(const QString& msg)
    1311    : chainedException_(NULL)
    1412{
    15     setMessage(msg);
     13    setWhat(msg);
     14}
     15
     16EException::EException(const EException& other)
     17    : QObject::QObject()
     18{
     19    *this = other;
     20}
     21EException& EException::operator=(const EException& other) {
     22    setWhat(other.unchainedWhat());
     23    debugInfos_       = other.debugInfos();
     24    chainedException_ = &other.chainedException();
     25
     26    return *this;
    1627}
    1728
     
    2132 * @return EException
    2233 */
    23 EException EException::chain(const EException& exception) throw() {
    24     chainedException_ = const_cast<EException*>(&exception);
     34EException& EException::chain(EException exception) throw() {
     35    chainedException_ = &exception;
    2536    return *this;
    2637}
    27 EException EException::chainedException() const throw() {
     38EException& EException::chain(EException& exception) throw() {
     39    chainedException_ = &exception;
     40    return *this;
     41}
     42EException& EException::chainedException() const throw() {
    2843    return *chainedException_;
    2944}
    3045
    31 EException EException::addDebugInfo(const QString& value) throw() {
     46EException& EException::addDebugInfo(const QString& value) throw() {
    3247    debugInfos_.append(value);
    3348    return *this;
    3449}
    35 EException EException::addDebugInfo(const QString& key, const QString& value) throw() {
     50EException& EException::addDebugInfo(const QString& key, const QString& value) throw() {
    3651    if (key.trimmed() != "") {
    3752        addDebugInfo(key + "=" + value);
     
    4156    return *this;
    4257}
    43 EException EException::addDebugInfo(const QString& key, int value) throw() {
     58EException& EException::addDebugInfo(const QString& key, int value) throw() {
    4459    addDebugInfo(key, QString::number(value));
    4560    return *this;
    4661}
    47 EException EException::addDebugInfos(const QList<QString>& debugInfos) throw() {
     62EException& EException::addDebugInfos(const QList<QString>& debugInfos) throw() {
    4863    debugInfos_.append(debugInfos);
    4964    return *this;
    5065}
    51 EException EException::addDebugInfos(const QMap<QString, QString>& debugInfos) throw() {
     66EException& EException::addDebugInfos(const QMap<QString, QString>& debugInfos) throw() {
    5267    foreach (QString key, debugInfos.keys()) {
    5368        addDebugInfo(key, debugInfos[key]);
     
    6075
    6176
    62 void EException::setMessage(const QString& msg) throw() {
     77void EException::setWhat(const QString& msg) throw() {
    6378    message_ = msg;
    6479    if (msg == "") {
Note: See TracChangeset for help on using the changeset viewer.