summaryrefslogtreecommitdiffstats
path: root/kplato/kptresource.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kplato/kptresource.cc')
-rw-r--r--kplato/kptresource.cc208
1 files changed, 104 insertions, 104 deletions
diff --git a/kplato/kptresource.cc b/kplato/kptresource.cc
index 2be8790c..78834b4a 100644
--- a/kplato/kptresource.cc
+++ b/kplato/kptresource.cc
@@ -49,7 +49,7 @@ ResourceGroup::~ResourceGroup() {
//kdDebug()<<k_funcinfo<<"("<<this<<")"<<endl;
}
-bool ResourceGroup::setId(QString id) {
+bool ResourceGroup::setId(TQString id) {
//kdDebug()<<k_funcinfo<<id<<endl;
if (id.isEmpty()) {
kdError()<<k_funcinfo<<"id is empty"<<endl;
@@ -66,7 +66,7 @@ bool ResourceGroup::setId(QString id) {
}
if (findId(id)) {
kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different group: "<<findId(id)->name()<<endl;
- m_id = QString(); // hmmm
+ m_id = TQString(); // hmmm
return false;
}
m_id = id;
@@ -86,7 +86,7 @@ void ResourceGroup::generateId() {
return;
}
}
- m_id = QString();
+ m_id = TQString();
}
void ResourceGroup::addResource(Resource* resource, Risk*) {
@@ -106,7 +106,7 @@ void ResourceGroup::removeResource(Resource *resource) {
}
Resource *ResourceGroup::takeResource(Resource *resource) {
- return m_resources.take(m_resources.findRef(resource));
+ return m_resources.take(m_resources.tqfindRef(resource));
}
void ResourceGroup::removeResource(int) {
@@ -122,15 +122,15 @@ ResourceGroup* ResourceGroup::getRequiredResource(int) {
void ResourceGroup::removeRequiredResource(int) {
}
-bool ResourceGroup::load(QDomElement &element) {
+bool ResourceGroup::load(TQDomElement &element) {
//kdDebug()<<k_funcinfo<<endl;
setId(element.attribute("id"));
m_name = element.attribute("name");
- QDomNodeList list = element.childNodes();
+ TQDomNodeList list = element.childNodes();
for (unsigned int i=0; i<list.count(); ++i) {
if (list.item(i).isElement()) {
- QDomElement e = list.item(i).toElement();
+ TQDomElement e = list.item(i).toElement();
if (e.tagName() == "resource") {
// Load the resource
Resource *child = new Resource(m_project);
@@ -145,23 +145,23 @@ bool ResourceGroup::load(QDomElement &element) {
return true;
}
-void ResourceGroup::save(QDomElement &element) const {
+void ResourceGroup::save(TQDomElement &element) const {
//kdDebug()<<k_funcinfo<<endl;
- QDomElement me = element.ownerDocument().createElement("resource-group");
+ TQDomElement me = element.ownerDocument().createElement("resource-group");
element.appendChild(me);
me.setAttribute("id", m_id);
me.setAttribute("name", m_name);
- QPtrListIterator<Resource> it(m_resources);
+ TQPtrListIterator<Resource> it(m_resources);
for ( ; it.current(); ++it ) {
it.current()->save(me);
}
}
void ResourceGroup::initiateCalculation(Schedule &sch) {
- QPtrListIterator<Resource> it(m_resources);
+ TQPtrListIterator<Resource> it(m_resources);
for (; it.current(); ++it) {
it.current()->initiateCalculation(sch);
}
@@ -170,29 +170,29 @@ void ResourceGroup::initiateCalculation(Schedule &sch) {
int ResourceGroup::units() {
int u = 0;
- QPtrListIterator<Resource> it = m_resources;
+ TQPtrListIterator<Resource> it = m_resources;
for (; it.current(); ++it) {
u += it.current()->units();
}
return u;
}
-ResourceGroup *ResourceGroup::findId(const QString &id) const {
+ResourceGroup *ResourceGroup::findId(const TQString &id) const {
return m_project ? m_project->findResourceGroup(id) : 0;
}
-bool ResourceGroup::removeId(const QString &id) {
+bool ResourceGroup::removeId(const TQString &id) {
return m_project ? m_project->removeResourceGroupId(id): false;
}
-void ResourceGroup::insertId(const QString &id) {
+void ResourceGroup::insertId(const TQString &id) {
if (m_project)
m_project->insertResourceGroupId(id, this);
}
Appointment ResourceGroup::appointmentIntervals() const {
Appointment a;
- QPtrListIterator<Resource> it = m_resources;
+ TQPtrListIterator<Resource> it = m_resources;
for (; it.current(); ++it) {
a += it.current()->appointmentIntervals();
}
@@ -203,8 +203,8 @@ Resource::Resource(Project *project) : m_project(project), m_schedules(), m_work
m_type = Type_Work;
m_units = 100; // %
- m_availableFrom = DateTime(QDate::currentDate());
- m_availableUntil = m_availableFrom.addYears(2);
+ m_availableFrom = DateTime(TQDate::tqcurrentDate());
+ m_availableUntil = TQDateTime(m_availableFrom.addYears(2));
cost.normalRate = 100;
cost.overtimeRate = 200;
@@ -225,17 +225,17 @@ Resource::~Resource() {
if (findId() == this) {
removeId(); // only remove myself (I may be just a working copy)
}
- QPtrListIterator<ResourceRequest> it = m_requests;
+ TQPtrListIterator<ResourceRequest> it = m_requests;
for (; it.current(); ++it) {
it.current()->setResource(0); // avoid the request to mess with my list
}
m_requests.first();
for (; m_requests.current(); m_requests.next()) {
- m_requests.current()->parent()->removeResourceRequest(m_requests.current()); // deletes the request
+ m_requests.current()->tqparent()->removeResourceRequest(m_requests.current()); // deletes the request
}
}
-bool Resource::setId(QString id) {
+bool Resource::setId(TQString id) {
//kdDebug()<<k_funcinfo<<id<<endl;
if (id.isEmpty()) {
kdError()<<k_funcinfo<<"id is empty"<<endl;
@@ -252,7 +252,7 @@ bool Resource::setId(QString id) {
}
if (findId(id)) {
kdError()<<k_funcinfo<<"id '"<<id<<"' is already used for different resource: "<<findId(id)->name()<<endl;
- m_id = QString(); // hmmm
+ m_id = TQString(); // hmmm
return false;
}
m_id = id;
@@ -273,23 +273,23 @@ void Resource::generateId() {
return;
}
}
- m_id = QString();
+ m_id = TQString();
}
-void Resource::setType(const QString &type) {
+void Resource::setType(const TQString &type) {
if (type == "Work")
m_type = Type_Work;
else if (type == "Material")
m_type = Type_Material;
}
-QString Resource::typeToString() const {
+TQString Resource::typeToString() const {
if (m_type == Type_Work)
- return QString("Work");
+ return TQString("Work");
else if (m_type == Type_Material)
- return QString("Material");
+ return TQString("Material");
- return QString();
+ return TQString();
}
void Resource::copy(Resource *resource) {
@@ -315,10 +315,10 @@ void Resource::copy(Resource *resource) {
m_calendar = resource->m_calendar;
}
-void Resource::addWorkingHour(QTime from, QTime until) {
+void Resource::addWorkingHour(TQTime from, TQTime until) {
//kdDebug()<<k_funcinfo<<endl;
- m_workingHours.append(new QTime(from));
- m_workingHours.append(new QTime(until));
+ m_workingHours.append(new TQTime(from));
+ m_workingHours.append(new TQTime(until));
}
Calendar *Resource::calendar(bool local) const {
@@ -343,9 +343,9 @@ DateTime Resource::getBestAvailableTime(const DateTime /*after*/, const Duration
return DateTime();
}
-bool Resource::load(QDomElement &element) {
+bool Resource::load(TQDomElement &element) {
//kdDebug()<<k_funcinfo<<endl;
- QString s;
+ TQString s;
setId(element.attribute("id"));
m_name = element.attribute("name");
m_initials = element.attribute("initials");
@@ -365,9 +365,9 @@ bool Resource::load(QDomElement &element) {
return true;
}
-void Resource::save(QDomElement &element) const {
+void Resource::save(TQDomElement &element) const {
//kdDebug()<<k_funcinfo<<endl;
- QDomElement me = element.ownerDocument().createElement("resource");
+ TQDomElement me = element.ownerDocument().createElement("resource");
element.appendChild(me);
if (calendar(true))
@@ -386,7 +386,7 @@ void Resource::save(QDomElement &element) const {
bool Resource::isAvailable(Task */*task*/) {
bool busy = false;
-/* QPtrListIterator<Appointment> it(m_appointments);
+/* TQPtrListIterator<Appointment> it(m_appointments);
for (; it.current(); ++it) {
if (it.current()->isBusy(task->startTime(), task->endTime())) {
busy = true;
@@ -396,8 +396,8 @@ bool Resource::isAvailable(Task */*task*/) {
return !busy;
}
-QPtrList<Appointment> Resource::appointments() {
- QPtrList<Appointment> lst;
+TQPtrList<Appointment> Resource::appointments() {
+ TQPtrList<Appointment> lst;
if (m_currentSchedule)
lst = m_currentSchedule->appointments();
//kdDebug()<<k_funcinfo<<lst.count()<<endl;
@@ -405,7 +405,7 @@ QPtrList<Appointment> Resource::appointments() {
}
Appointment *Resource::findAppointment(Node */*node*/) {
-/* QPtrListIterator<Appointment> it = m_appointments;
+/* TQPtrListIterator<Appointment> it = m_appointments;
for (; it.current(); ++it) {
if (it.current()->node() == node)
return it.current();
@@ -432,7 +432,7 @@ void Resource::addAppointment(Schedule *node, DateTime &start, DateTime &end, do
//kdDebug()<<k_funcinfo<<endl;
Schedule *s = findSchedule(node->id());
if (s == 0) {
- s = createSchedule(node->parent());
+ s = createSchedule(node->tqparent());
}
s->addAppointment(node, start, end, load);
}
@@ -457,17 +457,17 @@ void Resource::takeSchedule(const Schedule *schedule) {
void Resource::addSchedule(Schedule *schedule) {
if (schedule == 0)
return;
- m_schedules.replace(schedule->id(), schedule);
+ m_schedules.tqreplace(schedule->id(), schedule);
}
-ResourceSchedule *Resource::createSchedule(QString name, int type, long id) {
+ResourceSchedule *Resource::createSchedule(TQString name, int type, long id) {
ResourceSchedule *sch = new ResourceSchedule(this, name, (Schedule::Type)type, id);
addSchedule(sch);
return sch;
}
-ResourceSchedule *Resource::createSchedule(Schedule *parent) {
- ResourceSchedule *sch = new ResourceSchedule(parent, this);
+ResourceSchedule *Resource::createSchedule(Schedule *tqparent) {
+ ResourceSchedule *sch = new ResourceSchedule(tqparent, this);
addSchedule(sch);
return sch;
}
@@ -494,7 +494,7 @@ void Resource::makeAppointment(Schedule *node, const DateTime &from, const DateT
//node->resourceNotAvailable = true;
return; // nothing more to do
}
- QPair<DateTime, DateTime> i = cal->firstInterval(time, end);
+ TQPair<DateTime, DateTime> i = cal->firstInterval(time, end);
if (!i.second.isValid()) {
kdWarning()<<k_funcinfo<<"Invalid interval: "<<time<<", "<<end<<endl;
return;
@@ -660,20 +660,20 @@ DateTime Resource::availableBefore(const DateTime &time, const DateTime limit, b
return t;
}
-Resource *Resource::findId(const QString &id) const {
+Resource *Resource::findId(const TQString &id) const {
return m_project ? m_project->findResource(id) : 0;
}
-bool Resource::removeId(const QString &id) {
+bool Resource::removeId(const TQString &id) {
return m_project ? m_project->removeResourceId(id) : false;
}
-void Resource::insertId(const QString &id) {
+void Resource::insertId(const TQString &id) {
if (m_project)
m_project->insertResourceId(id, this);
}
-Calendar *Resource::findCalendar(const QString &id) const {
+Calendar *Resource::findCalendar(const TQString &id) const {
return (m_project ? m_project->findCalendar(id) : 0);
}
@@ -681,7 +681,7 @@ bool Resource::isOverbooked() const {
return isOverbooked(DateTime(), DateTime());
}
-bool Resource::isOverbooked(const QDate &date) const {
+bool Resource::isOverbooked(const TQDate &date) const {
return isOverbooked(DateTime(date), DateTime(date.addDays(1)));
}
@@ -694,14 +694,14 @@ Appointment Resource::appointmentIntervals() const {
Appointment a;
if (m_currentSchedule == 0)
return a;
- QPtrListIterator<Appointment> it = m_currentSchedule->appointments();
+ TQPtrListIterator<Appointment> it = m_currentSchedule->appointments();
for (; it.current(); ++it) {
a += *(it.current());
}
return a;
}
-Duration Resource::plannedEffort(const QDate &date) const {
+Duration Resource::plannedEffort(const TQDate &date) const {
return m_currentSchedule ? m_currentSchedule->plannedEffort(date) : Duration::zeroDuration;
}
@@ -719,17 +719,17 @@ ResourceRequest::ResourceRequest(Resource *resource, int units)
: m_resource(resource),
m_units(units),
m_parent(0) {
- //kdDebug()<<k_funcinfo<<"("<<this<<") Request to: "<<(resource ? resource->name() : QString("None"))<<endl;
+ //kdDebug()<<k_funcinfo<<"("<<this<<") Request to: "<<(resource ? resource->name() : TQString("None"))<<endl;
}
ResourceRequest::~ResourceRequest() {
- //kdDebug()<<k_funcinfo<<"("<<this<<") resource: "<<(m_resource ? m_resource->name() : QString("None"))<<endl;
+ //kdDebug()<<k_funcinfo<<"("<<this<<") resource: "<<(m_resource ? m_resource->name() : TQString("None"))<<endl;
if (m_resource)
m_resource->unregisterRequest(this);
m_resource = 0;
}
-bool ResourceRequest::load(QDomElement &element, Project &project) {
+bool ResourceRequest::load(TQDomElement &element, Project &project) {
//kdDebug()<<k_funcinfo<<endl;
m_resource = project.resource(element.attribute("resource-id"));
if (m_resource == 0) {
@@ -740,8 +740,8 @@ bool ResourceRequest::load(QDomElement &element, Project &project) {
return true;
}
-void ResourceRequest::save(QDomElement &element) const {
- QDomElement me = element.ownerDocument().createElement("resource-request");
+void ResourceRequest::save(TQDomElement &element) const {
+ TQDomElement me = element.ownerDocument().createElement("resource-request");
element.appendChild(me);
me.setAttribute("resource-id", m_resource->id());
me.setAttribute("units", m_units);
@@ -768,7 +768,7 @@ Task *ResourceRequest::task() const {
ResourceGroupRequest::ResourceGroupRequest(ResourceGroup *group, int units)
: m_group(group), m_units(units) {
- //kdDebug()<<k_funcinfo<<"Request to: "<<(group ? group->name() : QString("None"))<<endl;
+ //kdDebug()<<k_funcinfo<<"Request to: "<<(group ? group->name() : TQString("None"))<<endl;
if (group)
group->registerRequest(this);
m_resourceRequests.setAutoDelete(true);
@@ -791,11 +791,11 @@ void ResourceGroupRequest::addResourceRequest(ResourceRequest *request) {
ResourceRequest *ResourceGroupRequest::takeResourceRequest(ResourceRequest *request) {
if (request)
request->unregisterRequest();
- return m_resourceRequests.take(m_resourceRequests.findRef(request));
+ return m_resourceRequests.take(m_resourceRequests.tqfindRef(request));
}
-ResourceRequest *ResourceGroupRequest::find(Resource *resource) const {
- QPtrListIterator<ResourceRequest> it(m_resourceRequests);
+ResourceRequest *ResourceGroupRequest::tqfind(Resource *resource) const {
+ TQPtrListIterator<ResourceRequest> it(m_resourceRequests);
for (; it.current(); ++it)
if (it.current()->resource() == resource)
return it.current();
@@ -803,7 +803,7 @@ ResourceRequest *ResourceGroupRequest::find(Resource *resource) const {
return 0;
}
-bool ResourceGroupRequest::load(QDomElement &element, Project &project) {
+bool ResourceGroupRequest::load(TQDomElement &element, Project &project) {
//kdDebug()<<k_funcinfo<<endl;
m_group = project.findResourceGroup(element.attribute("group-id"));
if (m_group == 0) {
@@ -814,10 +814,10 @@ bool ResourceGroupRequest::load(QDomElement &element, Project &project) {
m_units = element.attribute("units").toInt();
- QDomNodeList list = element.childNodes();
+ TQDomNodeList list = element.childNodes();
for (unsigned int i=0; i<list.count(); ++i) {
if (list.item(i).isElement()) {
- QDomElement e = list.item(i).toElement();
+ TQDomElement e = list.item(i).toElement();
if (e.tagName() == "resource-request") {
ResourceRequest *r = new ResourceRequest();
if (r->load(e, project))
@@ -832,21 +832,21 @@ bool ResourceGroupRequest::load(QDomElement &element, Project &project) {
return true;
}
-void ResourceGroupRequest::save(QDomElement &element) const {
+void ResourceGroupRequest::save(TQDomElement &element) const {
if (units() == 0)
return;
- QDomElement me = element.ownerDocument().createElement("resourcegroup-request");
+ TQDomElement me = element.ownerDocument().createElement("resourcegroup-request");
element.appendChild(me);
me.setAttribute("group-id", m_group->id());
me.setAttribute("units", m_units);
- QPtrListIterator<ResourceRequest> it(m_resourceRequests);
+ TQPtrListIterator<ResourceRequest> it(m_resourceRequests);
for (; it.current(); ++it)
it.current()->save(me);
}
int ResourceGroupRequest::units() const {
int units = m_units;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
units += it.current()->units();
}
@@ -858,7 +858,7 @@ int ResourceGroupRequest::workUnits() const {
int units = 0;
if (m_group->type() == ResourceGroup::Type_Work)
units = m_units;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
units += it.current()->workUnits();
}
@@ -871,7 +871,7 @@ Duration ResourceGroupRequest::effort(const DateTime &time, const Duration &dura
Duration e;
bool sts=false;
if (ok) *ok = sts;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
e += it.current()->resource()->effort(time, duration, backward, &sts);
if (sts && ok) *ok = sts;
@@ -884,7 +884,7 @@ Duration ResourceGroupRequest::effort(const DateTime &time, const Duration &dura
int ResourceGroupRequest::numDays(const DateTime &time, bool backward) const {
DateTime t1, t2 = time;
if (backward) {
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
t1 = it.current()->resource()->availableFrom();
if (!t2.isValid() || t2 > t1)
@@ -893,7 +893,7 @@ int ResourceGroupRequest::numDays(const DateTime &time, bool backward) const {
//kdDebug()<<k_funcinfo<<"bw "<<time.toString()<<": "<<t2.daysTo(time)<<endl;
return t2.daysTo(time);
}
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
t1 = it.current()->resource()->availableUntil();
if (!t2.isValid() || t2 < t1)
@@ -919,7 +919,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e
int nDays = numDays(time, backward) + 1;
for (int i=0; !match && i <= nDays; ++i) {
// days
- end = end.addDays(inc);
+ end = TQDateTime(end.addDays(inc));
e1 = effort(start, d, backward, &sts);
//kdDebug()<<"["<<i<<"of"<<nDays<<"] "<<(backward?"(B)":"(F):")<<" start="<<start<<" e+e1="<<(e+e1).toString()<<" match "<<_effort.toString()<<endl;
if (e + e1 < _effort) {
@@ -937,7 +937,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e
d = Duration(0, 1, 0); // 1 hour
for (int i=0; !match && i < 24; ++i) {
// hours
- end = end.addSecs(inc*60*60);
+ end = TQDateTime(end.addSecs(inc*60*60));
e1 = effort(start, d, backward, &sts);
if (e + e1 < _effort) {
e += e1;
@@ -955,7 +955,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e
d = Duration(0, 0, 1); // 1 minute
for (int i=0; !match && i < 60; ++i) {
//minutes
- end = end.addSecs(inc*60);
+ end = TQDateTime(end.addSecs(inc*60));
e1 = effort(start, d, backward, &sts);
if (e + e1 < _effort) {
e += e1;
@@ -973,7 +973,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e
d = Duration(0, 0, 0, 1); // 1 second
for (int i=0; !match && i < 60 && sts; ++i) {
//seconds
- end = end.addSecs(inc);
+ end = TQDateTime(end.addSecs(inc));
e1 = effort(start, d, backward, &sts);
if (e + e1 < _effort) {
e += e1;
@@ -1017,7 +1017,7 @@ Duration ResourceGroupRequest::duration(const DateTime &time, const Duration &_e
DateTime ResourceGroupRequest::availableAfter(const DateTime &time) {
DateTime start;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
DateTime t = it.current()->resource()->availableAfter(time);
if (t.isValid() && (!start.isValid() || t < start))
@@ -1031,7 +1031,7 @@ DateTime ResourceGroupRequest::availableAfter(const DateTime &time) {
DateTime ResourceGroupRequest::availableBefore(const DateTime &time) {
DateTime end;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
DateTime t = it.current()->resource()->availableBefore(time);
if (t.isValid() && (!end.isValid() || t > end))
@@ -1045,7 +1045,7 @@ DateTime ResourceGroupRequest::availableBefore(const DateTime &time) {
void ResourceGroupRequest::makeAppointments(Schedule *schedule) {
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<ResourceRequest> it = m_resourceRequests;
+ TQPtrListIterator<ResourceRequest> it = m_resourceRequests;
for (; it.current(); ++it) {
it.current()->makeAppointment(schedule);
}
@@ -1075,8 +1075,8 @@ ResourceRequestCollection::~ResourceRequestCollection() {
m_requests.clear();
}
-ResourceGroupRequest *ResourceRequestCollection::find(ResourceGroup *group) const {
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ResourceGroupRequest *ResourceRequestCollection::tqfind(ResourceGroup *group) const {
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
if (it.current()->group() == group)
return it.current(); // we assume only one request to the same group
@@ -1085,23 +1085,23 @@ ResourceGroupRequest *ResourceRequestCollection::find(ResourceGroup *group) cons
}
-ResourceRequest *ResourceRequestCollection::find(Resource *resource) const {
+ResourceRequest *ResourceRequestCollection::tqfind(Resource *resource) const {
ResourceRequest *req = 0;
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; !req && it.current(); ++it) {
- req = it.current()->find(resource);
+ req = it.current()->tqfind(resource);
}
return req;
}
-// bool ResourceRequestCollection::load(QDomElement &element, Project &project) {
+// bool ResourceRequestCollection::load(TQDomElement &element, Project &project) {
// //kdDebug()<<k_funcinfo<<endl;
// return true;
// }
-void ResourceRequestCollection::save(QDomElement &element) const {
+void ResourceRequestCollection::save(TQDomElement &element) const {
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for ( ; it.current(); ++it ) {
it.current()->save(element);
}
@@ -1110,7 +1110,7 @@ void ResourceRequestCollection::save(QDomElement &element) const {
int ResourceRequestCollection::units() const {
//kdDebug()<<k_funcinfo<<endl;
int units = 0;
- QPtrListIterator<ResourceGroupRequest> it = m_requests;
+ TQPtrListIterator<ResourceGroupRequest> it = m_requests;
for (; it.current(); ++it) {
units += it.current()->units();
//kdDebug()<<k_funcinfo<<" Group: "<<it.current()->group()->name()<<" now="<<units<<endl;
@@ -1121,7 +1121,7 @@ int ResourceRequestCollection::units() const {
int ResourceRequestCollection::workUnits() const {
//kdDebug()<<k_funcinfo<<endl;
int units = 0;
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
units += it.current()->workUnits();
}
@@ -1142,7 +1142,7 @@ Duration ResourceRequestCollection::duration(const DateTime &time, const Duratio
int units = workUnits();
if (units == 0)
units = 100; //hmmmm
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
if (it.current()->isEmpty())
continue;
@@ -1161,7 +1161,7 @@ Duration ResourceRequestCollection::duration(const DateTime &time, const Duratio
DateTime ResourceRequestCollection::availableAfter(const DateTime &time) {
DateTime start;
- QPtrListIterator<ResourceGroupRequest> it = m_requests;
+ TQPtrListIterator<ResourceGroupRequest> it = m_requests;
for (; it.current(); ++it) {
DateTime t = it.current()->availableAfter(time);
if (t.isValid() && (!start.isValid() || t < start))
@@ -1175,7 +1175,7 @@ DateTime ResourceRequestCollection::availableAfter(const DateTime &time) {
DateTime ResourceRequestCollection::availableBefore(const DateTime &time) {
DateTime end;
- QPtrListIterator<ResourceGroupRequest> it = m_requests;
+ TQPtrListIterator<ResourceGroupRequest> it = m_requests;
for (; it.current(); ++it) {
DateTime t = it.current()->availableBefore(time);
if (t.isValid() && (!end.isValid() ||t > end))
@@ -1189,7 +1189,7 @@ DateTime ResourceRequestCollection::availableBefore(const DateTime &time) {
void ResourceRequestCollection::makeAppointments(Schedule *schedule) {
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
it.current()->makeAppointments(schedule);
}
@@ -1197,14 +1197,14 @@ void ResourceRequestCollection::makeAppointments(Schedule *schedule) {
void ResourceRequestCollection::reserve(const DateTime &start, const Duration &duration) {
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
it.current()->reserve(start, duration);
}
}
bool ResourceRequestCollection::isEmpty() const {
- QPtrListIterator<ResourceGroupRequest> it(m_requests);
+ TQPtrListIterator<ResourceGroupRequest> it(m_requests);
for (; it.current(); ++it) {
if (!it.current()->isEmpty())
return false;
@@ -1213,18 +1213,18 @@ bool ResourceRequestCollection::isEmpty() const {
}
#ifndef NDEBUG
-void ResourceGroup::printDebug(QString indent)
+void ResourceGroup::printDebug(TQString indent)
{
kdDebug()<<indent<<" + Resource group: "<<m_name<<" id="<<m_id<<endl;
indent += " !";
- QPtrListIterator<Resource> it(m_resources);
+ TQPtrListIterator<Resource> it(m_resources);
for ( ; it.current(); ++it)
it.current()->printDebug(indent);
}
-void Resource::printDebug(QString indent)
+void Resource::printDebug(TQString indent)
{
kdDebug()<<indent<<" + Resource: "<<m_name<<" id="<<m_id/*<<" Overbooked="<<isOverbooked()*/<<endl;
- QIntDictIterator<Schedule> it(m_schedules);
+ TQIntDictIterator<Schedule> it(m_schedules);
indent += " ";
for (; it.current(); ++it) {
it.current()->printDebug(indent);
@@ -1232,25 +1232,25 @@ void Resource::printDebug(QString indent)
indent += " !";
}
-void ResourceGroupRequest::printDebug(QString indent)
+void ResourceGroupRequest::printDebug(TQString indent)
{
kdDebug()<<indent<<" + Request to group: "<<(m_group ? m_group->name() : "None")<<" units="<<m_units<<"%"<<endl;
indent += " !";
- QPtrListIterator<ResourceRequest> it(m_resourceRequests);
+ TQPtrListIterator<ResourceRequest> it(m_resourceRequests);
for (; it.current(); ++it) {
it.current()->printDebug(indent);
}
}
-void ResourceRequest::printDebug(QString indent)
+void ResourceRequest::printDebug(TQString indent)
{
kdDebug()<<indent<<" + Request to resource: "<<(m_resource ? m_resource->name() : "None")<<" units="<<m_units<<"%"<<endl;
}
-void ResourceRequestCollection::printDebug(QString indent)
+void ResourceRequestCollection::printDebug(TQString indent)
{
kdDebug()<<indent<<" + Resource requests:"<<endl;
- QPtrListIterator<ResourceGroupRequest> it = m_requests;
+ TQPtrListIterator<ResourceGroupRequest> it = m_requests;
for (; it.current(); ++it) {
it.current()->printDebug(indent+" ");
}