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
b6088a48
Commit
b6088a48
authored
Nov 19, 2015
by
agriche
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Replace uniboardTool by OpenboardTool.
parent
533c4a57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+18
-11
No files found.
src/board/UBFeaturesController.cpp
View file @
b6088a48
...
@@ -346,6 +346,8 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
...
@@ -346,6 +346,8 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
scanFS
();
scanFS
();
featuresModel
=
new
UBFeaturesModel
(
featuresList
,
this
);
featuresModel
=
new
UBFeaturesModel
(
featuresList
,
this
);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
featuresProxyModel
=
new
UBFeaturesProxyModel
(
this
);
featuresProxyModel
=
new
UBFeaturesProxyModel
(
this
);
featuresProxyModel
->
setFilterFixedString
(
rootPath
);
featuresProxyModel
->
setFilterFixedString
(
rootPath
);
...
@@ -448,7 +450,7 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin
...
@@ -448,7 +450,7 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin
if
(
fullFileName
.
contains
(
".thumbnail."
))
if
(
fullFileName
.
contains
(
".thumbnail."
))
continue
;
continue
;
UBFeature
testFeature
(
currVirtualPath
+
"/"
+
fileName
,
icon
,
fileName
,
QUrl
::
fromLocalFile
(
fullFileName
),
featureType
);
UBFeature
testFeature
(
currVirtualPath
+
"/"
+
fileName
,
icon
,
fileName
,
QUrl
::
fromLocalFile
(
fullFileName
),
featureType
);
featuresList
->
append
(
testFeature
);
featuresList
->
append
(
testFeature
);
...
@@ -620,7 +622,8 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu
...
@@ -620,7 +622,8 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu
QString
UBFeaturesController
::
fileNameFromUrl
(
const
QUrl
&
url
)
QString
UBFeaturesController
::
fileNameFromUrl
(
const
QUrl
&
url
)
{
{
QString
fileName
=
url
.
toString
();
QString
fileName
=
url
.
toString
();
if
(
fileName
.
contains
(
"uniboardTool://"
)
)
//if ( fileName.contains( "uniboardTool://"))
if
(
fileName
.
contains
(
"OpenboardTool://"
))
return
fileName
;
return
fileName
;
return
url
.
toLocalFile
();
return
url
.
toLocalFile
();
}
}
...
@@ -630,7 +633,8 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
...
@@ -630,7 +633,8 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
{
{
QFileInfo
fileInfo
(
path
);
QFileInfo
fileInfo
(
path
);
if
(
path
.
contains
(
"uniboardTool://"
))
//if ( path.contains("uniboardTool://"))
if
(
path
.
contains
(
"OpenboardTool://"
))
return
FEATURE_INTERNAL
;
return
FEATURE_INTERNAL
;
if
(
!
fileInfo
.
exists
())
{
if
(
!
fileInfo
.
exists
())
{
...
@@ -749,17 +753,17 @@ void UBFeaturesController::importImage( const QImage &image, const UBFeature &de
...
@@ -749,17 +753,17 @@ void UBFeaturesController::importImage( const QImage &image, const UBFeature &de
QDateTime
now
=
QDateTime
::
currentDateTime
();
QDateTime
now
=
QDateTime
::
currentDateTime
();
static
int
imageCounter
=
0
;
static
int
imageCounter
=
0
;
mFileName
=
tr
(
"ImportedImage"
)
+
"-"
+
now
.
toString
(
"dd-MM-yyyy hh-mm-ss"
);
mFileName
=
tr
(
"ImportedImage"
)
+
"-"
+
now
.
toString
(
"dd-MM-yyyy hh-mm-ss"
);
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
mFileName
;
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
mFileName
;
if
(
QFile
::
exists
(
filePath
+
".png"
))
if
(
QFile
::
exists
(
filePath
+
".png"
))
mFileName
+=
QString
(
"-[%1]"
).
arg
(
++
imageCounter
);
mFileName
+=
QString
(
"-[%1]"
).
arg
(
++
imageCounter
);
else
else
imageCounter
=
0
;
imageCounter
=
0
;
mFileName
+=
".png"
;
mFileName
+=
".png"
;
}
}
if
(
!
destination
.
getFullVirtualPath
().
startsWith
(
picturesElement
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
if
(
!
destination
.
getFullVirtualPath
().
startsWith
(
picturesElement
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
{
{
...
@@ -860,7 +864,7 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA
...
@@ -860,7 +864,7 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA
QString
fileName
;
QString
fileName
;
QString
filePath
;
QString
filePath
;
//Audio item
//Audio item
if
(
dest
==
picturesElement
)
{
if
(
dest
==
picturesElement
)
{
...
@@ -912,7 +916,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
...
@@ -912,7 +916,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
UBFeature
dest
=
destination
;
UBFeature
dest
=
destination
;
if
(
destination
!=
trashElement
&&
if
(
destination
!=
trashElement
&&
!
destination
.
getFullVirtualPath
().
startsWith
(
possibleDest
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
!
destination
.
getFullVirtualPath
().
startsWith
(
possibleDest
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
{
{
dest
=
possibleDest
;
dest
=
possibleDest
;
...
@@ -929,9 +933,9 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
...
@@ -929,9 +933,9 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
}
}
QImage
thumb
=
getIcon
(
newFullPath
);
QImage
thumb
=
getIcon
(
newFullPath
);
UBFeatureElementType
type
=
FEATURE_ITEM
;
UBFeatureElementType
type
=
FEATURE_ITEM
;
if
(
UBFileSystemUtils
::
mimeTypeFromFileName
(
newFullPath
).
contains
(
"application"
)
)
if
(
UBFileSystemUtils
::
mimeTypeFromFileName
(
newFullPath
).
contains
(
"application"
)
)
type
=
FEATURE_INTERACTIVE
;
type
=
FEATURE_INTERACTIVE
;
UBFeature
newElement
(
destVirtualPath
+
"/"
+
name
,
thumb
,
name
,
QUrl
::
fromLocalFile
(
newFullPath
),
type
);
UBFeature
newElement
(
destVirtualPath
+
"/"
+
name
,
thumb
,
name
,
QUrl
::
fromLocalFile
(
newFullPath
),
type
);
return
newElement
;
return
newElement
;
...
@@ -1041,8 +1045,11 @@ void UBFeaturesController::moveExternalData(const QUrl &url, const UBFeature &de
...
@@ -1041,8 +1045,11 @@ void UBFeaturesController::moveExternalData(const QUrl &url, const UBFeature &de
UBFeature
dest
=
destination
;
UBFeature
dest
=
destination
;
if
(
destination
!=
trashElement
&&
destination
!=
UBFeature
())
if
(
destination
!=
trashElement
&&
destination
!=
UBFeature
()
/*&& !destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive )*/
)
{
dest
=
possibleDest
;
dest
=
possibleDest
;
}
UBFeatureElementType
type
=
fileTypeFromUrl
(
sourcePath
);
UBFeatureElementType
type
=
fileTypeFromUrl
(
sourcePath
);
...
...
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