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
214e0711
Commit
214e0711
authored
May 03, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some memory-leaks problems detected and fixed
parent
83212cc4
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
133 additions
and
68 deletions
+133
-68
UBExportCFF.cpp
src/adaptors/UBExportCFF.cpp
+1
-0
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+15
-8
UBBoardPaletteManager.h
src/board/UBBoardPaletteManager.h
+8
-0
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+26
-27
UBFeaturesController.h
src/board/UBFeaturesController.h
+4
-3
UBActionableWidget.cpp
src/customWidgets/UBActionableWidget.cpp
+2
-0
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+2
-0
UBAbstractUndoCommand.cpp
src/domain/UBAbstractUndoCommand.cpp
+2
-0
UBAngleWidget.cpp
src/domain/UBAngleWidget.cpp
+2
-0
UBGraphicsItemUndoCommand.cpp
src/domain/UBGraphicsItemUndoCommand.cpp
+2
-2
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+2
-2
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+2
-0
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+2
-1
ubgraphicsgroupcontaineritem.cpp
src/domain/ubgraphicsgroupcontaineritem.cpp
+2
-0
ubgraphicsgroupcontaineritemdelegate.cpp
src/domain/ubgraphicsgroupcontaineritemdelegate.cpp
+2
-1
UBCoreGraphicsScene.cpp
src/frameworks/UBCoreGraphicsScene.cpp
+2
-1
UBDockDownloadWidget.cpp
src/gui/UBDockDownloadWidget.cpp
+2
-0
UBDockTeacherGuideWidget.cpp
src/gui/UBDockTeacherGuideWidget.cpp
+2
-0
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+1
-0
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+25
-14
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+2
-2
UBLibItemProperties.cpp
src/gui/UBLibItemProperties.cpp
+2
-1
UBLibNavigatorWidget.cpp
src/gui/UBLibNavigatorWidget.cpp
+2
-1
UBLibPathViewer.cpp
src/gui/UBLibPathViewer.cpp
+2
-1
UBLibWebView.cpp
src/gui/UBLibWebView.cpp
+1
-2
UBLibWidget.cpp
src/gui/UBLibWidget.cpp
+2
-1
UBPageNavigationWidget.cpp
src/gui/UBPageNavigationWidget.cpp
+2
-1
UBTGWidgetTreeDelegate.cpp
src/gui/UBTGWidgetTreeDelegate.cpp
+2
-0
UBTeacherGuideDelegate.cpp
src/gui/UBTeacherGuideDelegate.cpp
+1
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+2
-0
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+2
-0
CCITTFaxDecode.cpp
src/pdf-merger/CCITTFaxDecode.cpp
+2
-0
DCTDecode.cpp
src/pdf-merger/DCTDecode.cpp
+2
-0
JBIG2Decode.cpp
src/pdf-merger/JBIG2Decode.cpp
+1
-0
UBOEmbedParser.cpp
src/web/UBOEmbedParser.cpp
+2
-0
No files found.
src/adaptors/UBExportCFF.cpp
View file @
214e0711
...
...
@@ -3,6 +3,7 @@
#include "document/UBDocumentProxy.h"
#include "core/UBDocumentManager.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
UBExportCFF
::
UBExportCFF
(
QObject
*
parent
)
...
...
src/board/UBBoardPaletteManager.cpp
View file @
214e0711
...
...
@@ -58,10 +58,10 @@
#include "UBBoardController.h"
#include "core/memcheck.h"
#include "document/UBDocumentController.h"
#include "core/memcheck.h"
UBBoardPaletteManager
::
UBBoardPaletteManager
(
QWidget
*
container
,
UBBoardController
*
pBoardController
)
:
QObject
(
container
)
,
mKeyboardPalette
(
0
)
...
...
@@ -81,7 +81,9 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
,
mPendingPanButtonPressed
(
false
)
,
mPendingEraseButtonPressed
(
false
)
,
mpPageNavigWidget
(
NULL
)
#ifdef USE_WEB_WIDGET
,
mpLibWidget
(
NULL
)
#endif
,
mpCachePropWidget
(
NULL
)
,
mpDownloadWidget
(
NULL
)
,
mpDesktopLibWidget
(
NULL
)
...
...
@@ -132,7 +134,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mpPageNavigWidget
=
new
UBPageNavigationWidget
();
#ifdef USE_WEB_WIDGET
mpLibWidget
=
new
UBLibWidget
();
#endif
mpCachePropWidget
=
new
UBCachePropertiesWidget
();
...
...
@@ -159,8 +163,11 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mRightPalette
->
addTab
(
mpFeaturesWidget
);
//Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget
// mRightPalette->registerWidget(mpLibWidget);
// mRightPalette->addTab(mpLibWidget);
#ifdef USE_WEB_WIDGET
mRightPalette
->
registerWidget
(
mpLibWidget
);
mRightPalette
->
addTab
(
mpLibWidget
);
#endif
// The cache widget will be visible only if a cache is put on the page
...
...
@@ -841,10 +848,10 @@ void UBBoardPaletteManager::addItemToLibrary()
}
QImage
image
=
mPixmap
.
toImage
();
if
(
NULL
!=
mpLibWidget
)
{
mpLibWidget
->
libNavigator
()
->
libraryWidget
()
->
libraryController
()
->
importImageOnLibrary
(
image
);
}
#ifdef USE_WEB_WIDGET
mpLibWidget
->
libNavigator
()
->
libraryWidget
()
->
libraryController
()
->
importImageOnLibrary
(
image
);
#endif
}
else
{
...
...
src/board/UBBoardPaletteManager.h
View file @
214e0711
...
...
@@ -43,6 +43,10 @@ class UBMainWindow;
class
UBApplicationController
;
class
UBDockTeacherGuideWidget
;
// Uncomment this to use old-styles lib paletter
// #define USE_WEB_WIDGET
class
UBBoardPaletteManager
:
public
QObject
{
Q_OBJECT
...
...
@@ -125,8 +129,12 @@ class UBBoardPaletteManager : public QObject
/** The page navigator widget */
UBPageNavigationWidget
*
mpPageNavigWidget
;
#ifdef USE_WEB_WIDGET
/** The library widget */
UBLibWidget
*
mpLibWidget
;
#endif
/** The cache properties widget */
UBCachePropertiesWidget
*
mpCachePropWidget
;
...
...
src/board/UBFeaturesController.cpp
View file @
214e0711
...
...
@@ -18,6 +18,8 @@
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "core/memcheck.h"
UBFeature
::
UBFeature
(
const
QString
&
url
,
const
QPixmap
&
icon
,
const
QString
&
name
,
const
QString
&
realPath
,
UBFeatureElementType
type
)
:
virtualPath
(
url
),
mThumbnail
(
icon
),
mName
(
name
),
mPath
(
realPath
),
elementType
(
type
)
{
...
...
@@ -67,12 +69,10 @@ void UBFeaturesController::initDirectoryTree()
mLibShapesDirectoryPath
=
UBSettings
::
settings
()
->
applicationShapeLibraryDirectory
()
;
trashDirectoryPath
=
UBSettings
::
userTrashDirPath
();
featuresList
=
new
QList
<
UBFeature
>
();
QList
<
UBToolsManager
::
UBToolDescriptor
>
tools
=
UBToolsManager
::
manager
()
->
allTools
();
featuresList
->
append
(
UBFeature
(
QString
(),
QPixmap
(
":images/libpalette/home.png"
),
"root"
,
QString
()
)
);
currentElement
=
featuresList
->
at
(
0
);
featuresList
.
append
(
UBFeature
(
QString
(),
QPixmap
(
":images/libpalette/home.png"
),
"root"
,
QString
()
)
);
currentElement
=
featuresList
.
at
(
0
);
appPath
=
rootPath
+
"/Applications"
;
audiosPath
=
rootPath
+
"/Audios"
;
...
...
@@ -85,30 +85,30 @@ void UBFeaturesController::initDirectoryTree()
favoritePath
=
rootPath
+
"/Favorites"
;
audiosElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/AudiosCategory.svg"
),
"Audios"
,
mUserAudioDirectoryPath
);
featuresList
->
append
(
audiosElement
);
featuresList
.
append
(
audiosElement
);
moviesElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/MoviesCategory.svg"
),
"Movies"
,
mUserVideoDirectoryPath
);
featuresList
->
append
(
moviesElement
);
featuresList
.
append
(
moviesElement
);
picturesElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/PicturesCategory.svg"
),
"Pictures"
,
mUserPicturesDirectoryPath
);
featuresList
->
append
(
picturesElement
);
featuresList
->
append
(
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ApplicationsCategory.svg"
),
"Applications"
,
mUserInteractiveDirectoryPath
)
);
featuresList
.
append
(
picturesElement
);
featuresList
.
append
(
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ApplicationsCategory.svg"
),
"Applications"
,
mUserInteractiveDirectoryPath
)
);
flashElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/FlashCategory.svg"
),
"Animations"
,
mUserAnimationDirectoryPath
);
featuresList
->
append
(
flashElement
);
featuresList
.
append
(
flashElement
);
interactElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/InteractivesCategory.svg"
),
"Interactivities"
,
mLibInteractiveDirectoryPath
);
featuresList
->
append
(
interactElement
);
featuresList
->
append
(
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ShapesCategory.svg"
),
"Shapes"
,
mLibShapesDirectoryPath
)
);
featuresList
.
append
(
interactElement
);
featuresList
.
append
(
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/ShapesCategory.svg"
),
"Shapes"
,
mLibShapesDirectoryPath
)
);
trashElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/TrashCategory.svg"
),
"Trash"
,
trashDirectoryPath
,
FEATURE_TRASH
);
featuresList
->
append
(
trashElement
);
featuresList
.
append
(
trashElement
);
favoriteElement
=
UBFeature
(
rootPath
,
QPixmap
(
":images/libpalette/FavoritesCategory.svg"
),
"Favorites"
,
"favorites"
,
FEATURE_FAVORITE
);
featuresList
->
append
(
favoriteElement
);
featuresList
.
append
(
favoriteElement
);
loadFavoriteList
();
foreach
(
UBToolsManager
::
UBToolDescriptor
tool
,
tools
)
{
featuresList
->
append
(
UBFeature
(
appPath
,
tool
.
icon
,
tool
.
label
,
tool
.
id
,
FEATURE_INTERNAL
)
);
if
(
favoriteSet
->
find
(
tool
.
id
)
!=
favoriteSet
->
end
()
)
featuresList
.
append
(
UBFeature
(
appPath
,
tool
.
icon
,
tool
.
label
,
tool
.
id
,
FEATURE_INTERNAL
)
);
if
(
favoriteSet
.
find
(
tool
.
id
)
!=
favoriteSet
.
end
()
)
{
featuresList
->
append
(
UBFeature
(
favoritePath
,
tool
.
icon
,
tool
.
label
,
tool
.
id
,
FEATURE_INTERNAL
)
);
featuresList
.
append
(
UBFeature
(
favoritePath
,
tool
.
icon
,
tool
.
label
,
tool
.
id
,
FEATURE_INTERNAL
)
);
}
}
fileSystemScan
(
mUserInteractiveDirectoryPath
,
appPath
);
...
...
@@ -163,10 +163,10 @@ void UBFeaturesController::fileSystemScan(const QString & currentPath, const QSt
icon = QPixmap( thumbnailPath );
else icon = createThumbnail( fullFileName );*/
}
featuresList
->
append
(
UBFeature
(
currVirtualPath
,
icon
,
fileName
,
fullFileName
,
fileType
)
);
if
(
favoriteSet
->
find
(
fullFileName
)
!=
favoriteSet
->
end
()
)
featuresList
.
append
(
UBFeature
(
currVirtualPath
,
icon
,
fileName
,
fullFileName
,
fileType
)
);
if
(
favoriteSet
.
find
(
fullFileName
)
!=
favoriteSet
.
end
()
)
{
featuresList
->
append
(
UBFeature
(
favoritePath
,
icon
,
fileName
,
fullFileName
,
fileType
)
);
featuresList
.
append
(
UBFeature
(
favoritePath
,
icon
,
fileName
,
fullFileName
,
fileType
)
);
}
if
(
fileType
==
FEATURE_FOLDER
)
...
...
@@ -179,7 +179,6 @@ void UBFeaturesController::fileSystemScan(const QString & currentPath, const QSt
void
UBFeaturesController
::
loadFavoriteList
()
{
favoriteSet
=
new
QSet
<
QString
>
();
QFile
file
(
UBSettings
::
userDataDirectory
()
+
"/favorites.dat"
);
if
(
file
.
exists
()
)
{
...
...
@@ -196,7 +195,7 @@ void UBFeaturesController::loadFavoriteList()
UBFeature elem( favoritePath, thumbnailForFile( path ), fileName, path, fileTypeFromUrl(path) );
featuresList->append( elem );*/
favoriteSet
->
insert
(
path
);
favoriteSet
.
insert
(
path
);
}
}
}
...
...
@@ -207,8 +206,8 @@ void UBFeaturesController::saveFavoriteList()
file
.
resize
(
0
);
file
.
open
(
QIODevice
::
WriteOnly
);
QDataStream
out
(
&
file
);
out
<<
favoriteSet
->
size
();
for
(
QSet
<
QString
>::
iterator
it
=
favoriteSet
->
begin
();
it
!=
favoriteSet
->
end
();
++
it
)
out
<<
favoriteSet
.
size
();
for
(
QSet
<
QString
>::
iterator
it
=
favoriteSet
.
begin
();
it
!=
favoriteSet
.
end
();
++
it
)
{
out
<<
(
*
it
);
}
...
...
@@ -218,12 +217,12 @@ void UBFeaturesController::saveFavoriteList()
UBFeature
UBFeaturesController
::
addToFavorite
(
const
QUrl
&
path
)
{
QString
filePath
=
fileNameFromUrl
(
path
);
if
(
favoriteSet
->
find
(
filePath
)
==
favoriteSet
->
end
()
)
if
(
favoriteSet
.
find
(
filePath
)
==
favoriteSet
.
end
()
)
{
QFileInfo
fileInfo
(
filePath
);
QString
fileName
=
fileInfo
.
fileName
();
UBFeature
elem
(
favoritePath
,
thumbnailForFile
(
filePath
),
fileName
,
filePath
,
fileTypeFromUrl
(
filePath
)
);
favoriteSet
->
insert
(
filePath
);
favoriteSet
.
insert
(
filePath
);
saveFavoriteList
();
return
elem
;
}
...
...
@@ -233,9 +232,9 @@ UBFeature UBFeaturesController::addToFavorite( const QUrl &path )
void
UBFeaturesController
::
removeFromFavorite
(
const
QUrl
&
path
)
{
QString
filePath
=
fileNameFromUrl
(
path
);
if
(
favoriteSet
->
find
(
filePath
)
!=
favoriteSet
->
end
()
)
if
(
favoriteSet
.
find
(
filePath
)
!=
favoriteSet
.
end
()
)
{
favoriteSet
->
erase
(
favoriteSet
->
find
(
filePath
)
);
favoriteSet
.
erase
(
favoriteSet
.
find
(
filePath
)
);
saveFavoriteList
();
}
}
...
...
src/board/UBFeaturesController.h
View file @
214e0711
...
...
@@ -4,6 +4,7 @@
#include <QMetaType>
#include <QObject>
#include <QWidget>
#include <QSet>
#include <QVector>
#include <QString>
#include <QPixmap>
...
...
@@ -57,7 +58,7 @@ public:
UBFeaturesController
(
QWidget
*
parentWidget
);
virtual
~
UBFeaturesController
();
QList
<
UBFeature
>*
getFeatures
()
const
{
return
featuresList
;
}
const
QList
<
UBFeature
>&
getFeatures
()
const
{
return
featuresList
;
}
const
QString
&
getRootPath
()
const
{
return
rootPath
;
}
...
...
@@ -87,7 +88,7 @@ private:
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
QList
<
UBFeature
>
*
featuresList
;
QList
<
UBFeature
>
featuresList
;
UBFeature
*
rootElement
;
QString
mUserAudioDirectoryPath
;
...
...
@@ -128,7 +129,7 @@ private:
UBFeature
flashElement
;
UBFeature
shapesElement
;
QSet
<
QString
>
*
favoriteSet
;
QSet
<
QString
>
favoriteSet
;
};
...
...
src/customWidgets/UBActionableWidget.cpp
View file @
214e0711
...
...
@@ -18,6 +18,8 @@
#include "UBActionableWidget.h"
#include "core/memcheck.h"
UBActionableWidget
::
UBActionableWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mShowActions
(
false
)
{
...
...
src/customWidgets/UBMediaWidget.cpp
View file @
214e0711
...
...
@@ -16,6 +16,8 @@
#include "globals/UBGlobals.h"
#include "UBMediaWidget.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param type as the media type
...
...
src/domain/UBAbstractUndoCommand.cpp
View file @
214e0711
...
...
@@ -15,6 +15,8 @@
#include "UBAbstractUndoCommand.h"
#include "core/memcheck.h"
UBAbstractUndoCommand
::
UBAbstractUndoCommand
()
{
// NOOP
...
...
src/domain/UBAngleWidget.cpp
View file @
214e0711
#include "UBAngleWidget.h"
#include <QPainter>
#include "core/memcheck.h"
UBAngleWidget
::
UBAngleWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
...
...
src/domain/UBGraphicsItemUndoCommand.cpp
View file @
214e0711
...
...
@@ -19,12 +19,12 @@
#include "UBGraphicsScene.h"
#include "core/memcheck.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsItemUndoCommand
::
UBGraphicsItemUndoCommand
(
UBGraphicsScene
*
pScene
,
const
QSet
<
QGraphicsItem
*>&
pRemovedItems
,
const
QSet
<
QGraphicsItem
*>&
pAddedItems
)
:
mScene
(
pScene
)
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
214e0711
...
...
@@ -23,10 +23,10 @@
#include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
bool
UBGraphicsMediaItem
::
sIsMutedByDefault
=
false
;
UBGraphicsMediaItem
::
UBGraphicsMediaItem
(
const
QUrl
&
pMediaFileUrl
,
QGraphicsItem
*
parent
)
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
214e0711
#include "UBGraphicsStrokesGroup.h"
#include "core/memcheck.h"
UBGraphicsStrokesGroup
::
UBGraphicsStrokesGroup
(
QGraphicsItem
*
parent
)
:
QGraphicsItemGroup
(
parent
)
{
mDelegate
=
new
UBGraphicsItemDelegate
(
this
,
0
,
true
,
true
);
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
214e0711
...
...
@@ -24,9 +24,10 @@
#include "domain/UBGraphicsDelegateFrame.h"
#include "core/UBSettings.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
const
int
UBGraphicsTextItemDelegate
::
sMinPixelSize
=
8
;
const
int
UBGraphicsTextItemDelegate
::
sMinPointSize
=
8
;
...
...
src/domain/ubgraphicsgroupcontaineritem.cpp
View file @
214e0711
...
...
@@ -6,6 +6,8 @@
#include "domain/ubgraphicsgroupcontaineritemdelegate.h"
#include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItem
::
UBGraphicsGroupContainerItem
(
QGraphicsItem
*
parent
)
:
QGraphicsItemGroup
(
parent
)
{
...
...
src/domain/ubgraphicsgroupcontaineritemdelegate.cpp
View file @
214e0711
...
...
@@ -8,9 +8,10 @@
#include "domain/UBGraphicsDelegateFrame.h"
#include "domain/ubgraphicsgroupcontaineritem.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItemDelegate
::
UBGraphicsGroupContainerItemDelegate
(
QGraphicsItem
*
pDelegated
,
QObject
*
parent
)
:
UBGraphicsItemDelegate
(
pDelegated
,
parent
),
mDestroyGroupButton
(
0
)
...
...
src/frameworks/UBCoreGraphicsScene.cpp
View file @
214e0711
...
...
@@ -15,12 +15,13 @@
#include "UBCoreGraphicsScene.h"
#include "core/memcheck.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsMediaItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "core/memcheck.h"
UBCoreGraphicsScene
::
UBCoreGraphicsScene
(
QObject
*
parent
)
:
QGraphicsScene
(
parent
)
{
...
...
src/gui/UBDockDownloadWidget.cpp
View file @
214e0711
...
...
@@ -17,6 +17,8 @@
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
UBDockDownloadWidget
::
UBDockDownloadWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
,
mpLayout
(
NULL
)
,
mpDLWidget
(
NULL
)
...
...
src/gui/UBDockTeacherGuideWidget.cpp
View file @
214e0711
...
...
@@ -19,6 +19,8 @@
#include "UBDockTeacherGuideWidget.h"
#include "UBTeacherGuideWidget.h"
#include "core/memcheck.h"
UBDockTeacherGuideWidget
::
UBDockTeacherGuideWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
...
...
src/gui/UBFeaturesActionBar.cpp
View file @
214e0711
#include "UBFeaturesActionBar.h"
#include "core/memcheck.h"
UBFeaturesActionBar
::
UBFeaturesActionBar
(
UBFeaturesController
*
controller
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
featuresController
(
controller
)
...
...
src/gui/UBFeaturesWidget.cpp
View file @
214e0711
...
...
@@ -6,6 +6,7 @@
#include "core/UBApplication.h"
#include "core/UBDownloadManager.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
UBFeaturesWidget
::
UBFeaturesWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
)
{
...
...
@@ -500,6 +501,16 @@ void UBFeatureProperties::onAddToPage()
UBFeatureProperties
::~
UBFeatureProperties
()
{
if
(
mpOrigPixmap
)
{
delete
mpOrigPixmap
;
mpOrigPixmap
=
NULL
;
}
if
(
mpElement
)
{
delete
mpElement
;
mpElement
=
NULL
;
}
}
UBFeatureItemButton
::
UBFeatureItemButton
(
QWidget
*
parent
,
const
char
*
name
)
:
QPushButton
(
parent
)
...
...
@@ -519,19 +530,19 @@ QVariant UBFeaturesModel::data(const QModelIndex &index, int role) const
return
QVariant
();
if
(
role
==
Qt
::
DisplayRole
)
return
featuresList
->
at
(
index
.
row
()).
getName
();
return
featuresList
.
at
(
index
.
row
()).
getName
();
else
if
(
role
==
Qt
::
DecorationRole
)
{
return
QIcon
(
featuresList
->
at
(
index
.
row
()).
getThumbnail
()
);
return
QIcon
(
featuresList
.
at
(
index
.
row
()).
getThumbnail
()
);
}
else
if
(
role
==
Qt
::
UserRole
)
{
return
featuresList
->
at
(
index
.
row
()).
getUrl
();
return
featuresList
.
at
(
index
.
row
()).
getUrl
();
}
else
if
(
role
==
Qt
::
UserRole
+
1
)
{
//return featuresList->at(index.row()).getType();
UBFeature
f
=
featuresList
->
at
(
index
.
row
());
UBFeature
f
=
featuresList
.
at
(
index
.
row
());
return
QVariant
::
fromValue
(
f
);
}
...
...
@@ -607,17 +618,17 @@ 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
);
beginInsertRows
(
QModelIndex
(),
featuresList
.
size
(),
featuresList
.
size
()
);
featuresList
.
push_back
(
item
);
endInsertRows
();
}
void
UBFeaturesModel
::
deleteFavoriteItem
(
const
QString
&
path
)
{
for
(
int
i
=
0
;
i
<
featuresList
->
size
();
++
i
)
for
(
int
i
=
0
;
i
<
featuresList
.
size
();
++
i
)
{
if
(
!
QString
::
compare
(
featuresList
->
at
(
i
).
getFullPath
(),
path
,
Qt
::
CaseInsensitive
)
&&
!
QString
::
compare
(
featuresList
->
at
(
i
).
getUrl
(),
"/root/favorites"
,
Qt
::
CaseInsensitive
)
)
if
(
!
QString
::
compare
(
featuresList
.
at
(
i
).
getFullPath
(),
path
,
Qt
::
CaseInsensitive
)
&&
!
QString
::
compare
(
featuresList
.
at
(
i
).
getUrl
(),
"/root/favorites"
,
Qt
::
CaseInsensitive
)
)
{
removeRow
(
i
,
QModelIndex
()
);
return
;
...
...
@@ -629,11 +640,11 @@ bool UBFeaturesModel::removeRows( int row, int count, const QModelIndex & parent
{
if
(
row
<
0
)
return
false
;
if
(
row
+
count
>
featuresList
->
size
()
)
if
(
row
+
count
>
featuresList
.
size
()
)
return
false
;
beginRemoveRows
(
parent
,
row
,
row
+
count
-
1
);
//featuresList->remove( row, count );
featuresList
->
erase
(
featuresList
->
begin
()
+
row
,
featuresList
->
begin
()
+
row
+
count
);
featuresList
.
erase
(
featuresList
.
begin
()
+
row
,
featuresList
.
begin
()
+
row
+
count
);
endRemoveRows
();
return
true
;
}
...
...
@@ -642,11 +653,11 @@ bool UBFeaturesModel::removeRow( int row, const QModelIndex & parent )
{
if
(
row
<
0
)
return
false
;
if
(
row
>=
featuresList
->
size
()
)
if
(
row
>=
featuresList
.
size
()
)
return
false
;
beginRemoveRows
(
parent
,
row
,
row
);
//featuresList->remove( row );
featuresList
->
erase
(
featuresList
->
begin
()
+
row
);
featuresList
.
erase
(
featuresList
.
begin
()
+
row
);
endRemoveRows
();
return
true
;
}
...
...
@@ -698,7 +709,7 @@ int UBFeaturesModel::rowCount(const QModelIndex &parent) const
if
(
parent
.
isValid
())
return
0
;
else
return
featuresList
->
size
();
return
featuresList
.
size
();
}
...
...
src/gui/UBFeaturesWidget.h
View file @
214e0711
...
...
@@ -181,9 +181,9 @@ public:
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
void
setFeaturesList
(
QList
<
UBFeature
>
*
flist
)
{
featuresList
=
flist
;
}
void
setFeaturesList
(
const
QList
<
UBFeature
>
&
flist
)
{
featuresList
=
flist
;
}
private
:
QList
<
UBFeature
>
*
featuresList
;
QList
<
UBFeature
>
featuresList
;
};
class
UBFeaturesProxyModel
:
public
QSortFilterProxyModel
...
...
src/gui/UBLibItemProperties.cpp
View file @
214e0711
...
...
@@ -18,12 +18,13 @@
#include "core/UBApplication.h"
#include "core/UBDownloadManager.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
...
...
src/gui/UBLibNavigatorWidget.cpp
View file @
214e0711
...
...
@@ -16,10 +16,11 @@
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
static
int
lowBoundForSlider
=
40
;
static
int
topBoundForSlider
=
120
;
static
int
tickIntervalForSlider
=
10
;
...
...
src/gui/UBLibPathViewer.cpp
View file @
214e0711
...
...
@@ -20,10 +20,11 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "core/UBDownloadManager.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBLibWebView.cpp
View file @
214e0711
#include <QDomDocument>
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
...
...
@@ -9,7 +8,7 @@
#include "UBLibWebView.h"
#include "core/memcheck.h"
UBLibWebView
::
UBLibWebView
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpView
(
NULL
)
...
...
src/gui/UBLibWidget.cpp
View file @
214e0711
...
...
@@ -17,10 +17,11 @@
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBPageNavigationWidget.cpp
View file @
214e0711
...
...
@@ -14,12 +14,13 @@
*/
#include "UBPageNavigationWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBTGWidgetTreeDelegate.cpp
View file @
214e0711
...
...
@@ -7,6 +7,8 @@
#include <QModelIndex>
#include "UBTGWidgetTreeDelegate.h"
#include "core/memcheck.h"
UBTGWidgetTreeDelegate
::
UBTGWidgetTreeDelegate
(
QObject
*
parent
)
:
QStyledItemDelegate
(
parent
)
{
...
...
src/gui/UBTeacherGuideDelegate.cpp
View file @
214e0711
#include "UBTeacherGuideDelegate.h"
#include "core/memcheck.h"
UBTeacherGuideDelegate
::
UBTeacherGuideDelegate
()
{
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
214e0711
...
...
@@ -40,6 +40,8 @@
#include "document/UBDocumentProxy.h"
#include "document/UBDocumentController.h"
#include "core/memcheck.h"
#define UBTG_SEPARATOR_FIXED_HEIGHT 3
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
214e0711
...
...
@@ -32,6 +32,8 @@
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
/***************************************************************************
* class UBAddItem *
...
...
src/pdf-merger/CCITTFaxDecode.cpp
View file @
214e0711
...
...
@@ -16,6 +16,8 @@
#include <QtGlobal>
#include "CCITTFaxDecode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
bool
CCITTFaxDecode
::
encode
(
std
::
string
&
decoded
)
...
...
src/pdf-merger/DCTDecode.cpp
View file @
214e0711
...
...
@@ -16,6 +16,8 @@
#include <QtGlobal>
#include "DCTDecode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
bool
DCTDecode
::
encode
(
std
::
string
&
decoded
)
...
...
src/pdf-merger/JBIG2Decode.cpp
View file @
214e0711
...
...
@@ -15,6 +15,7 @@
#include <QtGlobal>
#include "JBIG2Decode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
...
...
src/web/UBOEmbedParser.cpp
View file @
214e0711
...
...
@@ -24,6 +24,8 @@
#include "UBOEmbedParser.h"
#include "core/memcheck.h"
UBOEmbedParser
::
UBOEmbedParser
(
QObject
*
parent
,
const
char
*
name
)
{
Q_UNUSED
(
parent
);
...
...
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