Bug Summary

File:OMOptim/OMOptimBasis/build/../Problems/ProblemInterfaces.cpp
Warning:line 53, column 17
Value stored to 'addedSome' is never read

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1#include "ProblemInterfaces.h"
2#include "Problem.h"
3#include "Result.h"
4#include "ProblemInterface.h"
5
6bool ProblemInterfaces::addProblemInterface(ProblemInterface* itf)
7{
8 QStringList problemNames = itf->problemTypes();
9 bool oneAdded = false;
10 for(int i=0;i<problemNames.size();i++)
11 {
12 if(!this->contains(problemNames.at(i)))
13 {
14 insert(problemNames.at(i),itf);
15 //emit modified();
16 oneAdded = true;
17 }
18 }
19
20 QStringList resultNames = itf->resultTypes();
21 for(int i=0;i<resultNames.size();i++)
22 {
23 if(!this->contains(resultNames.at(i)))
24 {
25 insert(resultNames.at(i),itf);
26 //emit modified();
27 oneAdded = true;
28 }
29 }
30 return oneAdded;
31}
32
33bool ProblemInterfaces::addProblemInterfaces(QList<ProblemInterface*> itfs)
34{
35 bool addedSome = false;
36 bool allOk = true;
37
38 for(int i=0;i<itfs.size();i++)
39 {
40 QStringList problemNames = itfs.at(i)->problemTypes();
41
42 for(int j=0;j<problemNames.size();j++)
43 {
44 if(this->contains(problemNames.at(j)))
45 {
46 allOk=false;
47
48 }
49 else
50 {
51 insert(problemNames.at(j),itfs.at(i));
52 //emit modified();
53 addedSome=true;
Value stored to 'addedSome' is never read
54 }
55 }
56
57 }
58
59 return allOk;
60}
61
62bool ProblemInterfaces::removeProblemInterface(QString interfaceName)
63{
64 int nbRemoved = this->remove(interfaceName);
65 if(nbRemoved>0)
66 {
67 return true;
68 }
69}
70
71
72ProblemInterface* ProblemInterfaces::interfaceOf(Problem* problem)
73{
74 return QMap<QString,ProblemInterface*>::value(problem->getClassName(),NULL__null);
75}
76
77ProblemInterface* ProblemInterfaces::interfaceOf(Result* result)
78{
79 return QMap<QString,ProblemInterface*>::value(result->getClassName(),NULL__null);
80}
81
82ProblemInterface* ProblemInterfaces::interfaceOf(QString caseType)
83{
84 return QMap<QString,ProblemInterface*>::value(caseType,NULL__null);
85}
86
87QList<ProblemInterface*> ProblemInterfaces::uniqueInterfaces()
88{
89 QList<ProblemInterface*> res = QSet<ProblemInterface*>::fromList(values()).toList();
90
91 return res;
92}