Commit 45bf7a4b authored by Laurent Montel's avatar Laurent Montel 😁

Not necessary to test pointer before to delete it

svn path=/trunk/KDE/kdepim/kontact/plugins/; revision=1158310
parent 511ff42c
......@@ -44,7 +44,8 @@
#include <Akonadi/Contact/ContactSearchJob>
#include <Akonadi/Contact/ContactViewerDialog>
#include <kcalcore/calendar.h>
#include <KCal/Calendar>
#include <KCal/CalHelper>
#include <KMenu>
#include <KLocale>
......@@ -198,7 +199,7 @@ void SDSummaryWidget::configUpdated()
group = config.group( "Groupware" );
mShowMineOnly = group.readEntry( "ShowMineOnly", false );
updateView();
}
......@@ -208,9 +209,7 @@ bool SDSummaryWidget::initHolidays()
KConfigGroup hconfig( &_hconfig, "Time & Date" );
QString location = hconfig.readEntry( "Holidays" );
if ( !location.isEmpty() ) {
if ( mHolidays ) {
delete mHolidays;
}
delete mHolidays;
mHolidays = new HolidayRegion( location );
return true;
}
......@@ -218,7 +217,7 @@ bool SDSummaryWidget::initHolidays()
}
// number of days remaining in an Event
int SDSummaryWidget::span( const KCalCore::Event::Ptr &event ) const
int SDSummaryWidget::span( KCal::Event::Ptr event ) const
{
int span = 1;
if ( event->isMultiDay() && event->allDay() ) {
......@@ -235,7 +234,7 @@ int SDSummaryWidget::span( const KCalCore::Event::Ptr &event ) const
}
// day of a multiday Event
int SDSummaryWidget::dayof( const KCalCore::Event::Ptr &event, const QDate &date ) const
int SDSummaryWidget::dayof( KCal::Event::Ptr event, const QDate &date ) const
{
int dayof = 1;
QDate d = event->dtStart().date();
......@@ -305,20 +304,18 @@ void SDSummaryWidget::createLabels()
EventSortStartDate,
SortDirectionAscending );
foreach ( const Item &item, items ) {
KCalCore::Event::Ptr ev = Akonadi::event( item );
KCal::Event::Ptr ev = Akonadi::event( item );
// Optionally, show only my Events
/* if ( mShowMineOnly && !KCalCore::CalHelper::isMyCalendarIncidence( mCalendarAdaptor, ev. ) ) {
if ( mShowMineOnly && !KCal::CalHelper::isMyCalendarIncidence( mCalendarAdaptor, ev.get() ) ) {
// FIXME; does isMyCalendarIncidence work !? It's deprecated too.
continue;
}
// TODO: CalHelper is deprecated, remove this?
*/
}
if ( ev->customProperty("KABC","BIRTHDAY" ) == "YES" ) {
// Skipping, because these are got by the BirthdaySearchJob
// See comments in updateView()
continue;
continue;
}
if ( !ev->categoriesStr().isEmpty() ) {
......@@ -632,7 +629,7 @@ void SDSummaryWidget::updateView()
*
* We could remove thomas' BirthdaySearchJob and use the ETM for that
* but it has the advantage that we don't need a Birthday agent running.
*
*
**/
// Search for Birthdays
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment