fixed flash widget bugs. The swf is now copied into the widget

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 15ad5c995e
commit 18587a662f
  1. 23
      src/domain/UBW3CWidget.cpp

@ -222,34 +222,25 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD
if (name.length() == 0) if (name.length() == 0)
name = fi.baseName(); name = fi.baseName();
if (fi.exists()) if (fi.exists()){
{ url = fi.fileName();
QString target = pDir.path() + "/" + fi.fileName();
QFile::copy(url, target);
url = target;
} }
loadNPAPIWrappersTemplates(); loadNPAPIWrappersTemplates();
QString htmlTemplate; QString htmlTemplate;
if (pMimeType.length() > 0 && sNPAPIWrapperTemplates.contains(pMimeType)) if (pMimeType.length() > 0 && sNPAPIWrapperTemplates.contains(pMimeType)){
{
htmlTemplate = sNPAPIWrapperTemplates.value(pMimeType); htmlTemplate = sNPAPIWrapperTemplates.value(pMimeType);
} }
else else {
{
QString extension = UBFileSystemUtils::extension(url); QString extension = UBFileSystemUtils::extension(url);
if (sNPAPIWrapperTemplates.contains(extension)) if (sNPAPIWrapperTemplates.contains(extension))
htmlTemplate = sNPAPIWrapperTemplates.value(extension); htmlTemplate = sNPAPIWrapperTemplates.value(extension);
} }
if (htmlTemplate.length() > 0) if (htmlTemplate.length() > 0){
{
QString sUrl;
htmlTemplate = htmlTemplate.replace(QString("{in.url}"), url) htmlTemplate = htmlTemplate.replace(QString("{in.url}"), url)
.replace(QString("{in.width}"), QString("%1").arg(sizeHint.width())) .replace(QString("{in.width}"), QString("%1").arg(sizeHint.width()))
.replace(QString("{in.height}"), QString("%1").arg(sizeHint.height())); .replace(QString("{in.height}"), QString("%1").arg(sizeHint.height()));
@ -277,6 +268,10 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD
} }
widgetLibraryDir.mkpath(widgetLibraryPath); widgetLibraryDir.mkpath(widgetLibraryPath);
if (fi.exists()) {
QString target = widgetLibraryPath + "/" + fi.fileName();
QFile::copy(pUrl, target);
}
QFile configFile(widgetLibraryPath + "/config.xml"); QFile configFile(widgetLibraryPath + "/config.xml");

Loading…
Cancel
Save