diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index c8ec4b2e6..3a6cd2d08 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -38,6 +38,7 @@ #include "core/vapplication.h" #include "../vmisc/undoevent.h" #include "../vmisc/vsettings.h" +#include "../vmisc/def.h" #include "undocommands/renamepp.h" #include "core/vtooloptionspropertybrowser.h" #include "options.h" @@ -427,41 +428,6 @@ void MainWindow::ToggleMSync(bool toggle) } } -//--------------------------------------------------------------------------------------------------------------------- -QString MainWindow::RelativeMPath(const QString &patternPath, const QString &absoluteMPath) const -{ - if (patternPath.isEmpty()) - { - return absoluteMPath; - } - - if (absoluteMPath.isEmpty() || QFileInfo(absoluteMPath).isRelative()) - { - return absoluteMPath; - } - - QDir dir(QFileInfo(patternPath).absoluteDir()); - return dir.relativeFilePath(absoluteMPath); -} - -//--------------------------------------------------------------------------------------------------------------------- -QString MainWindow::AbsoluteMPath(const QString &patternPath, const QString &relativeMPath) const -{ - if (patternPath.isEmpty()) - { - return relativeMPath; - } - else - { - if (relativeMPath.isEmpty() || QFileInfo(relativeMPath).isAbsolute()) - { - return relativeMPath; - } - - return QFileInfo(QFileInfo(patternPath).absoluteDir(), relativeMPath).absoluteFilePath(); - } -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief OptionDraw help change name of pattern piece. @@ -2844,7 +2810,7 @@ void MainWindow::setCurrentFile(const QString &fileName) curFile = fileName; qApp->getUndoStack()->setClean(); - QString shownName = strippedName(curFile); + QString shownName = StrippedName(curFile); if (curFile.isEmpty()) { shownName = tr("untitled.val"); @@ -2880,17 +2846,6 @@ void MainWindow::setCurrentFile(const QString &fileName) setWindowTitle(shownName); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief strippedName the function call around curFile to exclude the path to the file. - * @param fullFileName full path to the file. - * @return file name. - */ -QString MainWindow::strippedName(const QString &fullFileName) -{ - return QFileInfo(fullFileName).fileName(); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief ReadSettings read setting for app. @@ -2963,7 +2918,7 @@ void MainWindow::UpdateRecentFileActions() for (int i = 0; i < numRecentFiles; ++i) { - QString text = QString("&%1. %2").arg(i + 1).arg(strippedName(files.at(i))); + QString text = QString("&%1. %2").arg(i + 1).arg(StrippedName(files.at(i))); recentFileActs[i]->setText(text); recentFileActs[i]->setData(files.at(i)); recentFileActs[i]->setVisible(true); diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 0e7d1d790..0650b337c 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -266,7 +266,6 @@ private: bool SavePattern(const QString &curFile, QString &error); void AutoSavePattern(); void setCurrentFile(const QString &fileName); - QString strippedName(const QString &fullFileName); void ReadSettings(); void WriteSettings(); @@ -305,9 +304,6 @@ private: void ToggleMSync(bool toggle); - QString RelativeMPath(const QString &patternPath, const QString &absoluteMPath) const; - QString AbsoluteMPath(const QString &patternPath, const QString &relativeMPath) const; - bool LoadPattern(const QString &curFile, const QString &customMeasureFile = QString()); void ReopenFilesAfterCrash(QStringList &args); void DoExport(const VCommandLinePtr& expParams); diff --git a/src/libs/vgeometry/varc_p.h b/src/libs/vgeometry/varc_p.h index f5481c2d5..b11f1399c 100644 --- a/src/libs/vgeometry/varc_p.h +++ b/src/libs/vgeometry/varc_p.h @@ -100,6 +100,9 @@ public: bool isFlipped; QString formulaLength; + +private: + VArcData &operator=(const VArcData &) Q_DECL_EQ_DELETE; }; VArcData::~VArcData() diff --git a/src/libs/vgeometry/vgobject_p.h b/src/libs/vgeometry/vgobject_p.h index 7c8a2b409..fb94828c0 100644 --- a/src/libs/vgeometry/vgobject_p.h +++ b/src/libs/vgeometry/vgobject_p.h @@ -69,6 +69,9 @@ public: /** @brief mode object created in calculation or drawing mode */ Draw mode; + +private: + VGObjectData &operator=(const VGObjectData &) Q_DECL_EQ_DELETE; }; VGObjectData::~VGObjectData() diff --git a/src/libs/vgeometry/vpointf_p.h b/src/libs/vgeometry/vpointf_p.h index fd5553ee3..9affe3a94 100644 --- a/src/libs/vgeometry/vpointf_p.h +++ b/src/libs/vgeometry/vpointf_p.h @@ -75,6 +75,9 @@ public: /** @brief _y y coordinate */ qreal _y; + +private: + VPointFData &operator=(const VPointFData &) Q_DECL_EQ_DELETE; }; VPointFData::~VPointFData() diff --git a/src/libs/vgeometry/vspline_p.h b/src/libs/vgeometry/vspline_p.h index a18ec6b4e..c5ed358ba 100644 --- a/src/libs/vgeometry/vspline_p.h +++ b/src/libs/vgeometry/vspline_p.h @@ -113,6 +113,9 @@ public: /** @brief kCurve coefficient of curvature spline. */ qreal kCurve; + +private: + VSplineData &operator=(const VSplineData &) Q_DECL_EQ_DELETE; }; VSplineData::~VSplineData() diff --git a/src/libs/vgeometry/vsplinepath_p.h b/src/libs/vgeometry/vsplinepath_p.h index cf6dcd319..2c33ad8d4 100644 --- a/src/libs/vgeometry/vsplinepath_p.h +++ b/src/libs/vgeometry/vsplinepath_p.h @@ -63,6 +63,9 @@ public: * @brief kCurve coefficient of curvature spline. */ qreal kCurve; + +private: + VSplinePathData &operator=(const VSplinePathData &) Q_DECL_EQ_DELETE; }; VSplinePathData::~VSplinePathData() diff --git a/src/libs/vgeometry/vsplinepoint_p.h b/src/libs/vgeometry/vsplinepoint_p.h index 8af4af3c2..83a64e15c 100644 --- a/src/libs/vgeometry/vsplinepoint_p.h +++ b/src/libs/vgeometry/vsplinepoint_p.h @@ -78,6 +78,9 @@ public: /** @brief kAsm2 coefficient of length second control line. */ qreal kAsm2; + +private: + VSplinePointData &operator=(const VSplinePointData &) Q_DECL_EQ_DELETE; }; VSplinePointData::~VSplinePointData() diff --git a/src/libs/vlayout/vabstractdetail_p.h b/src/libs/vlayout/vabstractdetail_p.h index 57ee2c96b..e59d6f159 100644 --- a/src/libs/vlayout/vabstractdetail_p.h +++ b/src/libs/vlayout/vabstractdetail_p.h @@ -63,6 +63,9 @@ public: bool closed; /** @brief width value seamAllowance in mm. */ qreal width; + +private: + VAbstractDetailData &operator=(const VAbstractDetailData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h index 6d4f8d262..7eec46b3b 100644 --- a/src/libs/vlayout/vcontour_p.h +++ b/src/libs/vlayout/vcontour_p.h @@ -65,6 +65,9 @@ public: int paperWidth; quint32 shift; + +private: + VContourData &operator=(const VContourData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vlayoutdetail_p.h b/src/libs/vlayout/vlayoutdetail_p.h index 1e469d6c4..8a008ac80 100644 --- a/src/libs/vlayout/vlayoutdetail_p.h +++ b/src/libs/vlayout/vlayoutdetail_p.h @@ -71,6 +71,9 @@ public: qreal layoutWidth; bool mirror; + +private: + VLayoutDetailData &operator=(const VLayoutDetailData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index d047e0f47..c6423b573 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -74,6 +74,9 @@ public: bool rotate; int rotationIncrease; bool saveLength; + +private: + VLayoutPaperData &operator=(const VLayoutPaperData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 4a98338d2..4dcc015af 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -31,6 +31,7 @@ #include "../vpatterndb/vtranslatevars.h" #include +#include // Keep synchronize all names with initialization in VTranslateVars class!!!!! //measurements @@ -1670,3 +1671,51 @@ QString MapDiagrams(const QString &number) return QString(); } + +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief strippedName the function call around curFile to exclude the path to the file. + * @param fullFileName full path to the file. + * @return file name. + */ +QString StrippedName(const QString &fullFileName) +{ + return QFileInfo(fullFileName).fileName(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString RelativeMPath(const QString &patternPath, const QString &absoluteMPath) +{ + if (patternPath.isEmpty()) + { + return absoluteMPath; + } + + if (absoluteMPath.isEmpty() || QFileInfo(absoluteMPath).isRelative()) + { + return absoluteMPath; + } + + QDir dir(QFileInfo(patternPath).absoluteDir()); + return dir.relativeFilePath(absoluteMPath); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString AbsoluteMPath(const QString &patternPath, const QString &relativeMPath) +{ + if (patternPath.isEmpty()) + { + return relativeMPath; + } + else + { + if (relativeMPath.isEmpty() || QFileInfo(relativeMPath).isAbsolute()) + { + return relativeMPath; + } + + return QFileInfo(QFileInfo(patternPath).absoluteDir(), relativeMPath).absoluteFilePath(); + } + + return QString();// should never reach +} diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 5dac1081a..5bfa30d26 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -587,4 +587,8 @@ void CheckFactor(qreal &oldFactor, const qreal &Newfactor); QStringList SupportedLocales(); QStringList AllGroupNames(); +QString StrippedName(const QString &fullFileName); +QString RelativeMPath(const QString &patternPath, const QString &absoluteMPath); +QString AbsoluteMPath(const QString &patternPath, const QString &relativeMPath); + #endif // DEF_H diff --git a/src/libs/vpatterndb/variables/varcradius_p.h b/src/libs/vpatterndb/variables/varcradius_p.h index 6bd9f8310..cba6d7a40 100644 --- a/src/libs/vpatterndb/variables/varcradius_p.h +++ b/src/libs/vpatterndb/variables/varcradius_p.h @@ -55,6 +55,9 @@ public: virtual ~VArcRadiusData() Q_DECL_OVERRIDE; quint32 arcId; + +private: + VArcRadiusData &operator=(const VArcRadiusData &) Q_DECL_EQ_DELETE; }; VArcRadiusData::~VArcRadiusData() diff --git a/src/libs/vpatterndb/variables/vcurvevariable_p.h b/src/libs/vpatterndb/variables/vcurvevariable_p.h index ad7224ccf..bf3152ce9 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable_p.h +++ b/src/libs/vpatterndb/variables/vcurvevariable_p.h @@ -58,6 +58,9 @@ public: quint32 id; quint32 parentId; + +private: + VCurveVariableData &operator=(const VCurveVariableData &) Q_DECL_EQ_DELETE; }; VCurveVariableData::~VCurveVariableData() diff --git a/src/libs/vpatterndb/variables/vincrement_p.h b/src/libs/vpatterndb/variables/vincrement_p.h index 29c6c8317..aa1a2ecc4 100644 --- a/src/libs/vpatterndb/variables/vincrement_p.h +++ b/src/libs/vpatterndb/variables/vincrement_p.h @@ -62,6 +62,9 @@ public: QString formula; bool formulaOk; VContainer data; + +private: + VIncrementData &operator=(const VIncrementData &) Q_DECL_EQ_DELETE; }; VIncrementData::~VIncrementData() diff --git a/src/libs/vpatterndb/variables/vinternalvariable_p.h b/src/libs/vpatterndb/variables/vinternalvariable_p.h index 7a61c2d89..b3f9c5b5d 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable_p.h +++ b/src/libs/vpatterndb/variables/vinternalvariable_p.h @@ -57,6 +57,9 @@ public: qreal value; QString name; + +private: + VInternalVariableData &operator=(const VInternalVariableData &) Q_DECL_EQ_DELETE; }; VInternalVariableData::~VInternalVariableData() diff --git a/src/libs/vpatterndb/variables/vlineangle_p.h b/src/libs/vpatterndb/variables/vlineangle_p.h index 0acb1c192..aec3948f0 100644 --- a/src/libs/vpatterndb/variables/vlineangle_p.h +++ b/src/libs/vpatterndb/variables/vlineangle_p.h @@ -58,6 +58,9 @@ public: quint32 p1Id; quint32 p2Id; + +private: + VLineAngleData &operator=(const VLineAngleData &) Q_DECL_EQ_DELETE; }; VLineAngleData::~VLineAngleData() diff --git a/src/libs/vpatterndb/variables/vlinelength_p.h b/src/libs/vpatterndb/variables/vlinelength_p.h index 8d149e48c..2a38a2736 100644 --- a/src/libs/vpatterndb/variables/vlinelength_p.h +++ b/src/libs/vpatterndb/variables/vlinelength_p.h @@ -59,6 +59,9 @@ public: quint32 p1Id; quint32 p2Id; Unit patternUnit; + +private: + VLengthLineData &operator=(const VLengthLineData &) Q_DECL_EQ_DELETE; }; VLengthLineData::~VLengthLineData() diff --git a/src/libs/vpatterndb/variables/vmeasurement_p.h b/src/libs/vpatterndb/variables/vmeasurement_p.h index 96ec10969..c75828228 100644 --- a/src/libs/vpatterndb/variables/vmeasurement_p.h +++ b/src/libs/vpatterndb/variables/vmeasurement_p.h @@ -65,6 +65,9 @@ public: QString gui_text; QString _tagName; bool formulaOk; + +private: + VMeasurementData &operator=(const VMeasurementData &) Q_DECL_EQ_DELETE; }; VMeasurementData::~VMeasurementData() diff --git a/src/libs/vpatterndb/variables/vvariable_p.h b/src/libs/vpatterndb/variables/vvariable_p.h index 9f948dce7..01e17d4f5 100644 --- a/src/libs/vpatterndb/variables/vvariable_p.h +++ b/src/libs/vpatterndb/variables/vvariable_p.h @@ -75,6 +75,9 @@ public: qreal baseSize; qreal baseHeight; + +private: + VVariableData &operator=(const VVariableData &) Q_DECL_EQ_DELETE; }; VVariableData::~VVariableData() diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index 29cac76c4..094c1cb5e 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -84,6 +84,9 @@ public: const VTranslateVars *trVars; const Unit *patternUnit; + +private: + VContainerData &operator=(const VContainerData &) Q_DECL_EQ_DELETE; }; #if defined(Q_CC_INTEL) diff --git a/src/libs/vpatterndb/vdetail_p.h b/src/libs/vpatterndb/vdetail_p.h index d8c45f90b..72aff357a 100644 --- a/src/libs/vpatterndb/vdetail_p.h +++ b/src/libs/vpatterndb/vdetail_p.h @@ -66,6 +66,9 @@ public: /** @brief my bias y axis. */ qreal my; + +private: + VDetailData &operator=(const VDetailData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/libs/vpatterndb/vnodedetail_p.h b/src/libs/vpatterndb/vnodedetail_p.h index 0490a603d..82d634469 100644 --- a/src/libs/vpatterndb/vnodedetail_p.h +++ b/src/libs/vpatterndb/vnodedetail_p.h @@ -79,6 +79,9 @@ public: * @brief reverse true if need reverse points list for node. */ bool reverse; + +private: + VNodeDetailData &operator=(const VNodeDetailData &) Q_DECL_EQ_DELETE; }; #ifdef Q_CC_GNU diff --git a/src/test/ValentinaTest/ValentinaTest.pro b/src/test/ValentinaTest/ValentinaTest.pro index 8c2e09243..13cf5a921 100644 --- a/src/test/ValentinaTest/ValentinaTest.pro +++ b/src/test/ValentinaTest/ValentinaTest.pro @@ -49,7 +49,8 @@ SOURCES += \ tst_qmutokenparser.cpp \ tst_vmeasurements.cpp \ tst_qmuparsererrormsg.cpp \ - tst_vlockguard.cpp + tst_vlockguard.cpp \ + tst_misc.cpp HEADERS += \ tst_vposter.h \ @@ -66,7 +67,8 @@ HEADERS += \ tst_qmutokenparser.h \ tst_vmeasurements.h \ tst_qmuparsererrormsg.h \ - tst_vlockguard.h + tst_vlockguard.h \ + tst_misc.h # Set using ccache. Function enable_ccache() defined in common.pri. $$enable_ccache() diff --git a/src/test/ValentinaTest/qttestmainlambda.cpp b/src/test/ValentinaTest/qttestmainlambda.cpp index 6e197e22f..76fb6a09e 100644 --- a/src/test/ValentinaTest/qttestmainlambda.cpp +++ b/src/test/ValentinaTest/qttestmainlambda.cpp @@ -41,6 +41,7 @@ #include "tst_vmeasurements.h" #include "tst_qmuparsererrormsg.h" #include "tst_vlockguard.h" +#include "tst_misc.h" int main(int argc, char** argv) { @@ -68,6 +69,7 @@ int main(int argc, char** argv) ASSERT_TEST(new TST_VMeasurements()); ASSERT_TEST(new TST_QmuParserErrorMsg()); ASSERT_TEST(new TST_VLockGuard()); + ASSERT_TEST(new TST_Misc()); return status; } diff --git a/src/test/ValentinaTest/tst_misc.cpp b/src/test/ValentinaTest/tst_misc.cpp new file mode 100644 index 000000000..f5b4ff4f0 --- /dev/null +++ b/src/test/ValentinaTest/tst_misc.cpp @@ -0,0 +1,132 @@ +/************************************************************************ + ** + ** @file tst_misc.cpp + ** @author Roman Telezhynskyi + ** @date 31 10, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#include "tst_misc.h" +#include "../vmisc/def.h" + +#include + +//--------------------------------------------------------------------------------------------------------------------- +TST_Misc::TST_Misc(QObject *parent) + :QObject(parent) +{ +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_Misc::TestRelativeFilePath_data() +{ + QTest::addColumn("patternPath"); + QTest::addColumn("absoluteMPath"); + QTest::addColumn("output"); + + QTest::newRow("Measurements one level above") + << "/home/user/patterns/pattern.val" << "/home/user/measurements/m.vit" << "../measurements/m.vit"; + + QTest::newRow("Measurements one level under") + << "/home/user/patterns/pattern.val" << "/home/user/patterns/measurements/m.vit" << "measurements/m.vit"; + + QTest::newRow("Measurements in the same folder") + << "/home/user/patterns/pattern.val" << "/home/user/patterns/m.vit" << "m.vit"; + + QTest::newRow("Path to measurements is empty") + << "/home/user/patterns/pattern.val" << "" << ""; + + QTest::newRow("Path to a pattern file is empty. Ablosute measurements path.") + << "" << "/home/user/patterns/m.vit" << "/home/user/patterns/m.vit"; + + QTest::newRow("Path to a pattern file is empty. Relative measurements path.") + << "" << "measurements/m.vit" << "measurements/m.vit"; + + QTest::newRow("Relative measurements path.") + << "/home/user/patterns/pattern.val" << "../measurements/m.vit" << "../measurements/m.vit"; + + QTest::newRow("Both paths are empty") << "" << "" << ""; + + QTest::newRow("Path to measurements is relative") + << "/home/user/patterns/pattern.val" << "m.vit" << "m.vit"; + + QTest::newRow("Absolute pattern path.") << "/home/user/patterns" << "m.vit" << "m.vit"; +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_Misc::TestRelativeFilePath() +{ + QFETCH(QString, patternPath); + QFETCH(QString, absoluteMPath); + QFETCH(QString, output); + + const QString result = RelativeMPath(patternPath, absoluteMPath); + QCOMPARE(output, result); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_Misc::TestAbsoluteFilePath_data() +{ + QTest::addColumn("patternPath"); + QTest::addColumn("relativeMPath"); + QTest::addColumn("output"); + + QTest::newRow("Measurements one level above") + << "/home/user/patterns/pattern.val" << "../measurements/m.vit" << "/home/user/measurements/m.vit"; + + QTest::newRow("Measurements one level under") + << "/home/user/patterns/pattern.val" << "measurements/m.vit" << "/home/user/patterns/measurements/m.vit"; + + QTest::newRow("Measurements in the same folder") + << "/home/user/patterns/pattern.val" << "m.vit" << "/home/user/patterns/m.vit"; + + QTest::newRow("Path to measurements is empty") + << "/home/user/patterns/pattern.val" << "" << ""; + + QTest::newRow("Path to a pattern file is empty. Ablosute measurements path.") + << "" << "/home/user/patterns/m.vit" << "/home/user/patterns/m.vit"; + + QTest::newRow("Path to a pattern file is empty. Relative measurements path.") + << "" << "measurements/m.vit" << "measurements/m.vit"; + + QTest::newRow("Relative measurements path.") + << "/home/user/patterns/pattern.val" << "../measurements/m.vit" << "/home/user/measurements/m.vit"; + + QTest::newRow("Both paths are empty") << "" << "" << ""; + + QTest::newRow("Path to measurements is relative") + << "/home/user/patterns/pattern.val" << "m.vit" << "/home/user/patterns/m.vit"; + + QTest::newRow("Absolute pattern path.") << "/home/user/patterns" << "m.vit" << "/home/user/m.vit"; +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_Misc::TestAbsoluteFilePath() +{ + QFETCH(QString, patternPath); + QFETCH(QString, relativeMPath); + QFETCH(QString, output); + + const QString result = AbsoluteMPath(patternPath, relativeMPath); + QCOMPARE(output, result); +} diff --git a/src/test/ValentinaTest/tst_misc.h b/src/test/ValentinaTest/tst_misc.h new file mode 100644 index 000000000..61455a655 --- /dev/null +++ b/src/test/ValentinaTest/tst_misc.h @@ -0,0 +1,51 @@ +/************************************************************************ + ** + ** @file tst_misc.h + ** @author Roman Telezhynskyi + ** @date 31 10, 2015 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2015 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef TST_MISC_H +#define TST_MISC_H + +#include + +class TST_Misc :public QObject +{ + Q_OBJECT +public: + explicit TST_Misc(QObject *parent = nullptr); + +private slots: + void TestRelativeFilePath_data(); + void TestRelativeFilePath(); + + void TestAbsoluteFilePath_data(); + void TestAbsoluteFilePath(); + +private: + Q_DISABLE_COPY(TST_Misc) +}; + +#endif // TST_MISC_H