261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
# File 'lib/taskjuggler/daemon/ProjectBroker.rb', line 261
def removeProject(indexOrId)
@projects.synchronize do
if /^[0-9]$/.match(indexOrId)
index = indexOrId.to_i - 1
if index >= 0 && index < @projects.length
return false if p.state == :obsolete
@projects[index].state = :obsolete
return true
end
else
@projects.each do |p|
if indexOrId == p.id
return false if p.state == :obsolete
p.state = :obsolete
return true
end
end
end
end
false
end
|