Esempio n. 1
0
	double QueueFileUtils::getNumericInfo(const QueueItemPtr& aItem, int aPropertyName) noexcept {
		switch (aPropertyName) {
		case PROP_SIZE: return (double)aItem->getSize();
		case PROP_BYTES_DOWNLOADED: return (double)QueueManager::getInstance()->getDownloadedBytes(aItem);
		case PROP_PRIORITY: return (double)aItem->getPriority();
		case PROP_TIME_ADDED: return (double)aItem->getTimeAdded();
		case PROP_TIME_FINISHED: return (double)aItem->getTimeFinished();
		case PROP_SPEED: return (double)QueueManager::getInstance()->getAverageSpeed(aItem);
		case PROP_SECONDS_LEFT: return (double)QueueManager::getInstance()->getSecondsLeft(aItem);
		case PROP_BUNDLE: return (double)(aItem->getBundle() ? aItem->getBundle()->getToken() : -1);
		default: dcassert(0); return 0;
		}
	}