Commit e2e3dc0f authored by Claudio Valerio's avatar Claudio Valerio

fixed issue 1203

parent 9f387849
......@@ -983,8 +983,8 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
}
else if (sUrl.startsWith("file://") || sUrl.startsWith("/"))
{
QString fileName = url.toLocalFile();
QUrl formedUrl = sUrl.startsWith("file://") ? sUrl : QUrl::fromLocalFile(sUrl);
QUrl formedUrl = sUrl.startsWith("file://") ? url : QUrl::fromLocalFile(sUrl);
QString fileName = formedUrl.toLocalFile();
QString contentType = UBFileSystemUtils::mimeTypeFromFileName(fileName);
bool shouldLoadFileData =
......
......@@ -359,7 +359,7 @@ QString UBFileSystemUtils::thumbnailPath(const QString& path)
QString UBFileSystemUtils::extension(const QString& fileName)
{
QString extension;
QString extension("");
int lastDotIndex = fileName.lastIndexOf(".");
......@@ -397,6 +397,7 @@ QString UBFileSystemUtils::lastPathComponent(const QString& path)
QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName)
{
Q_ASSERT(fileName.length());
QString ext = extension(fileName);
if (ext == "xls" || ext == "xlsx") return "application/msexcel";
......@@ -853,4 +854,4 @@ QString UBFileSystemUtils::readTextFile(QString path)
}
return "";
}
\ No newline at end of file
}
......@@ -553,7 +553,7 @@ void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data
else if (element->name == "action") {
QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem);
newWidgetItem->setText(0, element->attributes.value("task"));
newWidgetItem->setFlags(Qt::ItemIsEnabled /*| Qt::ItemIsSelectable*/);
newWidgetItem->setFlags(Qt::ItemIsEnabled);
QString colorString = element->attributes.value("owner").toInt() == 0 ? "blue" : "green";
UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem, 0);
textWidget->bottomMargin(14);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment