Disable clipboardsharing in view only mode.
[kdenetwork.git] / kget / core / job.cpp
blob37a3da591b69af8555766dea319ae8c375235b54
1 /* This file is part of the KDE project
3 Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9 */
11 #include "core/job.h"
13 #include "core/jobqueue.h"
14 #include "core/scheduler.h"
16 #include <kdebug.h>
18 Job::Job(JobQueue * parent, Scheduler * scheduler)
19 : m_jobQueue(parent),
20 m_scheduler(scheduler),
21 m_status(Stopped),
22 m_policy(None)
27 Job::~Job()
31 void Job::setStatus(Status jobStatus)
33 if(jobStatus == m_status)
34 return;
36 if(m_status == Job::Delayed)
38 //The previous status was Job::Delayed. We must stop all the timers
39 m_scheduler->stopDelayTimer(this);
42 m_status = jobStatus;
43 m_scheduler->jobChangedEvent(this, m_status);
46 void Job::setPolicy(Policy jobPolicy)
48 if(jobPolicy == m_policy)
49 return;
51 kDebug(5001) << "Job::setPolicy(" << jobPolicy << ")";
53 m_policy = jobPolicy;
54 m_scheduler->jobChangedEvent(this, m_policy);