25 #include <tdeconfig.h>
27 #include <tdelocale.h>
31 #include "resourcecalendar.h"
35 ResourceCalendar::ResourceCalendar( const TDEConfig *config )
36 : KRES::Resource( config ), mResolveConflict( false )
41 ResourceCalendar::~ResourceCalendar()
63 void ResourceCalendar::setResolveConflict( bool b)
72 txt += "<b>" + resourceName() + "</b>";
75 KRES::Factory *factory = KRES::Factory::self( "calendar" );
76 TQString t = factory->typeName( type() );
77 txt += i18n( "Type: %1").arg( t );
84 void ResourceCalendar::writeConfig( TDEConfig* config )
88 KRES::Resource::writeConfig( config );
104 return incidence-> accept( v );
110 return incidence-> accept( v );
116 return incidence-> accept( v );
140 kdDebug(5800) << "Loading resource " + resourceName() << endl;
142 mReceivedLoadError = false;
150 if ( !success && !mReceivedLoadError )
158 Incidence::List::Iterator it;
159 for ( it = incidences.begin(); it != incidences.end(); ++it ) {
160 (*it)->setReadOnly( true );
164 kdDebug(5800) << "Done loading resource " + resourceName() << endl;
171 kdDebug(5800) << "Error loading resource: " << err << endl;
173 mReceivedLoadError = true;
175 TQString msg = i18n( "Error while loading %1.\n") .arg( resourceName() );
176 if ( !err.isEmpty() ) {
185 kdDebug(5800) << "Save resource " + resourceName() << endl;
187 mReceivedSaveError = false;
189 if ( !isOpen() ) return true;
190 bool success = incidence ? doSave(incidence) : doSave();
191 if ( !success && !mReceivedSaveError ) saveError();
196 kdDebug(5800) << "Don't save read-only resource " + resourceName() << endl;
208 kdDebug(5800) << "Error saving resource: " << err << endl;
210 mReceivedSaveError = true;
212 TQString msg = i18n( "Error while saving %1.\n") .arg( resourceName() );
213 if ( !err.isEmpty() ) {
228 Q_UNUSED( resource );
234 if ( resource.isEmpty() ) {
249 #include "resourcecalendar.moc"
|