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
6f1ef4cd
Commit
6f1ef4cd
authored
May 11, 2012
by
Anna Udovichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some memory leaks
parent
88ad16b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
24 deletions
+69
-24
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+67
-21
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+2
-3
No files found.
src/gui/UBFeaturesWidget.cpp
View file @
6f1ef4cd
...
...
@@ -10,7 +10,7 @@
#include "globals/UBGlobals.h"
#include "board/UBBoardController.h"
UBFeaturesWidget
::
UBFeaturesWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
)
UBFeaturesWidget
::
UBFeaturesWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
)
{
setObjectName
(
name
);
mName
=
"FeaturesWidget"
;
...
...
@@ -82,7 +82,6 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
//pathListView->setMovement( QListView::Static );
pathListView
->
setDragDropMode
(
QAbstractItemView
::
DropOnly
);
pathScene
=
new
QGraphicsScene
(
this
);
//pathViewer = new UBFeaturesPathViewer( QPixmap(":images/libpalette/home.png"), controller->getRootPath(), pathScene, this );
featureProperties
=
new
UBFeatureProperties
(
this
);
webView
=
new
UBFeaturesWebView
(
this
);
...
...
@@ -133,6 +132,15 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
this
,
SLOT
(
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
)
)
);
}
UBFeaturesWidget
::~
UBFeaturesWidget
()
{
if
(
thumbSlider
!=
NULL
)
{
delete
thumbSlider
;
thumbSlider
=
NULL
;
}
}
bool
UBFeaturesWidget
::
eventFilter
(
QObject
*
target
,
QEvent
*
event
)
{
if
(
target
==
featuresListView
&&
event
->
type
()
==
QEvent
::
Resize
)
...
...
@@ -444,9 +452,7 @@ void UBFeaturesWidget::currentPathChanged(const QString &path)
*/
UBFeaturesWidget
::~
UBFeaturesWidget
()
{
}
UBFeaturesListView
::
UBFeaturesListView
(
QWidget
*
parent
,
const
char
*
name
)
:
QListView
(
parent
)
...
...
@@ -537,15 +543,18 @@ UBFeaturesWebView::UBFeaturesWebView(QWidget* parent, const char* name):QWidget(
UBFeaturesWebView
::~
UBFeaturesWebView
()
{
if
(
NULL
!=
mpSankoreAPI
){
if
(
NULL
!=
mpSankoreAPI
)
{
delete
mpSankoreAPI
;
mpSankoreAPI
=
NULL
;
}
if
(
NULL
!=
mpView
){
if
(
NULL
!=
mpView
)
{
delete
mpView
;
mpView
=
NULL
;
}
if
(
NULL
!=
mpLayout
){
if
(
NULL
!=
mpLayout
)
{
delete
mpLayout
;
mpLayout
=
NULL
;
}
...
...
@@ -661,6 +670,55 @@ UBFeatureProperties::UBFeatureProperties( QWidget *parent, const char *name ) :
connect
(
mpAddToLibButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
onAddToLib
()
)
);
}
UBFeatureProperties
::~
UBFeatureProperties
()
{
if
(
mpOrigPixmap
)
{
delete
mpOrigPixmap
;
mpOrigPixmap
=
NULL
;
}
if
(
mpElement
)
{
delete
mpElement
;
mpElement
=
NULL
;
}
if
(
mpThumbnail
)
{
delete
mpThumbnail
;
mpThumbnail
=
NULL
;
}
if
(
mpButtonLayout
)
{
delete
mpButtonLayout
;
mpButtonLayout
=
NULL
;
}
if
(
mpAddPageButton
)
{
delete
mpAddPageButton
;
mpAddPageButton
=
NULL
;
}
if
(
mpSetAsBackgroundButton
)
{
delete
mpSetAsBackgroundButton
;
mpSetAsBackgroundButton
=
NULL
;
}
if
(
mpAddToLibButton
)
{
delete
mpAddToLibButton
;
mpAddToLibButton
=
NULL
;
}
if
(
mpObjInfoLabel
)
{
delete
mpObjInfoLabel
;
mpObjInfoLabel
=
NULL
;
}
if
(
mpObjInfos
)
{
delete
mpObjInfos
;
mpObjInfos
=
NULL
;
}
}
void
UBFeatureProperties
::
resizeEvent
(
QResizeEvent
*
event
)
{
Q_UNUSED
(
event
);
...
...
@@ -787,19 +845,7 @@ void UBFeatureProperties::onSetAsBackground()
featuresWidget
->
getFeaturesController
()
->
addItemAsBackground
(
*
mpElement
);
}
UBFeatureProperties
::~
UBFeatureProperties
()
{
if
(
mpOrigPixmap
)
{
delete
mpOrigPixmap
;
mpOrigPixmap
=
NULL
;
}
if
(
mpElement
)
{
delete
mpElement
;
mpElement
=
NULL
;
}
}
UBFeatureItemButton
::
UBFeatureItemButton
(
QWidget
*
parent
,
const
char
*
name
)
:
QPushButton
(
parent
)
{
...
...
src/gui/UBFeaturesWidget.h
View file @
6f1ef4cd
...
...
@@ -80,7 +80,7 @@ private:
QSlider
*
thumbSlider
;
QVBoxLayout
*
layout
;
//UBFeaturesPathViewer *pathViewer;
QGraphicsScene
*
pathScene
;
//
QGraphicsScene *pathScene;
UBFeaturesActionBar
*
mActionBar
;
UBFeatureProperties
*
featureProperties
;
UBFeaturesWebView
*
webView
;
...
...
@@ -88,7 +88,6 @@ private:
int
currentStackedWidget
;
QModelIndex
trashIndex
;
private
slots
:
void
currentSelected
(
const
QModelIndex
&
);
//void currentPathChanged(const QString &);
...
...
@@ -131,7 +130,7 @@ class UBFeaturesWebView : public QWidget
Q_OBJECT
public
:
UBFeaturesWebView
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBFeaturesWebView"
);
~
UBFeaturesWebView
();
virtual
~
UBFeaturesWebView
();
void
showElement
(
const
UBFeature
&
elem
);
...
...
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