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
afb18c1e
Commit
afb18c1e
authored
Sep 24, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handled content source url.
Items duplication adapted to new ideology of adding media items on the board.
parent
b86614ed
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
63 additions
and
65 deletions
+63
-65
UBLibraryAPI.cpp
src/api/UBLibraryAPI.cpp
+1
-1
UBWidgetUniboardAPI.cpp
src/api/UBWidgetUniboardAPI.cpp
+1
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+26
-12
UBBoardController.h
src/board/UBBoardController.h
+2
-2
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+1
-1
UBDownloadManager.cpp
src/core/UBDownloadManager.cpp
+5
-4
UBDownloadManager.h
src/core/UBDownloadManager.h
+3
-3
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+1
-1
UBFileSystemUtils.cpp
src/frameworks/UBFileSystemUtils.cpp
+15
-33
UBFileSystemUtils.h
src/frameworks/UBFileSystemUtils.h
+6
-5
UBTrapFlashController.cpp
src/web/UBTrapFlashController.cpp
+1
-1
WBWebTrapWebView.cpp
src/web/browser/WBWebTrapWebView.cpp
+1
-1
No files found.
src/api/UBLibraryAPI.cpp
View file @
afb18c1e
...
...
@@ -40,7 +40,7 @@ UBLibraryAPI::~UBLibraryAPI()
void
UBLibraryAPI
::
addObject
(
QString
pUrl
,
int
width
,
int
height
,
int
x
,
int
y
,
bool
background
)
{
if
(
UBApplication
::
boardController
)
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
pUrl
),
QPointF
(
x
,
y
),
QSize
(
width
,
height
),
background
);
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
pUrl
),
Q
String
(),
Q
PointF
(
x
,
y
),
QSize
(
width
,
height
),
background
);
}
...
...
src/api/UBWidgetUniboardAPI.cpp
View file @
afb18c1e
...
...
@@ -201,7 +201,7 @@ void UBWidgetUniboardAPI::addObject(QString pUrl, int width, int height, int x,
if
(
UBApplication
::
boardController
->
activeScene
()
!=
mScene
)
return
;
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
pUrl
),
QPointF
(
x
,
y
),
QSize
(
width
,
height
),
background
);
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
pUrl
),
Q
String
(),
Q
PointF
(
x
,
y
),
QSize
(
width
,
height
),
background
);
}
...
...
src/board/UBBoardController.cpp
View file @
afb18c1e
...
...
@@ -131,7 +131,7 @@ void UBBoardController::init()
,
this
,
SLOT
(
lastWindowClosed
()));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
downloadModalFinished
()),
this
,
SLOT
(
onDownloadModalFinished
()));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
addDownloadedFileToBoard
(
bool
,
QUrl
,
Q
String
,
QByteArray
,
QPointF
,
QSize
,
bool
)),
this
,
SLOT
(
downloadFinished
(
boo
l
,
QUrl
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)));
connect
(
UBDownloadManager
::
downloadManager
(),
SIGNAL
(
addDownloadedFileToBoard
(
bool
,
QUrl
,
Q
Url
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)),
this
,
SLOT
(
downloadFinished
(
bool
,
QUr
l
,
QUrl
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)));
UBDocumentProxy
*
doc
=
UBPersistenceManager
::
persistenceManager
()
->
createDocument
();
...
...
@@ -562,7 +562,12 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
}
UBMimeType
::
Enum
itemMimeType
;
QString
contentTypeHeader
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
item
->
sourceUrl
().
toLocalFile
());
QString
srcFile
=
item
->
sourceUrl
().
toLocalFile
();
if
(
srcFile
.
isEmpty
())
srcFile
=
item
->
sourceUrl
().
toString
();
QString
contentTypeHeader
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
srcFile
);
if
(
NULL
!=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
commonItem
))
itemMimeType
=
UBMimeType
::
Group
;
else
...
...
@@ -587,6 +592,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
if
(
mitem
)
{
sourceUrl
=
mitem
->
mediaFileUrl
();
downloadURL
(
sourceUrl
,
srcFile
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
,
false
);
}
}
break
;
...
...
@@ -661,7 +667,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
if
(
retItem
)
return
retItem
;
UBItem
*
createdItem
=
downloadFinished
(
true
,
sourceUrl
,
contentTypeHeader
,
pData
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
);
UBItem
*
createdItem
=
downloadFinished
(
true
,
sourceUrl
,
sourceUrl
,
contentTypeHeader
,
pData
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
);
if
(
createdItem
)
{
createdItem
->
setSourceUrl
(
item
->
sourceUrl
());
...
...
@@ -675,6 +681,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
retItem
=
dynamic_cast
<
UBGraphicsItem
*>
(
createdItem
);
}
return
retItem
;
}
...
...
@@ -960,7 +967,7 @@ void UBBoardController::groupButtonClicked()
}
}
void
UBBoardController
::
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
,
const
QSize
&
pSize
,
bool
isBackground
,
bool
internalData
)
void
UBBoardController
::
downloadURL
(
const
QUrl
&
url
,
QString
contentSourceUrl
,
const
QPointF
&
pPos
,
const
QSize
&
pSize
,
bool
isBackground
,
bool
internalData
)
{
qDebug
()
<<
"something has been dropped on the board! Url is: "
<<
url
.
toString
();
QString
sUrl
=
url
.
toString
();
...
...
@@ -971,7 +978,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
if
(
sUrl
.
startsWith
(
"uniboardTool://"
))
{
downloadFinished
(
true
,
url
,
"application/vnd.mnemis-uniboard-tool"
,
QByteArray
(),
pPos
,
pSize
,
isBackground
);
downloadFinished
(
true
,
url
,
QUrl
(),
"application/vnd.mnemis-uniboard-tool"
,
QByteArray
(),
pPos
,
pSize
,
isBackground
);
}
else
if
(
sUrl
.
startsWith
(
"file://"
)
||
sUrl
.
startsWith
(
"/"
))
{
...
...
@@ -988,7 +995,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
{
QFile
file
(
fileName
);
file
.
open
(
QIODevice
::
ReadOnly
);
downloadFinished
(
true
,
formedUrl
,
contentType
,
file
.
readAll
(),
pPos
,
pSize
,
isBackground
,
internalData
);
downloadFinished
(
true
,
formedUrl
,
QUrl
(),
contentType
,
file
.
readAll
(),
pPos
,
pSize
,
isBackground
,
internalData
);
file
.
close
();
}
else
...
...
@@ -998,6 +1005,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
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
...
...
@@ -1036,7 +1044,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
}
UBItem
*
UBBoardController
::
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
UBItem
*
UBBoardController
::
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
Q
Url
contentUrl
,
Q
String
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
,
bool
internalData
)
{
...
...
@@ -1198,7 +1206,10 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
}
if
(
mediaVideoItem
){
mediaVideoItem
->
setSourceUrl
(
sourceUrl
);
if
(
contentUrl
.
isEmpty
())
mediaVideoItem
->
setSourceUrl
(
sourceUrl
);
else
mediaVideoItem
->
setSourceUrl
(
contentUrl
);
mediaVideoItem
->
setUuid
(
uuid
);
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
mediaVideoItem
,
SLOT
(
activeSceneChanged
()));
}
...
...
@@ -1239,7 +1250,10 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
}
if
(
audioMediaItem
){
audioMediaItem
->
setSourceUrl
(
sourceUrl
);
if
(
contentUrl
.
isEmpty
())
audioMediaItem
->
setSourceUrl
(
sourceUrl
);
else
audioMediaItem
->
setSourceUrl
(
contentUrl
);
audioMediaItem
->
setUuid
(
uuid
);
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
audioMediaItem
,
SLOT
(
activeSceneChanged
()));
}
...
...
@@ -2262,7 +2276,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if
(
""
!=
url
)
{
downloadURL
(
url
,
pPos
);
downloadURL
(
url
,
QString
(),
pPos
);
return
;
}
}
...
...
@@ -2282,7 +2296,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
foreach
(
const
QUrl
url
,
urls
){
QPointF
pos
(
pPos
+
QPointF
(
index
*
15
,
index
*
15
));
downloadURL
(
url
,
pos
,
QSize
(),
false
,
internalData
);
downloadURL
(
url
,
QString
(),
pos
,
QSize
(),
false
,
internalData
);
index
++
;
}
...
...
@@ -2308,7 +2322,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
// Sometimes, it is possible to have an URL as text. we check here if it is the case
QString
qsTmp
=
pMimeData
->
text
().
remove
(
QRegExp
(
"[
\\
0]"
));
if
(
qsTmp
.
startsWith
(
"http"
)){
downloadURL
(
QUrl
(
qsTmp
),
pPos
);
downloadURL
(
QUrl
(
qsTmp
),
QString
(),
pPos
);
}
else
{
mActiveScene
->
addTextHtml
(
pMimeData
->
html
(),
pPos
);
...
...
src/board/UBBoardController.h
View file @
afb18c1e
...
...
@@ -193,8 +193,8 @@ class UBBoardController : public UBDocumentContainer
void
firstScene
();
void
lastScene
();
void
groupButtonClicked
();
void
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
=
QPointF
(
0
.
0
,
0
.
0
),
const
QSize
&
pSize
=
QSize
(),
bool
isBackground
=
false
,
bool
internalData
=
false
);
UBItem
*
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pHeader
,
void
downloadURL
(
const
QUrl
&
url
,
QString
contentSourceUrl
=
QString
(),
const
QPointF
&
pPos
=
QPointF
(
0
.
0
,
0
.
0
),
const
QSize
&
pSize
=
QSize
(),
bool
isBackground
=
false
,
bool
internalData
=
false
);
UBItem
*
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
Q
Url
contentUrl
,
Q
String
pHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
=
false
,
bool
internalData
=
false
);
void
changeBackground
(
bool
isDark
,
bool
isCrossed
);
...
...
src/board/UBFeaturesController.cpp
View file @
afb18c1e
...
...
@@ -711,7 +711,7 @@ void UBFeaturesController::addItemToPage(const UBFeature &item)
void
UBFeaturesController
::
addItemAsBackground
(
const
UBFeature
&
item
)
{
UBApplication
::
boardController
->
downloadURL
(
item
.
getFullPath
(),
QPointF
(),
QSize
(),
true
);
UBApplication
::
boardController
->
downloadURL
(
item
.
getFullPath
(),
Q
String
(),
Q
PointF
(),
QSize
(),
true
);
}
UBFeature
UBFeaturesController
::
getDestinationFeatureForUrl
(
const
QUrl
&
url
)
...
...
src/core/UBDownloadManager.cpp
View file @
afb18c1e
...
...
@@ -194,7 +194,8 @@ void UBDownloadManager::onDownloadProgress(int id, qint64 received, qint64 total
* \brief Called when the download of the given file is finished
* @param desc as the current downloaded file description
*/
void
UBDownloadManager
::
onDownloadFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
)
void
UBDownloadManager
::
onDownloadFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QUrl
contentUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
)
{
// Temporary data for dnd do not delete it please
Q_UNUSED
(
pPos
)
...
...
@@ -212,7 +213,7 @@ void UBDownloadManager::onDownloadFinished(int id, bool pSuccess, QUrl sourceUrl
}
else
if
(
desc
.
dest
==
sDownloadFileDesc
::
board
)
{
// The downloaded file is modal so we must put it on the board
emit
addDownloadedFileToBoard
(
pSuccess
,
sourceUrl
,
pContentTypeHeader
,
pData
,
pPos
,
pSize
,
isBackground
);
emit
addDownloadedFileToBoard
(
pSuccess
,
sourceUrl
,
contentUrl
,
pContentTypeHeader
,
pData
,
pPos
,
pSize
,
isBackground
);
}
else
{
...
...
@@ -306,8 +307,8 @@ void UBDownloadManager::startFileDownload(sDownloadFileDesc desc)
if
(
desc
.
srcUrl
.
startsWith
(
"file://"
)
||
desc
.
srcUrl
.
startsWith
(
"/"
))
{
UBAsyncLocalFileDownloader
*
cpHelper
=
new
UBAsyncLocalFileDownloader
(
desc
,
this
);
connect
(
cpHelper
,
SIGNAL
(
signal_asyncCopyFinished
(
int
,
bool
,
QUrl
,
Q
String
,
QByteArray
,
QPointF
,
QSize
,
bool
)),
this
,
SLOT
(
onDownloadFinished
(
int
,
bool
,
QUrl
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)));
cpHelper
->
copyFile
(
QUrl
(
desc
.
srcUrl
).
toLocalFile
(),
QUrl
(
desc
.
dstUrl
).
toLocalFile
(),
true
);
connect
(
cpHelper
,
SIGNAL
(
signal_asyncCopyFinished
(
int
,
bool
,
QUrl
,
Q
Url
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)),
this
,
SLOT
(
onDownloadFinished
(
int
,
bool
,
QUrl
,
QUrl
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)));
cpHelper
->
download
(
);
}
else
{
...
...
src/core/UBDownloadManager.h
View file @
afb18c1e
...
...
@@ -53,7 +53,7 @@ struct sDownloadFileDesc
int
totalSize
;
int
currentSize
;
QString
srcUrl
;
QString
dst
Url
;
QString
originalSrc
Url
;
QString
contentTypeHeader
;
bool
modal
;
QPointF
pos
;
// For board drop only
...
...
@@ -109,7 +109,7 @@ signals:
void
downloadFinished
(
bool
pSuccess
,
int
id
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
);
void
downloadFinished
(
bool
pSuccess
,
sDownloadFileDesc
desc
,
QByteArray
pData
);
void
downloadModalFinished
();
void
addDownloadedFileToBoard
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
addDownloadedFileToBoard
(
bool
pSuccess
,
QUrl
sourceUrl
,
Q
Url
contentUrl
,
Q
String
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
addDownloadedFileToLibrary
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
);
void
cancelAllDownloads
();
void
allDownloadsFinished
();
...
...
@@ -117,7 +117,7 @@ signals:
private
slots
:
void
onUpdateDownloadLists
();
void
onDownloadProgress
(
int
id
,
qint64
received
,
qint64
total
);
void
onDownloadFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
onDownloadFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
Q
Url
contentUrl
,
Q
String
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
onDownloadError
(
int
id
);
private
:
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
afb18c1e
...
...
@@ -195,7 +195,7 @@ void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl)
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
if
(
pAudioWidget
)
{
pAudioWidget
->
setTitle
(
UBFileSystemUtils
::
lastPathComponent
(
pSourceUrl
.
to
String
()));
pAudioWidget
->
setTitle
(
UBFileSystemUtils
::
lastPathComponent
(
pSourceUrl
.
to
LocalFile
()));
}
UBItem
::
setSourceUrl
(
pSourceUrl
);
...
...
src/frameworks/UBFileSystemUtils.cpp
View file @
afb18c1e
...
...
@@ -864,31 +864,14 @@ UBCopyThread::UBCopyThread(QObject *parent)
{
}
void
UBCopyThread
::
copyFile
(
const
QString
&
source
,
const
QString
&
destination
,
bool
overwrite
)
void
UBCopyThread
::
download
(
const
sDownloadFileDesc
&
desc
)
{
if
(
!
QFile
::
exists
(
source
))
{
qDebug
()
<<
"file"
<<
source
<<
"does not present in fs"
;
if
(
!
QFile
::
exists
(
QUrl
(
desc
.
srcUrl
).
toLocalFile
()
))
{
qDebug
()
<<
"file"
<<
desc
.
srcUrl
<<
"does not present in fs"
;
return
;
}
QString
normalizedDestination
=
destination
;
if
(
QFile
::
exists
(
normalizedDestination
))
{
if
(
QFileInfo
(
normalizedDestination
).
isFile
()
&&
overwrite
)
{
QFile
::
remove
(
normalizedDestination
);
}
}
else
{
normalizedDestination
=
normalizedDestination
.
replace
(
QString
(
"
\\
"
),
QString
(
"/"
));
int
pos
=
normalizedDestination
.
lastIndexOf
(
"/"
);
if
(
pos
!=
-
1
)
{
QString
newpath
=
normalizedDestination
.
left
(
pos
);
if
(
!
QDir
().
mkpath
(
newpath
))
{
qDebug
()
<<
"can't create a new path at "
<<
newpath
;
}
}
}
mFrom
=
source
;
mTo
=
normalizedDestination
;
mDesc
=
desc
;
start
();
}
...
...
@@ -896,7 +879,7 @@ void UBCopyThread::copyFile(const QString &source, const QString &destination, b
void
UBCopyThread
::
run
()
{
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
m
From
);
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
m
Desc
.
srcUrl
);
int
position
=
mimeType
.
indexOf
(
";"
);
if
(
position
!=
-
1
)
...
...
@@ -914,13 +897,16 @@ void UBCopyThread::run()
QString
uuid
=
QUuid
::
createUuid
();
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
UBApplication
::
boardController
->
selectedDocument
(),
mFrom
,
QUrl
(
mDesc
.
srcUrl
).
toLocalFile
()
,
destDirectory
,
uuid
,
mTo
,
NULL
);
emit
finished
(
mTo
);
if
(
mDesc
.
originalSrcUrl
.
isEmpty
())
mDesc
.
originalSrcUrl
=
mDesc
.
srcUrl
;
emit
finished
(
mTo
,
mDesc
.
originalSrcUrl
);
}
...
...
@@ -931,18 +917,14 @@ UBAsyncLocalFileDownloader::UBAsyncLocalFileDownloader(sDownloadFileDesc desc, Q
}
void
UBAsyncLocalFileDownloader
::
copyFile
(
QString
&
source
,
QString
&
destination
,
bool
bOverwrite
)
void
UBAsyncLocalFileDownloader
::
download
(
)
{
mFrom
=
source
;
mTo
=
destination
;
UBCopyThread
*
cpThread
=
new
UBCopyThread
(
this
);
// possible memory leak. Delete helper at signal_asyncCopyFinished() handler
connect
(
cpThread
,
SIGNAL
(
finished
(
QString
)),
this
,
SLOT
(
slot_asyncCopyFinished
(
QString
)));
cpThread
->
copyFile
(
source
,
destination
,
bOverwrite
);
connect
(
cpThread
,
SIGNAL
(
finished
(
QString
,
QString
)),
this
,
SLOT
(
slot_asyncCopyFinished
(
QString
,
QString
)));
cpThread
->
download
(
mDesc
);
}
void
UBAsyncLocalFileDownloader
::
slot_asyncCopyFinished
(
QString
res
Url
)
void
UBAsyncLocalFileDownloader
::
slot_asyncCopyFinished
(
QString
srcUrl
,
QString
content
Url
)
{
emit
signal_asyncCopyFinished
(
mDesc
.
id
,
!
resUrl
.
isEmpty
(),
QUrl
(
resUrl
),
""
,
NULL
,
mDesc
.
pos
,
mDesc
.
size
,
mDesc
.
isBackground
);
emit
signal_asyncCopyFinished
(
mDesc
.
id
,
!
srcUrl
.
isEmpty
(),
QUrl
::
fromLocalFile
(
srcUrl
),
QUrl
::
fromLocalFile
(
contentUrl
),
""
,
NULL
,
mDesc
.
pos
,
mDesc
.
size
,
mDesc
.
isBackground
);
}
\ No newline at end of file
src/frameworks/UBFileSystemUtils.h
View file @
afb18c1e
...
...
@@ -29,13 +29,14 @@ class UBCopyThread : public QThread
public
:
explicit
UBCopyThread
(
QObject
*
parent
=
0
);
void
copyFile
(
const
QString
&
source
,
const
QString
&
destination
,
bool
overwrite
);
void
download
(
const
sDownloadFileDesc
&
desc
);
void
run
();
signals
:
void
finished
(
QString
resUrl
);
void
finished
(
QString
srcUrl
,
QString
resUrl
);
private
:
sDownloadFileDesc
mDesc
;
QString
mFrom
;
QString
mTo
;
};
...
...
@@ -47,13 +48,13 @@ class UBAsyncLocalFileDownloader : public QObject
public
:
UBAsyncLocalFileDownloader
(
sDownloadFileDesc
desc
,
QObject
*
parent
=
0
);
void
copyFile
(
QString
&
source
,
QString
&
destination
,
bool
bOverwrite
);
void
download
(
);
public
slots
:
void
slot_asyncCopyFinished
(
QString
resUrl
);
void
slot_asyncCopyFinished
(
QString
srcUrl
,
QString
resUrl
);
signals
:
void
signal_asyncCopyFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
signal_asyncCopyFinished
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
Q
Url
contentUrl
,
Q
String
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
private
:
QString
mFrom
;
...
...
src/web/UBTrapFlashController.cpp
View file @
afb18c1e
...
...
@@ -200,7 +200,7 @@ void UBTrapFlashController::createWidget()
// flash widget
UBWebKitUtils
::
HtmlObject
selectedObject
=
mAvailableFlashes
.
at
(
selectedIndex
-
1
);
UBApplication
::
applicationController
->
showBoard
();
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
selectedObject
.
source
),
QPoint
(
0
,
0
),
QSize
(
selectedObject
.
width
,
selectedObject
.
height
));
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
selectedObject
.
source
),
Q
String
(),
Q
Point
(
0
,
0
),
QSize
(
selectedObject
.
width
,
selectedObject
.
height
));
}
QString
freezedWidgetPath
=
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/freezedWidgetWrapper.html"
;
...
...
src/web/browser/WBWebTrapWebView.cpp
View file @
afb18c1e
...
...
@@ -281,7 +281,7 @@ void WBWebTrapWebView::trapElementAtPos(const QPoint& pos)
emit
objectCaptured
(
QUrl
(
page
()
->
currentFrame
()
->
url
().
toString
()
+
"/"
+
source
),
type
,
htr
.
boundingRect
().
width
(),
htr
.
boundingRect
().
height
());
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
source
)
,
QPointF
(
0.0
,
0.0
)
);
UBApplication
::
boardController
->
downloadURL
(
QUrl
(
source
));
UBApplication
::
applicationController
->
showBoard
();
}
}
...
...
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