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
604ea2fa
Commit
604ea2fa
authored
May 07, 2012
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some DnD bugs
parent
b5fd37a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+34
-2
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+1
-1
No files found.
src/board/UBFeaturesController.cpp
View file @
604ea2fa
...
...
@@ -429,8 +429,39 @@ UBFeature UBFeaturesController::addDownloadedFile( const QUrl &sourceUrl, const
UBFeature
UBFeaturesController
::
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
)
{
UBFeature
newElement
=
copyItemToFolder
(
url
,
destination
);
/*
UBFeature newElement = copyItemToFolder( url, destination );
deleteItem( url );
return newElement;*/
QString
sourcePath
=
url
.
toLocalFile
();
Q_ASSERT
(
QFileInfo
(
sourcePath
).
exists
()
);
UBFeature
possibleDest
=
getDestinationForItem
(
url
);
UBFeature
dest
=
destination
;
if
(
destination
!=
trashElement
&&
!
destination
.
getFullVirtualPath
().
startsWith
(
possibleDest
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
{
dest
=
possibleDest
;
}
QString
name
=
QFileInfo
(
sourcePath
).
fileName
();
QString
destPath
=
dest
.
getFullPath
().
toLocalFile
();
QString
destVirtualPath
=
dest
.
getFullVirtualPath
();
QString
newFullPath
=
destPath
+
"/"
+
name
;
if
(
sourcePath
.
compare
(
newFullPath
,
Qt
::
CaseInsensitive
)
)
{
QFile
(
sourcePath
).
copy
(
newFullPath
);
deleteItem
(
url
);
}
QPixmap
thumb
=
thumbnailForFile
(
newFullPath
);
UBFeatureElementType
type
=
FEATURE_ITEM
;
if
(
UBFileSystemUtils
::
mimeTypeFromFileName
(
newFullPath
).
contains
(
"application"
)
)
type
=
FEATURE_INTERACTIVE
;
UBFeature
newElement
(
destVirtualPath
,
thumb
,
name
,
QUrl
::
fromLocalFile
(
newFullPath
),
type
);
return
newElement
;
}
...
...
@@ -454,7 +485,8 @@ UBFeature UBFeaturesController::copyItemToFolder( const QUrl &url, const UBFeatu
QString
destPath
=
dest
.
getFullPath
().
toLocalFile
();
QString
destVirtualPath
=
dest
.
getFullVirtualPath
();
QString
newFullPath
=
destPath
+
"/"
+
name
;
QFile
(
sourcePath
).
copy
(
newFullPath
);
if
(
!
sourcePath
.
compare
(
newFullPath
,
Qt
::
CaseInsensitive
)
)
QFile
(
sourcePath
).
copy
(
newFullPath
);
QPixmap
thumb
=
thumbnailForFile
(
newFullPath
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
604ea2fa
...
...
@@ -831,7 +831,7 @@ bool UBFeaturesModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction act
void
UBFeaturesModel
::
addItem
(
const
UBFeature
&
item
)
{
beginInsertRows
(
QModelIndex
(),
featuresList
->
size
(),
featuresList
->
size
()
);
featuresList
->
push_back
(
item
);
featuresList
->
append
(
item
);
endInsertRows
();
}
...
...
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