~ubuntu-branches/ubuntu/quantal/kdepim/quantal

« back to all changes in this revision

Viewing changes to kalarm/resources/resourcelocaldir.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:51 UTC
  • mto: This revision was merged to the branch mainline in revision 193.
  • Revision ID: package-import@ubuntu.com-20111215141751-bmhdpiwl23wd9w26
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  resourcelocaldir.cpp  -  KAlarm local directory calendar resource
3
3
 *  Program:  kalarm
4
 
 *  Copyright © 2006-2010 by David Jarvie <djarvie@kde.org>
 
4
 *  Copyright © 2006-2011 by David Jarvie <djarvie@kde.org>
5
5
 *  Based on resourcelocaldir.cpp in libkcal (updated to rev 779953,938673,938806),
6
6
 *  Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
7
7
 *
55
55
    init();
56
56
}
57
57
 
58
 
KAResourceLocalDir::KAResourceLocalDir(KAlarm::CalEvent::Type type, const QString& dirName)
 
58
KAResourceLocalDir::KAResourceLocalDir(CalEvent::Type type, const QString& dirName)
59
59
    : AlarmResource(type),
60
60
      mURL(KUrl::fromPath(dirName)),
61
61
      mDirReadOnly(false)
69
69
 
70
70
    //setSavePolicy(SaveDelayed);  // unnecessary for KAlarm, and would override base class setting
71
71
 
72
 
    connect(&mDirWatch, SIGNAL(dirty(const QString&)), SLOT(slotUpdated(const QString&)));
73
 
    connect(&mDirWatch, SIGNAL(created(const QString&)), SLOT(slotUpdated(const QString&)));
74
 
    connect(&mDirWatch, SIGNAL(deleted(const QString&)), SLOT(slotUpdated(const QString&)));
 
72
    connect(&mDirWatch, SIGNAL(dirty(QString)), SLOT(slotUpdated(QString)));
 
73
    connect(&mDirWatch, SIGNAL(created(QString)), SLOT(slotUpdated(QString)));
 
74
    connect(&mDirWatch, SIGNAL(deleted(QString)), SLOT(slotUpdated(QString)));
75
75
    mDirWatch.addDir(mURL.toLocalFile(), KDirWatch::WatchFiles);
76
76
 
77
77
    enableResource(isActive());
173
173
    mLoading = true;
174
174
    mLoaded = false;
175
175
    disableChangeNotification();
176
 
    setCompatibility(KAlarm::Calendar::ByEvent);
 
176
    setCompatibility(KACalendar::ByEvent);
177
177
    if (syncCache)
178
178
    {
179
179
        emit invalidate(this);
315
315
    }
316
316
    else
317
317
    {
318
 
        KAlarm::Calendar::Compat compat = checkCompatibility(calendar, fileName, prompt);
 
318
        KACalendar::Compat compat = checkCompatibility(calendar, fileName, prompt);
319
319
        switch (compat)
320
320
        {
321
 
            case KAlarm::Calendar::Converted:   // user elected to convert. Don't prompt again.
 
321
            case KACalendar::Converted:   // user elected to convert. Don't prompt again.
322
322
                prompt = CONVERT;
323
 
                compat = KAlarm::Calendar::Current;
 
323
                compat = KACalendar::Current;
324
324
                break;
325
 
            case KAlarm::Calendar::Convertible: // user elected not to convert. Don't prompt again.
 
325
            case KACalendar::Convertible: // user elected not to convert. Don't prompt again.
326
326
                prompt = NO_CONVERT;
327
327
                break;
328
 
            case KAlarm::Calendar::Current:
329
 
            case KAlarm::Calendar::Incompatible:
330
 
            case KAlarm::Calendar::ByEvent:
 
328
            case KACalendar::Current:
 
329
            case KACalendar::Incompatible:
 
330
            case KACalendar::ByEvent:
331
331
                break;
332
332
        }
333
333
        kDebug(KARES_DEBUG) << fileName << ": compatibility=" << compat;
409
409
{
410
410
    if (!AlarmResource::addEvent(event))
411
411
        return false;
412
 
    mCompatibilityMap[event] = KAlarm::Calendar::Current;
 
412
    mCompatibilityMap[event] = KACalendar::Current;
413
413
    return true;
414
414
}
415
415