Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenFlipper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
45a9891c
Commit
45a9891c
authored
Jan 08, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved some code to c files
parent
6010970d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
121 deletions
+45
-121
BasePlugin/AboutInfoInterface.hh
BasePlugin/AboutInfoInterface.hh
+0
-9
common/BaseObject.cc
common/BaseObject.cc
+34
-11
common/BaseObject.hh
common/BaseObject.hh
+8
-49
common/GlobalDefines.hh
common/GlobalDefines.hh
+1
-16
common/Types.hh
common/Types.hh
+1
-19
common/perObjectData.hh
common/perObjectData.hh
+1
-17
No files found.
BasePlugin/AboutInfoInterface.hh
View file @
45a9891c
...
...
@@ -39,15 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 11127 $ *
* $LastChangedBy: moebius $ *
* $Date: 2011-03-15 16:18:28 +0100 (Di, 15 Mär 2011) $ *
* *
\*===========================================================================*/
#pragma once
/** \file AboutInfoInterface.hh
...
...
common/BaseObject.cc
View file @
45a9891c
...
...
@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
...
...
@@ -56,7 +46,6 @@
//
//=============================================================================
#define BASEOBJECT_C
//== INCLUDES =================================================================
...
...
@@ -65,6 +54,9 @@
#include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <QJsonDocument>
#include <QJsonObject>
//== TYPEDEFS =================================================================
...
...
@@ -829,6 +821,37 @@ deleteData() {
}
/** Returns a flat, human readable representation of all comments. */
const
QString
BaseObject
::
getAllCommentsFlat
()
const
{
QStringList
result
;
result
.
append
(
QString
(
"BEGIN Comments for object
\"
%1
\"
"
).
arg
(
name
()));
/*
* Compose JSON parsable object.
*/
QJsonObject
comment_obj
;
for
(
QMap
<
QString
,
QString
>::
const_iterator
it
=
commentsByKey_
.
begin
(),
it_end
=
commentsByKey_
.
end
();
it
!=
it_end
;
++
it
)
{
QJsonParseError
json_error
;
QString
test_json_str
=
QString
::
fromUtf8
(
"{
\"
test
\"
: %1}"
).
arg
(
it
.
value
());
QByteArray
test_json_ba
=
test_json_str
.
toUtf8
();
QJsonDocument
test_json
=
QJsonDocument
::
fromJson
(
test_json_ba
,
&
json_error
);
if
(
json_error
.
error
!=
QJsonParseError
::
NoError
)
{
comment_obj
[
it
.
key
()]
=
it
.
value
();
}
else
{
comment_obj
[
it
.
key
()]
=
test_json
.
object
().
value
(
"test"
);
}
}
result
.
append
(
QString
::
fromUtf8
(
QJsonDocument
(
comment_obj
).
toJson
(
QJsonDocument
::
Indented
)));
result
.
append
(
QString
(
"END Comments for object
\"
%1
\"\n
"
).
arg
(
name
()));
return
result
.
join
(
"
\n
"
);
}
QMap
<
QString
,
PerObjectData
*>&
BaseObject
::
getPerObjectDataMap
()
{
return
dataMap_
;
}
...
...
common/BaseObject.hh
View file @
45a9891c
...
...
@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
...
...
@@ -61,24 +51,24 @@
* This File contains the Basic object class for all Objects (Includes also non visual objects such as Groups).
*/
#ifndef BASEOBJECT_HH
#define BASEOBJECT_HH
#pragma once
//== INCLUDES =================================================================
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/common/DataTypes.hh>
#include <OpenFlipper/common/UpdateType.hh>
#include "perObjectData.hh"
#include <vector>
#include <QObject>
#include <QString>
#include <QList>
#include <QStringList>
#include <vector>
#include <QMap>
#include "perObjectData.hh"
#include <QJsonDocument>
#include <QJsonObject>
//== TYPEDEFS =================================================================
...
...
@@ -588,34 +578,7 @@ class DLLEXPORT BaseObject : public QObject {
}
/** Returns a flat, human readable representation of all comments. */
const
QString
getAllCommentsFlat
()
const
{
QStringList
result
;
result
.
append
(
QString
(
"BEGIN Comments for object
\"
%1
\"
"
).
arg
(
name
()));
/*
* Compose JSON parsable object.
*/
QJsonObject
comment_obj
;
for
(
QMap
<
QString
,
QString
>::
const_iterator
it
=
commentsByKey_
.
begin
(),
it_end
=
commentsByKey_
.
end
();
it
!=
it_end
;
++
it
)
{
QJsonParseError
json_error
;
QString
test_json_str
=
QString
::
fromUtf8
(
"{
\"
test
\"
: %1}"
).
arg
(
it
.
value
());
QByteArray
test_json_ba
=
test_json_str
.
toUtf8
();
QJsonDocument
test_json
=
QJsonDocument
::
fromJson
(
test_json_ba
,
&
json_error
);
if
(
json_error
.
error
!=
QJsonParseError
::
NoError
)
{
comment_obj
[
it
.
key
()]
=
it
.
value
();
}
else
{
comment_obj
[
it
.
key
()]
=
test_json
.
object
().
value
(
"test"
);
}
}
result
.
append
(
QString
::
fromUtf8
(
QJsonDocument
(
comment_obj
).
toJson
(
QJsonDocument
::
Indented
)));
result
.
append
(
QString
(
"END Comments for object
\"
%1
\"\n
"
).
arg
(
name
()));
return
result
.
join
(
"
\n
"
);
}
const
QString
getAllCommentsFlat
()
const
;
private:
QMap
<
QString
,
QString
>
commentsByKey_
;
...
...
@@ -624,7 +587,3 @@ class DLLEXPORT BaseObject : public QObject {
};
//=============================================================================
#endif // BASEOBJECT_HH defined
//=============================================================================
common/GlobalDefines.hh
View file @
45a9891c
...
...
@@ -39,17 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Global defines for OpenFlipper
...
...
@@ -61,8 +50,7 @@
* This File contains the required defines for the OpenFlipper Framework
*/
#ifndef GLOBALDEFINES_HH
#define GLOBALDEFINES_HH
#pragma once
/**
...
...
@@ -115,6 +103,3 @@
#endif
//=============================================================================
#endif // GLOBALDEFINES_HH defined
//=============================================================================
common/Types.hh
View file @
45a9891c
...
...
@@ -39,17 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
...
...
@@ -61,11 +50,7 @@
* This File contains the basic available datatypes in the Framework.
*/
#ifndef TYPES_HH
#define TYPES_HH
#pragma once
//== INCLUDES =================================================================
...
...
@@ -80,6 +65,3 @@
#include "BaseObjectData.hh"
//=============================================================================
#endif // TYPES_HH defined
//=============================================================================
common/perObjectData.hh
View file @
45a9891c
...
...
@@ -39,17 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
...
...
@@ -61,9 +50,7 @@
* This File contains a basic data class used to attach data to objects.
*/
#ifndef PEROBJECTDATA_HH
#define PEROBJECTDATA_HH
#pragma once
//== INCLUDES =================================================================
...
...
@@ -130,6 +117,3 @@ PER_OBJECT_DATA(UIntPerObjectData, unsigned int );
PER_OBJECT_DATA
(
FloatPerObjectData
,
float
);
PER_OBJECT_DATA
(
DoublePerObjectData
,
double
);
//=============================================================================
#endif // PEROBJECTDATA_HH defined
//=============================================================================
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