@ -868,6 +868,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
if ( position ! = - 1 )
if ( position ! = - 1 )
mimeType = mimeType . left ( position ) ;
mimeType = mimeType . left ( position ) ;
UBMimeType : : Enum itemMimeType = UBFileSystemUtils : : mimeTypeFromString ( mimeType ) ;
if ( ! pSuccess )
if ( ! pSuccess )
{
{
UBApplication : : showMessage ( tr ( " Downloading content %1 failed " ) . arg ( sourceUrl . toString ( ) ) ) ;
UBApplication : : showMessage ( tr ( " Downloading content %1 failed " ) . arg ( sourceUrl . toString ( ) ) ) ;
@ -877,11 +879,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
if ( ! sourceUrl . toString ( ) . startsWith ( " file:// " ) & & ! sourceUrl . toString ( ) . startsWith ( " uniboardTool:// " ) )
if ( ! sourceUrl . toString ( ) . startsWith ( " file:// " ) & & ! sourceUrl . toString ( ) . startsWith ( " uniboardTool:// " ) )
UBApplication : : showMessage ( tr ( " Download finished " ) ) ;
UBApplication : : showMessage ( tr ( " Download finished " ) ) ;
if ( mimeType = = " image/jpeg "
if ( UBMimeType : : RasterImage = = itemMimeType )
| | mimeType = = " image/png "
| | mimeType = = " image/gif "
| | mimeType = = " image/tiff "
| | mimeType = = " image/bmp " )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as raster image " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as raster image " ;
@ -904,7 +902,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
}
}
else if ( mimeType = = " image/svg+xml " )
else if ( UBMimeType : : VectorImage = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as vecto image " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as vecto image " ;
@ -922,7 +920,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
}
}
else if ( mimeType = = " application/vnd.apple-widget " ) //mime type invented by us :-(
else if ( UBMimeType : : AppleWidget = = itemMimeType ) //mime type invented by us :-(
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as Apple widget " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as Apple widget " ;
@ -946,7 +944,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
}
}
else if ( mimeType = = " application/widget " )
else if ( UBMimeType : : W3CWidget = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as W3C widget " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as W3C widget " ;
QUrl widgetUrl = sourceUrl ;
QUrl widgetUrl = sourceUrl ;
@ -967,7 +965,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
}
}
else if ( mimeType . startsWith ( " video/ " ) )
else if ( UBMimeType : : Video = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as video " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as video " ;
@ -996,7 +994,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
else if ( mimeType . startsWith ( " audio/ " ) )
else if ( UBMimeType : : Audio = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as audio " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as audio " ;
@ -1026,7 +1024,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
UBDrawingController : : drawingController ( ) - > setStylusTool ( UBStylusTool : : Selector ) ;
}
}
else if ( mimeType . startsWith ( " application/x-shockwave-flash " ) )
else if ( UBMimeType : : Flash = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as flash " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as flash " ;
@ -1073,7 +1071,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
delete eduMediaFile ;
delete eduMediaFile ;
}
}
else if ( mimeType . startsWith ( " application/pdf " ) )
else if ( UBMimeType : : PDF = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as PDF " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as PDF " ;
qDebug ( ) < < " pdf data length: " < < pData . size ( ) ;
qDebug ( ) < < " pdf data length: " < < pData . size ( ) ;
@ -1097,7 +1095,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
selectedDocument ( ) - > setMetaData ( UBSettings : : documentUpdatedAt , UBStringUtils : : toUtcIsoDateTime ( QDateTime : : currentDateTime ( ) ) ) ;
selectedDocument ( ) - > setMetaData ( UBSettings : : documentUpdatedAt , UBStringUtils : : toUtcIsoDateTime ( QDateTime : : currentDateTime ( ) ) ) ;
}
}
}
}
else if ( mimeType . startsWith ( " application/vnd.mnemis-uniboard-tool " ) )
else if ( UBMimeType : : UniboardTool = = itemMimeType )
{
{
qDebug ( ) < < " accepting mime type " < < mimeType < < " as Uniboard Tool " ;
qDebug ( ) < < " accepting mime type " < < mimeType < < " as Uniboard Tool " ;