diff options
Diffstat (limited to 'libkcal/exceptions.cpp')
-rw-r--r-- | libkcal/exceptions.cpp | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/libkcal/exceptions.cpp b/libkcal/exceptions.cpp index 98d7153eb..99c804ddf 100644 --- a/libkcal/exceptions.cpp +++ b/libkcal/exceptions.cpp @@ -26,7 +26,7 @@ using namespace KCal; -Exception::Exception(const TQString &message) +Exception::Exception( const TQString &message ) { mMessage = message; } @@ -37,13 +37,16 @@ Exception::~Exception() TQString Exception::message() { - if (mMessage.isEmpty()) return i18n("%1 Error").arg(CalFormat::application()); - else return mMessage; + if ( mMessage.isEmpty() ) { + return i18n( "%1 Error" ).arg( CalFormat::application() ); + } else { + return mMessage; + } } -ErrorFormat::ErrorFormat(ErrorCodeFormat code,const TQString &message) : - Exception(message) +ErrorFormat::ErrorFormat( ErrorCodeFormat code, const TQString &message ) + : Exception( message ) { mCode = code; } @@ -52,35 +55,45 @@ TQString ErrorFormat::message() { TQString message = ""; - switch (mCode) { - case LoadError: - message = i18n("Load Error"); - break; - case SaveError: - message = i18n("Save Error"); - break; - case ParseErrorIcal: - message = i18n("Parse Error in libical"); - break; - case ParseErrorKcal: - message = i18n("Parse Error in libkcal"); - break; - case NoCalendar: - message = i18n("No calendar component found."); - break; - case CalVersion1: - message = i18n("vCalendar Version 1.0 detected."); - break; - case CalVersion2: - message = i18n("iCalendar Version 2.0 detected."); - break; - case Restriction: - message = i18n("Restriction violation"); - default: - break; + switch ( mCode ) { + case LoadError: + message = i18n( "Load Error" ); + break; + case SaveError: + message = i18n( "Save Error" ); + break; + case ParseErrorIcal: + message = i18n( "Parse Error in libical" ); + break; + case ParseErrorKcal: + message = i18n( "Parse Error in libkcal" ); + break; + case NoCalendar: + message = i18n( "No calendar component found." ); + break; + case CalVersion1: + message = i18n( "vCalendar Version 1.0 detected." ); + break; + case CalVersion2: + message = i18n( "iCalendar Version 2.0 detected." ); + break; + case CalVersionUnknown: + message = i18n( "Unknown calendar format detected." ); + break; + case Restriction: + message = i18n( "Restriction violation" ); + break; + case NoWritableFound: + message = i18n( "No writable resource found" ); + break; + case UserCancel: + // no real error; the user canceled the operation + break; } - if (!mMessage.isEmpty()) message += ": " + mMessage; + if ( !mMessage.isEmpty() ) { + message += ": " + mMessage; + } return message; } |