43 using namespace KCalCore;
59 kDebug() <<
"konsolekalendarchange.cpp::changeEvent()";
64 Event::Ptr
event = m_variables->getCalendar()->event( m_variables->getUID() );
66 if ( m_variables->isDryRun() ) {
67 cout << i18n(
"Change Event <Dry Run>:" ).toLocal8Bit().data()
71 cout << i18n(
"To Event <Dry Run>:" ).toLocal8Bit().data()
75 kDebug() <<
"konsolekalendarchange.cpp:changeEvent() :"
76 << m_variables->getUID().toLocal8Bit().data();
78 if ( m_variables->isVerbose() ) {
79 cout << i18n(
"Change Event <Verbose>:" ).toLocal8Bit().data()
83 cout << i18n(
"To Event <Dry Run>:" ).toLocal8Bit().data()
88 event->startUpdates();
89 Akonadi::CalendarBase::Ptr calendar = m_variables->getCalendar();
90 KDateTime::Spec timeSpec = calendar->timeSpec();
91 if ( m_variables->isStartDateTime() ) {
92 event->setDtStart( KDateTime( m_variables->getStartDateTime(), timeSpec ) );
95 if ( m_variables->isEndDateTime() ) {
96 event->setDtEnd( KDateTime( m_variables->getEndDateTime(), timeSpec ) );
99 event->setAllDay( m_variables->getFloating() );
101 if ( m_variables->isSummary() ) {
102 event->setSummary( m_variables->getSummary() );
105 if ( m_variables->isDescription() ) {
106 event->setDescription( m_variables->getDescription() );
109 if ( m_variables->isLocation() ) {
110 event->setLocation( m_variables->getLocation() );
115 &loop, SLOT(quit()));
118 calendar->modifyIncidence(event);
121 status = *
event == *calendar->incidence(event->uid());
124 cout << i18n(
"Success: \"%1\" changed", event->summary() ).toLocal8Bit().data()
127 cout << i18n(
"Failure: \"%1\" not changed", event->summary() ).toLocal8Bit().data()
133 kDebug() <<
"konsolekalendarchange.cpp::changeEvent() | Done";
137 void KonsoleKalendarChange::printSpecs(
const Event::Ptr &event )
139 cout << i18n(
" UID: %1",
140 event->uid() ).toLocal8Bit().data()
143 cout << i18n(
" What: %1",
144 event->summary() ).toLocal8Bit().data()
147 KDateTime::Spec timeSpec = m_variables->getCalendar()->timeSpec();
148 cout << i18n(
" Begin: %1",
149 event->dtStart().toTimeSpec( timeSpec ).
150 dateTime().toString( Qt::TextDate ) ).toLocal8Bit().data()
153 cout << i18n(
" End: %1",
154 event->dtEnd().toTimeSpec( timeSpec ).
155 dateTime().toString( Qt::TextDate ) ).toLocal8Bit().data()
158 cout << i18n(
" Desc: %1",
159 event->description() ).toLocal8Bit().data()
162 cout << i18n(
" Location: %1",
163 event->location() ).toLocal8Bit().data()
167 void KonsoleKalendarChange::printSpecs()
169 cout << i18n(
" UID: %1",
170 m_variables->getUID() ).toLocal8Bit().data()
173 cout << i18n(
" What: %1",
174 m_variables->getSummary() ).toLocal8Bit().data()
177 cout << i18n(
" Begin: %1",
178 m_variables->getStartDateTime().toString( Qt::TextDate ) ).toLocal8Bit().data()
181 cout << i18n(
" End: %1",
182 m_variables->getEndDateTime().toString( Qt::TextDate ) ).toLocal8Bit().data()
185 cout << i18n(
" Desc: %1",
186 m_variables->getDescription() ).toLocal8Bit().data()
189 cout << i18n(
" Location: %1",
190 m_variables->getLocation() ).toLocal8Bit().data()
bool changeEvent()
Modify the Event.
~KonsoleKalendarChange()
Destructor.
This class provides all the variables for the program.
KonsoleKalendarChange(KonsoleKalendarVariables *vars)
Constructs a KonsoleKalendarChange object from command line arguments.
Provides the KonsoleKalendarChange class definition.
int exec(QFlags< QEventLoop::ProcessEventsFlag > flags)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)