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
828ae227
Commit
828ae227
authored
Oct 04, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deletion from library is more stable.
Imported to library pictures has unique names.
parent
6c5dcd66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
9 deletions
+24
-9
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+15
-3
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+9
-6
No files found.
src/board/UBFeaturesController.cpp
View file @
828ae227
...
...
@@ -641,19 +641,31 @@ void UBFeaturesController::importImage(const QImage &image, const QString &fileN
void
UBFeaturesController
::
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
,
const
QString
&
fileName
)
{
QString
mFileName
=
fileName
;
QString
filePath
;
UBFeature
dest
=
destination
;
if
(
mFileName
.
isNull
())
{
QDateTime
now
=
QDateTime
::
currentDateTime
();
mFileName
=
tr
(
"ImportedImage"
)
+
"-"
+
now
.
toString
(
"dd-MM-yyyy hh-mm-ss"
)
+
".png"
;
static
int
imageCounter
=
0
;
mFileName
=
tr
(
"ImportedImage"
)
+
"-"
+
now
.
toString
(
"dd-MM-yyyy hh-mm-ss"
);
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
mFileName
;
if
(
QFile
::
exists
(
filePath
+
".png"
))
mFileName
+=
QString
(
"-[%1]"
).
arg
(
++
imageCounter
);
else
imageCounter
=
0
;
mFileName
+=
".png"
;
}
UBFeature
dest
=
destination
;
if
(
!
destination
.
getFullVirtualPath
().
startsWith
(
picturesElement
.
getFullVirtualPath
(),
Qt
::
CaseInsensitive
)
)
{
dest
=
picturesElement
;
}
QString
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
mFileName
;
filePath
=
dest
.
getFullPath
().
toLocalFile
()
+
"/"
+
mFileName
;
image
.
save
(
filePath
);
QImage
thumb
=
createThumbnail
(
filePath
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
828ae227
...
...
@@ -169,9 +169,15 @@ void UBFeaturesWidget::deleteElements( const UBFeaturesMimeData * mimeData )
void
UBFeaturesWidget
::
deleteSelectedElements
()
{
QModelIndexList
selected
=
centralWidget
->
listView
()
->
selectionModel
()
->
selectedIndexes
();
do
QList
<
UBFeature
>
featureasToMove
;
for
(
int
i
=
0
;
i
<
selected
.
count
();
i
++
)
{
featureasToMove
.
append
(
controller
->
getFeature
(
selected
.
at
(
i
),
objNameFeatureList
));
}
foreach
(
UBFeature
feature
,
featureasToMove
)
{
UBFeature
feature
=
controller
->
getFeature
(
selected
.
at
(
0
),
objNameFeatureList
);
if
(
feature
.
isDeletable
())
{
if
(
feature
.
inTrash
())
{
controller
->
deleteItem
(
feature
);
...
...
@@ -179,10 +185,7 @@ void UBFeaturesWidget::deleteSelectedElements()
controller
->
moveToTrash
(
feature
,
true
);
}
}
selected
=
centralWidget
->
listView
()
->
selectionModel
()
->
selectedIndexes
();
if
(
!
selected
.
isEmpty
())
centralWidget
->
listView
()
->
selectionModel
()
->
select
(
selected
.
at
(
0
),
QItemSelectionModel
::
Deselect
);
}
while
(
!
selected
.
isEmpty
());
}
controller
->
refreshModels
();
}
...
...
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