KCal Library
Go to the documentation of this file.
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;
bool isError() const
Returns true if the result is Error.
QString chainedMessage() const
Returns an error message including full details of all chained messages.
Type
The different types of results.
QString message() const
Returns a translated string describing the result corresponding to Type and ErrorType.
ErrorType
The different types of error conditions.
ErrorType error() const
Returns the specific result ErrorType.
QString details() const
Returns the detailed error message.
@ WrongSchemaRevision
Invalid schema revision.
This class represents the result of an operation.
@ InProgress
Operation still in-progress.
bool isInProgress() const
Returns true if the result is InProgress.
KResult chainedResult() const
Returns a chained KResult object.
@ ConnectionFailed
unable to establish a connection
~KResult()
Destroys the result.
KResult & chain(const KResult &result)
Chains result objects.
void setDetails(const QString &details)
Sets a detailed error message.
KResult()
Constructs a KResult object.
QString fullMessage() const
Returns the full error message.
@ Undefined
Undefined error.
bool hasChainedResult() const
Returns true if the KResult object has a chained KResult object; else returns false.
@ NotAnError
Not an error.
@ Ok
Operation successfully completed.
bool isOk() const
Returns true if the result is Ok.
@ WrongParameter
Invalid parameter.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.