Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mathias Kraus
abakus
Commits
3603cf6b
Commit
3603cf6b
authored
Dec 07, 2007
by
Michael Pyne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix annoying crash bug in abakus.
svn path=/trunk/playground/utils/abakus/; revision=745799
parent
b1b51767
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
src/function.cpp
src/function.cpp
+5
-8
src/function.h
src/function.h
+1
-1
No files found.
src/function.cpp
View file @
3603cf6b
...
...
@@ -143,7 +143,10 @@ DECLARE_FUNC1(frac, "Fractional part of number");
Function
*
FunctionManager
::
function
(
const
QString
&
name
)
{
return
m_dict
[
name
];
if
(
!
m_dict
.
contains
(
name
))
return
0
;
return
m_dict
.
value
(
name
,
0
);
}
// Returns true if the named identifier is a function, false otherwise.
...
...
@@ -185,14 +188,8 @@ bool FunctionManager::addFunction(BaseFunction *fn, const QString &dependantVar)
fnTabEntry
->
needsTrig
=
false
;
fnTabEntry
->
userDefined
=
true
;
foreach
(
Function
*
func
,
m_dict
)
{
kDebug
()
<<
"Function "
<<
func
->
name
<<
" present.
\n
"
;
}
if
(
m_dict
.
contains
(
fn
->
name
()))
{
Q_ASSERT
(
m_dict
[
fn
->
name
()]
!=
0
);
if
(
m_dict
.
contains
(
fn
->
name
()))
emit
signalFunctionRemoved
(
fn
->
name
());
}
m_dict
.
insert
(
fn
->
name
(),
fnTabEntry
);
emit
signalFunctionAdded
(
fn
->
name
());
...
...
src/function.h
View file @
3603cf6b
...
...
@@ -23,7 +23,7 @@
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QHash>
#include <
QtCore/
QHash>
class
BaseFunction
;
...
...
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