Exemplo n.º 1
0
void ExchangeDownload::download(const QDate &start, const QDate &end, bool showProgress)
{
    mCalendar = 0;
    mEvents = new QPtrList<KCal::Event>;

    if(showProgress)
    {
        //kdDebug() << "Creating progress dialog" << endl;
        mProgress = new ExchangeProgress();
        mProgress->show();

        connect(this, SIGNAL(startDownload()), mProgress, SLOT(slotTransferStarted()));
        connect(this, SIGNAL(finishDownload()), mProgress, SLOT(slotTransferFinished()));
    }

    QString sql = dateSelectQuery(start, end.addDays(1));

    increaseDownloads();

    KIO::DavJob *job = KIO::davSearch(mAccount->calendarURL(), "DAV:", "sql", sql, false);
    KIO::Scheduler::scheduleJob(job);
    job->setWindow(mWindow);
    connect(job, SIGNAL(result(KIO::Job *)),
            SLOT(slotSearchResult(KIO::Job *)));
}
Exemplo n.º 2
0
void ExchangeDelete::findUidSingleMaster(QString const &uid)
{
    QString query =
        "SELECT \"DAV:href\", \"urn:schemas:calendar:uid\"\r\n"
        "FROM Scope('shallow traversal of \"\"')\r\n"
        "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n"
        " AND (\"urn:schemas:calendar:instancetype\" = 0\r\n"
        "      OR \"urn:schemas:calendar:instancetype\" = 1)\r\n";

    KIO::DavJob *job = KIO::davSearch(mAccount->calendarURL(), "DAV:", "sql", query, false);
    job->setWindow(mWindow);
    connect(job, SIGNAL(result(KIO::Job *)), this, SLOT(slotFindUidResult(KIO::Job *)));
}
Exemplo n.º 3
0
void ExchangeDownload::readAppointment(const KURL &url)
{
    QDomDocument doc;
    QDomElement root = addElement(doc, doc, "DAV:", "propfind");
    QDomElement prop = addElement(doc, root, "DAV:", "prop");
    addElement(doc, prop, "urn:schemas:calendar:", "uid");
    addElement(doc, prop, "urn:schemas:calendar:", "timezoneid");
    addElement(doc, prop, "urn:schemas:calendar:", "timezone");
    addElement(doc, prop, "urn:schemas:calendar:", "lastmodified");
    addElement(doc, prop, "urn:schemas:calendar:", "organizer");
    addElement(doc, prop, "urn:schemas:calendar:", "contact");
    addElement(doc, prop, "urn:schemas:httpmail:", "to");
    addElement(doc, prop, "urn:schemas:calendar:", "attendeestatus");
    addElement(doc, prop, "urn:schemas:calendar:", "attendeerole");
    addElement(doc, prop, "DAV:", "isreadonly");
    addElement(doc, prop, "urn:schemas:calendar:", "instancetype");
    addElement(doc, prop, "urn:schemas:calendar:", "created");
    addElement(doc, prop, "urn:schemas:calendar:", "dtstart");
    addElement(doc, prop, "urn:schemas:calendar:", "dtend");
    addElement(doc, prop, "urn:schemas:calendar:", "alldayevent");
    addElement(doc, prop, "urn:schemas:calendar:", "transparent");
    addElement(doc, prop, "urn:schemas:httpmail:", "textdescription");
    addElement(doc, prop, "urn:schemas:httpmail:", "subject");
    addElement(doc, prop, "urn:schemas:calendar:", "location");
    addElement(doc, prop, "urn:schemas:calendar:", "rrule");
    addElement(doc, prop, "urn:schemas:calendar:", "exdate");
    addElement(doc, prop, "urn:schemas:mailheader:", "sensitivity");
    addElement(doc, prop, "urn:schemas:calendar:", "reminderoffset");

    addElement(doc, prop, "urn:schemas-microsoft-com:office:office",
               "Keywords");

    //  addElement( doc, prop, "", "" );
    //  addElement( doc, prop, "DAV:", "" );
    //  addElement( doc, prop, "urn:schemas:calendar:", "" );
    //  addElement( doc, prop, "urn:content-classes:appointment", "" );
    //  addElement( doc, prop, "urn:schemas:httpmail:", "" );

    increaseDownloads();

    KIO::DavJob *job = KIO::davPropFind(url, doc, "0", false);
    KIO::Scheduler::scheduleJob(job);
    job->setWindow(mWindow);
    job->addMetaData("errorPage", "false");
    connect(job, SIGNAL(result(KIO::Job *)),
            SLOT(slotPropFindResult(KIO::Job *)));
}
Exemplo n.º 4
0
void ExchangeDownload::handleRecurrence(QString uid)
{
    // kdDebug() << "Handling recurrence info for uid=" << uid << endl;
    QString query =
        "SELECT \"DAV:href\", \"urn:schemas:calendar:instancetype\"\r\n"
        "FROM Scope('shallow traversal of \"\"')\r\n"
        "WHERE \"urn:schemas:calendar:uid\" = '" + uid + "'\r\n"
        " AND (\"urn:schemas:calendar:instancetype\" = 1)\r\n";
    //        "      OR \"urn:schemas:calendar:instancetype\" = 3)\r\n" // FIXME: exception are not handled

    // kdDebug() << "Exchange master query: " << endl << query << endl;

    increaseDownloads();

    KIO::DavJob *job = KIO::davSearch(mAccount->calendarURL(), "DAV:", "sql",
                                      query, false);
    KIO::Scheduler::scheduleJob(job);
    job->setWindow(mWindow);
    connect(job, SIGNAL(result(KIO::Job *)),
            SLOT(slotMasterResult(KIO::Job *)));
}