fixed issue 1203

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 9f387849a8
commit e2e3dc0f24
  1. 4
      src/board/UBBoardController.cpp
  2. 5
      src/frameworks/UBFileSystemUtils.cpp
  3. 2
      src/gui/UBTeacherGuideWidget.cpp

@ -983,8 +983,8 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
} }
else if (sUrl.startsWith("file://") || sUrl.startsWith("/")) else if (sUrl.startsWith("file://") || sUrl.startsWith("/"))
{ {
QString fileName = url.toLocalFile(); QUrl formedUrl = sUrl.startsWith("file://") ? url : QUrl::fromLocalFile(sUrl);
QUrl formedUrl = sUrl.startsWith("file://") ? sUrl : QUrl::fromLocalFile(sUrl); QString fileName = formedUrl.toLocalFile();
QString contentType = UBFileSystemUtils::mimeTypeFromFileName(fileName); QString contentType = UBFileSystemUtils::mimeTypeFromFileName(fileName);
bool shouldLoadFileData = bool shouldLoadFileData =

@ -359,7 +359,7 @@ QString UBFileSystemUtils::thumbnailPath(const QString& path)
QString UBFileSystemUtils::extension(const QString& fileName) QString UBFileSystemUtils::extension(const QString& fileName)
{ {
QString extension; QString extension("");
int lastDotIndex = fileName.lastIndexOf("."); int lastDotIndex = fileName.lastIndexOf(".");
@ -397,6 +397,7 @@ QString UBFileSystemUtils::lastPathComponent(const QString& path)
QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName) QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName)
{ {
Q_ASSERT(fileName.length());
QString ext = extension(fileName); QString ext = extension(fileName);
if (ext == "xls" || ext == "xlsx") return "application/msexcel"; if (ext == "xls" || ext == "xlsx") return "application/msexcel";
@ -853,4 +854,4 @@ QString UBFileSystemUtils::readTextFile(QString path)
} }
return ""; return "";
} }

@ -553,7 +553,7 @@ void UBTeacherGuidePresentationWidget::showData( QVector<tUBGEElementNode*> data
else if (element->name == "action") { else if (element->name == "action") {
QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem); QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem);
newWidgetItem->setText(0, element->attributes.value("task")); 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"; QString colorString = element->attributes.value("owner").toInt() == 0 ? "blue" : "green";
UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem, 0); UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem, 0);
textWidget->bottomMargin(14); textWidget->bottomMargin(14);

Loading…
Cancel
Save