mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
bugfix: returning pointer to local variable, char* to string in function definition
This commit is contained in:
parent
618f6291cf
commit
ecf1e9fac1
@ -374,7 +374,7 @@ void qTabAdvanced::SetOutputFile(){
|
||||
//gets the clean absolute path
|
||||
dirPath = dir.absoluteFilePath(dirPath);
|
||||
dirPath = dir.cleanPath(dirPath);
|
||||
QString trimdir = QString(myDet->getSettingsFile()).section('/',0,-2,QString::SectionIncludeLeadingSep);
|
||||
QString trimdir = QString::fromStdString(myDet->getSettingsFile()).section('/',0,-2,QString::SectionIncludeLeadingSep);
|
||||
trimdir = dir.absoluteFilePath(trimdir);
|
||||
trimdir = dir.cleanPath(trimdir);
|
||||
if(!dirPath.compare(trimdir)){
|
||||
|
@ -4067,7 +4067,7 @@ slsDetectorDefs::externalSignalFlag multiSlsDetector::setExternalSignalFlags(ext
|
||||
|
||||
|
||||
|
||||
const char * multiSlsDetector::getSettingsFile() {
|
||||
string multiSlsDetector::getSettingsFile() {
|
||||
|
||||
string s0="", s1="",s ;
|
||||
|
||||
@ -4088,9 +4088,9 @@ const char * multiSlsDetector::getSettingsFile() {
|
||||
}
|
||||
}
|
||||
if (s1=="bad")
|
||||
return s0.c_str();
|
||||
return s0;
|
||||
else
|
||||
return s1.c_str();
|
||||
return s1;
|
||||
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
int64_t getId(idMode mode, int imod=0);
|
||||
int digitalTest(digitalTestMode mode, int imod=0);
|
||||
int executeTrimming(trimMode mode, int par1, int par2, int imod=-1);
|
||||
const char *getSettingsFile();
|
||||
string getSettingsFile();
|
||||
|
||||
|
||||
int decodeNMod(int i, int &idet, int &imod);
|
||||
|
@ -524,13 +524,13 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
/**
|
||||
returns currently the loaded trimfile/settingsfile name
|
||||
*/
|
||||
const char *getSettingsFile(){\
|
||||
string getSettingsFile(){\
|
||||
string s(thisDetector->settingsFile); \
|
||||
if (s.length()>6) {\
|
||||
if (s.substr(s.length()-6,3)==string(".sn") && s.substr(s.length()-3)!=string("xxx") ) \
|
||||
return s.substr(0,s.length()-6).c_str(); \
|
||||
return s.substr(0,s.length()-6); \
|
||||
} \
|
||||
return thisDetector->settingsFile;\
|
||||
return string(thisDetector->settingsFile);\
|
||||
};
|
||||
|
||||
|
||||
|
@ -4508,8 +4508,8 @@ string slsDetectorCommand::cmdSettings(int narg, char *args[], int action) {
|
||||
} else if (action==PUT_ACTION) {
|
||||
myDet->loadSettingsFile(sval,-1);
|
||||
}
|
||||
}//cout<<"settingsfile:"<<myDet->getSettingsFile()<<endl;
|
||||
return string(myDet->getSettingsFile());
|
||||
}
|
||||
return myDet->getSettingsFile();
|
||||
} else if (cmd=="trim") {
|
||||
if (action==GET_ACTION)
|
||||
return string("cannot get!");
|
||||
|
@ -255,7 +255,7 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
||||
/**
|
||||
returns currently the loaded trimfile/settingsfile name
|
||||
*/
|
||||
virtual const char *getSettingsFile()=0;
|
||||
virtual string getSettingsFile()=0;
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user