summaryrefslogtreecommitdiffstats
path: root/libkcal/exceptions.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkcal/exceptions.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/exceptions.cpp')
-rw-r--r--libkcal/exceptions.cpp77
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;
}