36 #include <klocalizedstring.h> 46 class KCal::KResult::Private
60 if ( mType ==
Error ) {
83 : d( new KCal::
KResult::Private )
88 : d( new KCal::
KResult::Private( type ) )
93 : d( new KCal::
KResult::Private( error, details ) )
99 delete d->mChainedResult;
105 d->mType = o.d->mType;
106 d->mErrorType = o.d->mErrorType;
107 d->mDetails = o.d->mDetails;
108 if ( o.d->mChainedResult ) {
109 d->mChainedResult =
new KResult( *o.d->mChainedResult );
111 d->mChainedResult = 0;
115 KResult::operator bool()
const 122 return d->mType ==
Ok;
132 return d->mType ==
Error;
137 return d->mErrorType;
142 switch ( d->mType ) {
146 return i18n(
"In progress" );
148 switch ( d->mErrorType ) {
150 return i18n(
"Not an error" );
152 return i18n(
"Error" );
154 return i18n(
"Invalid URL" );
156 return i18n(
"Connection failed" );
158 return i18n(
"Write error" );
160 return i18n(
"Read error" );
162 return i18n(
"Wrong Parameter" );
164 return i18n(
"Parse Error" );
166 return i18n(
"Wrong revision of schema" );
170 kError() <<
"Unhandled case";
186 d->mChainedResult =
new KResult( result );
192 return d->mChainedResult;
197 return *d->mChainedResult;
This file is part of the API for handling calendar data and defines the CalendarLocal class.
~KResult()
Destroys the result.
Type
The different types of results.
Operation successfully completed.
KResult()
Constructs a KResult object.
bool isError() const
Returns true if the result is Error.
This class represents the result of an operation.
bool isInProgress() const
Returns true if the result is InProgress.
void setDetails(const QString &details)
Sets a detailed error message.
QString details() const
Returns the detailed error message.
QString fullMessage() const
Returns the full error message.
ErrorType
The different types of error conditions.
bool isOk() const
Returns true if the result is Ok.
KResult & chain(const KResult &result)
Chains result objects.
bool hasChainedResult() const
Returns true if the KResult object has a chained KResult object; else returns false.
QString chainedMessage() const
Returns an error message including full details of all chained messages.
Operation still in-progress.
QString message() const
Returns a translated string describing the result corresponding to Type and ErrorType.
ErrorType error() const
Returns the specific result ErrorType.
KResult chainedResult() const
Returns a chained KResult object.
unable to establish a connection