Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
241e770f
Commit
241e770f
authored
Oct 12, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release-candidate' of github.com:Sankore/Sankore-3.1 into release-candidate
parents
233415d2
9b4fb53b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
29 deletions
+26
-29
UBBoardController.cpp
src/board/UBBoardController.cpp
+20
-22
UBDownloadManager.cpp
src/core/UBDownloadManager.cpp
+6
-7
No files found.
src/board/UBBoardController.cpp
View file @
241e770f
...
...
@@ -996,32 +996,30 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
||
contentType
.
startsWith
(
"application/widget"
)
||
contentType
.
startsWith
(
"application/vnd.apple-widget"
);
// TODO: claudio Fix it because it doesn't work with audio/video/flash items dropped from the teacher bar
// if (shouldLoadFileData)
// {
if
(
shouldLoadFileData
)
{
QFile
file
(
fileName
);
file
.
open
(
QIODevice
::
ReadOnly
);
downloadFinished
(
true
,
formedUrl
,
QUrl
(),
contentType
,
file
.
readAll
(),
pPos
,
pSize
,
isBackground
,
internalData
);
file
.
close
();
//
}
//
else
//
{
//
// media items should be copyed in separate thread
//
sDownloadFileDesc desc;
//
desc.modal = false;
//
desc.srcUrl = sUrl;
//
desc.originalSrcUrl = contentSourceUrl;
//
desc.currentSize = 0;
//
desc.name = QFileInfo(url.toString()).fileName();
//
desc.totalSize = 0; // The total size will be retrieved during the download
//
desc.pos = pPos;
//
desc.size = pSize;
//
desc.isBackground = isBackground;
//
UBDownloadManager::downloadManager()->addFileToDownload(desc);
//
}
}
else
{
// media items should be copyed in separate thread
sDownloadFileDesc
desc
;
desc
.
modal
=
false
;
desc
.
srcUrl
=
sUrl
;
desc
.
originalSrcUrl
=
contentSourceUrl
;
desc
.
currentSize
=
0
;
desc
.
name
=
QFileInfo
(
url
.
toString
()).
fileName
();
desc
.
totalSize
=
0
;
// The total size will be retrieved during the download
desc
.
pos
=
pPos
;
desc
.
size
=
pSize
;
desc
.
isBackground
=
isBackground
;
UBDownloadManager
::
downloadManager
()
->
addFileToDownload
(
desc
);
}
}
else
{
...
...
src/core/UBDownloadManager.cpp
View file @
241e770f
...
...
@@ -33,19 +33,18 @@ UBAsyncLocalFileDownloader::UBAsyncLocalFileDownloader(sDownloadFileDesc desc, Q
UBAsyncLocalFileDownloader
*
UBAsyncLocalFileDownloader
::
download
()
{
if
(
!
QFile
::
exists
(
QUrl
(
mDesc
.
srcUrl
).
toLocalFile
()))
{
qDebug
()
<<
"file"
<<
mDesc
.
srcUrl
<<
"does not present in fs"
;
return
this
;
}
start
();
return
this
;
}
void
UBAsyncLocalFileDownloader
::
run
()
{
if
(
mDesc
.
srcUrl
.
startsWith
(
"file://"
))
mDesc
.
srcUrl
=
QUrl
(
mDesc
.
srcUrl
).
toLocalFile
();
else
mDesc
.
srcUrl
=
QUrl
::
fromLocalFile
(
mDesc
.
srcUrl
).
toLocalFile
();
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
mDesc
.
srcUrl
);
int
position
=
mimeType
.
indexOf
(
";"
);
...
...
@@ -67,7 +66,7 @@ void UBAsyncLocalFileDownloader::run()
QString
uuid
=
QUuid
::
createUuid
();
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
UBApplication
::
boardController
->
selectedDocument
(),
QUrl
(
mDesc
.
srcUrl
).
toLocalFile
()
,
mDesc
.
srcUrl
,
destDirectory
,
uuid
,
mTo
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment