Beispiel #1
0
		void PDFImageService::_setFromParametersMap(const ParametersMap& map)
		{
			// The image
			_key = map.get<string>(PARAMETER_IMAGE);
			ParametersMap::Trim(_key);
			if(_key[0] >= '0' && _key[0] <= '9')
			{	// Font by ID
				try
				{
					RegistryKeyType pageId(lexical_cast<RegistryKeyType>(_key));
					_image = Env::GetOfficialEnv().get<Webpage>(pageId).get();
				}
				catch(bad_lexical_cast&)
				{
					throw RequestException("Bad cast in image id");
				}
				catch(ObjectNotFoundException<Webpage>&)
				{
					throw RequestException("No such image");
				}
			}
			else
			{	// Page by smart URL
				_image = getSite()->getPageBySmartURL(_key);
				if(!_image)
				{
					throw RequestException("No such image");
				}
			}

			// x/y
			_x = map.get<float>(PARAMETER_X);
			_y = map.get<float>(PARAMETER_Y);

			// width/height
			_width = map.getDefault<float>(PARAMETER_WIDTH, 0);
			_height = map.getDefault<float>(PARAMETER_HEIGHT, 0);
		}
Beispiel #2
0
QString MaemoQemuSettingsPage::id() const
{
    return pageId();
}