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
62a82e1d
Commit
62a82e1d
authored
12 years ago
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed deleting default widget
parent
e130379b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+10
-0
UBFeaturesController.h
src/board/UBFeaturesController.h
+2
-0
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+8
-0
No files found.
src/board/UBFeaturesController.cpp
View file @
62a82e1d
...
...
@@ -40,6 +40,10 @@ bool UBFeature::isFolder() const
||
elementType
==
FEATURE_FOLDER
;
}
bool
UBFeature
::
isDeletable
()
const
{
return
elementType
==
FEATURE_ITEM
;
}
UBFeaturesController
::
UBFeaturesController
(
QWidget
*
pParentWidget
)
:
QObject
(
pParentWidget
),
...
...
@@ -281,6 +285,12 @@ QPixmap UBFeaturesController::thumbnailForFile(const QString &path)
return
thumb
;
}
bool
UBFeaturesController
::
isDeletable
(
const
QUrl
&
url
)
{
UBFeatureElementType
type
=
fileTypeFromUrl
(
fileNameFromUrl
(
url
)
);
return
type
==
FEATURE_ITEM
;
}
QPixmap
UBFeaturesController
::
createThumbnail
(
const
QString
&
path
)
{
QString
thumbnailPath
=
UBFileSystemUtils
::
thumbnailPath
(
path
);
...
...
This diff is collapsed.
Click to expand it.
src/board/UBFeaturesController.h
View file @
62a82e1d
...
...
@@ -37,6 +37,7 @@ public:
QString
getVirtualPath
()
const
{
return
virtualPath
+
"/"
+
mName
;
}
UBFeatureElementType
getType
()
const
{
return
elementType
;
}
bool
isFolder
()
const
;
bool
isDeletable
()
const
;
bool
operator
==
(
const
UBFeature
&
f
)
const
;
bool
operator
!=
(
const
UBFeature
&
f
)
const
;
private
:
...
...
@@ -74,6 +75,7 @@ public:
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
QPixmap
thumbnailForFile
(
const
QString
&
path
);
static
bool
isDeletable
(
const
QUrl
&
url
);
private
:
void
initDirectoryTree
();
void
fileSystemScan
(
const
QString
&
currPath
,
const
QString
&
currVirtualPath
);
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesActionBar.cpp
View file @
62a82e1d
...
...
@@ -179,7 +179,9 @@ void UBFeaturesActionBar::dragMoveEvent(QDragMoveEvent *event)
void
UBFeaturesActionBar
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
if
(
event
->
mimeData
()
->
hasFormat
(
"text/uri-list"
))
{
event
->
acceptProposedAction
();
}
}
void
UBFeaturesActionBar
::
dropEvent
(
QDropEvent
*
event
)
...
...
@@ -187,6 +189,12 @@ void UBFeaturesActionBar::dropEvent( QDropEvent *event )
QWidget
*
dest
=
childAt
(
event
->
pos
()
);
if
(
dest
==
mpDeleteBtn
)
{
QList
<
QUrl
>
urls
=
event
->
mimeData
()
->
urls
();
foreach
(
QUrl
url
,
urls
)
{
if
(
!
UBFeaturesController
::
isDeletable
(
url
)
)
return
;
}
event
->
setDropAction
(
Qt
::
MoveAction
);
event
->
accept
();
emit
deleteElements
(
*
event
->
mimeData
()
);
...
...
This diff is collapsed.
Click to expand it.
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