summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/jobscheduler.cpp
blob: 0c9a55ea7c9ef1f73d85faeec8b76bf99c6d0e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/***************************************************************************
 *   Copyright (C) 2003 by Mario Scalas                                    *
 *   mario.scalas@libero.it                                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "jobscheduler.h"

#include "cvsprocesswidget.h"

#include "kdebug.h"
#include "dcopref.h"

///////////////////////////////////////////////////////////////////////////////
// class JobScheduler
///////////////////////////////////////////////////////////////////////////////

JobScheduler::JobScheduler( CvsProcessWidget *aProcessWidget )
    : m_processWidget( aProcessWidget )
{
}

///////////////////////////////////////////////////////////////////////////////

JobScheduler::~JobScheduler()
{
}

///////////////////////////////////////////////////////////////////////////////
// class DirectScheduler
///////////////////////////////////////////////////////////////////////////////

DirectScheduler::DirectScheduler( CvsProcessWidget *aProcessWidget )
    : JobScheduler( aProcessWidget )
{
}

///////////////////////////////////////////////////////////////////////////////

bool DirectScheduler::schedule( DCOPRef &job )
{
    if (job.isNull())
    {
        kdDebug(9006) << "DirectScheduler::schedule(DCOPRef &): Job is null and will be rejected!" << endl;
        return false;
    }
    processWidget()->startJob( job );

    return true;
}