Skip to content

Commit

Permalink
Escape the dot character.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 14, 2016
1 parent 84f0aab commit ccaec3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Animation/AnimationUtil.h
Expand Up @@ -89,7 +89,7 @@ inline bool isCSV(const std::string& fileIn){
*/
inline std::string assembleXMLFileName(const std::string& modelFile, const std::string& path){
QString fileName(modelFile.c_str());
QRegExp fileTypeRegExp("(.fmu|.mat|.csv|_res.mat|_res.csv)");
QRegExp fileTypeRegExp("(\\.fmu|\\.mat|\\.csv|_res.mat|_res.csv)");
fileName.remove(fileTypeRegExp);
// Construct XML file name
std::string xmlFileName = path + fileName.toStdString() + "_visual.xml";
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Plotting/VariablesWidget.cpp
Expand Up @@ -488,7 +488,7 @@ void VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
SimulationOptions simulationOptions)
{
QString toolTip = tr("Simulation Result File: %1\n%2: %3/%4").arg(fileName).arg(Helper::fileLocation).arg(filePath).arg(fileName);
QRegExp resultTypeRegExp("(.mat|.plt|.csv|_res.mat|_res.plt|_res.csv)");
QRegExp resultTypeRegExp("(\\.mat|\\.plt|\\.csv|_res.mat|_res.plt|_res.csv)");
QString text = QString(fileName).remove(resultTypeRegExp);
QModelIndex index = variablesTreeItemIndex(mpRootVariablesTreeItem);
QVector<QVariant> Variabledata;
Expand Down Expand Up @@ -797,7 +797,7 @@ bool VariableTreeProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &
VariablesTreeItem *pVariablesTreeItem = static_cast<VariablesTreeItem*>(index.internalPointer());
if (pVariablesTreeItem) {
QString variableName = pVariablesTreeItem->getVariableName();
variableName.remove(QRegExp("(_res.mat|_res.plt|_res.csv)"));
variableName.remove(QRegExp("(\\.mat|\\.plt|\\.csv|_res.mat|_res.plt|_res.csv)"));
return variableName.contains(filterRegExp());
} else {
return sourceModel()->data(index).toString().contains(filterRegExp());
Expand Down
Expand Up @@ -383,7 +383,7 @@ bool TVariableTreeProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex
if (pTVariablesTreeItem)
{
QString variableName = pTVariablesTreeItem->getVariableName();
variableName.remove(QRegExp("(_res.mat|_res.plt|_res.csv)"));
variableName.remove(QRegExp("(\\.mat|\\.plt|\\.csv|_res.mat|_res.plt|_res.csv)"));
return variableName.contains(filterRegExp());
}
else
Expand Down

0 comments on commit ccaec3f

Please sign in to comment.