fixed trap flash issue

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 1926d79309
commit 3182e092df
  1. 9
      src/board/UBBoardController.cpp
  2. 9
      src/web/UBTrapFlashController.cpp

@ -1029,12 +1029,17 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
} }
else else
{ {
QString urlString = url.toString();
int parametersStringPosition = urlString.indexOf("?");
if(parametersStringPosition != -1)
urlString = urlString.left(parametersStringPosition);
// When we fall there, it means that we are dropping something from the web to the board // When we fall there, it means that we are dropping something from the web to the board
sDownloadFileDesc desc; sDownloadFileDesc desc;
desc.modal = true; desc.modal = true;
desc.srcUrl = url.toString(); desc.srcUrl = urlString;
desc.currentSize = 0; desc.currentSize = 0;
desc.name = QFileInfo(url.toString()).fileName(); desc.name = QFileInfo(urlString).fileName();
desc.totalSize = 0; // The total size will be retrieved during the download desc.totalSize = 0; // The total size will be retrieved during the download
desc.pos = pPos; desc.pos = pPos;
desc.size = pSize; desc.size = pSize;

@ -370,6 +370,7 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
QString UBTrapFlashController::generateHtml(const UBWebKitUtils::HtmlObject& pObject, QString UBTrapFlashController::generateHtml(const UBWebKitUtils::HtmlObject& pObject,
const QString& pDirPath, bool pGenerateFile) const QString& pDirPath, bool pGenerateFile)
{ {
qDebug() << pObject.source;
QUrl objectUrl(pObject.source); QUrl objectUrl(pObject.source);
QString objectFullUrl = pObject.source; QString objectFullUrl = pObject.source;
if (!objectUrl.isValid()) if (!objectUrl.isValid())
@ -471,9 +472,13 @@ QString UBTrapFlashController::generateHtml(const UBWebKitUtils::HtmlObject& pOb
QString UBTrapFlashController::widgetNameForObject(UBWebKitUtils::HtmlObject pObject) QString UBTrapFlashController::widgetNameForObject(UBWebKitUtils::HtmlObject pObject)
{ {
int lastSlashIndex = pObject.source.lastIndexOf("/"); QString url = pObject.source;
int parametersIndex = url.indexOf("?");
if(parametersIndex != -1)
url = url.left(parametersIndex);
int lastSlashIndex = url.lastIndexOf("/");
QString result = pObject.source.right(pObject.source.length() - lastSlashIndex); QString result = url.right(url.length() - lastSlashIndex);
result = UBFileSystemUtils::cleanName(result); result = UBFileSystemUtils::cleanName(result);
return result; return result;

Loading…
Cancel
Save