Move XSD files to library.
--HG-- branch : feature
This commit is contained in:
parent
21d1a781fd
commit
fb405d5754
|
@ -51,7 +51,6 @@ RESOURCES += \
|
||||||
share/resources/icon.qrc \ # All other icons except cursors and Windows theme.
|
share/resources/icon.qrc \ # All other icons except cursors and Windows theme.
|
||||||
share/resources/cursor.qrc \ # Tools cursor icons.
|
share/resources/cursor.qrc \ # Tools cursor icons.
|
||||||
share/resources/theme.qrc \ # Windows theme icons.
|
share/resources/theme.qrc \ # Windows theme icons.
|
||||||
share/resources/schema.qrc \ # Schemas for validation xml files.
|
|
||||||
share/resources/measurements.qrc \ # For measurements files that we save as resource.
|
share/resources/measurements.qrc \ # For measurements files that we save as resource.
|
||||||
share/resources/flags.qrc
|
share/resources/flags.qrc
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "undocommands/renamepp.h"
|
#include "undocommands/renamepp.h"
|
||||||
#include "vtooloptionspropertybrowser.h"
|
#include "vtooloptionspropertybrowser.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "../libs/ifc/xml/vpatternconverter.h"
|
||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -2350,7 +2351,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
||||||
qApp->setOpeningPattern();//Begin opening file
|
qApp->setOpeningPattern();//Begin opening file
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
VDomDocument::ValidateXML("://schema/pattern.xsd", fileName);
|
VDomDocument::ValidateXML(VPatternConverter::CurrentSchema(), fileName);
|
||||||
doc->setContent(fileName);
|
doc->setContent(fileName);
|
||||||
|
|
||||||
qApp->setPatternUnit(doc->MUnit());
|
qApp->setPatternUnit(doc->MUnit());
|
||||||
|
|
|
@ -39,6 +39,10 @@ MOC_DIR = moc
|
||||||
# objecs files
|
# objecs files
|
||||||
OBJECTS_DIR = obj
|
OBJECTS_DIR = obj
|
||||||
|
|
||||||
|
# Resource files. This files will be included in binary.
|
||||||
|
RESOURCES += \
|
||||||
|
schema.qrc # Schemas for validation xml files.
|
||||||
|
|
||||||
# Set using ccache. Function enable_ccache() defined in Valentina.pri.
|
# Set using ccache. Function enable_ccache() defined in Valentina.pri.
|
||||||
$$enable_ccache()
|
$$enable_ccache()
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>schema/pattern.xsd</file>
|
|
||||||
<file>schema/individual_measurements.xsd</file>
|
<file>schema/individual_measurements.xsd</file>
|
||||||
<file>schema/standard_measurements.xsd</file>
|
<file>schema/standard_measurements.xsd</file>
|
||||||
|
<file>schema/pattern/v0.1.1.xsd</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
|
@ -28,7 +28,8 @@
|
||||||
|
|
||||||
#include "vabstractconverter.h"
|
#include "vabstractconverter.h"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VAbstractConverter::VAbstractConverter()
|
VAbstractConverter::VAbstractConverter()
|
||||||
|
:VDomDocument()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,17 @@
|
||||||
#ifndef VABSTRACTCONVERTER_H
|
#ifndef VABSTRACTCONVERTER_H
|
||||||
#define VABSTRACTCONVERTER_H
|
#define VABSTRACTCONVERTER_H
|
||||||
|
|
||||||
|
#include "vdomdocument.h"
|
||||||
|
|
||||||
class VAbstractConverter
|
class VAbstractConverter :public VDomDocument
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VAbstractConverter();
|
VAbstractConverter();
|
||||||
|
virtual ~VAbstractConverter(){}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(VAbstractConverter)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VABSTRACTCONVERTER_H
|
#endif // VABSTRACTCONVERTER_H
|
||||||
|
|
41
src/libs/ifc/xml/vpatternconverter.cpp
Normal file
41
src/libs/ifc/xml/vpatternconverter.cpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file vpatternconverter.cpp
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 11 12, 2014
|
||||||
|
**
|
||||||
|
** @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) 2014 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> 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 <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "vpatternconverter.h"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VPatternConverter::VPatternConverter()
|
||||||
|
:VAbstractConverter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
QString VPatternConverter::CurrentSchema()
|
||||||
|
{
|
||||||
|
return QStringLiteral("://schema/pattern/v0.1.1.xsd");
|
||||||
|
}
|
42
src/libs/ifc/xml/vpatternconverter.h
Normal file
42
src/libs/ifc/xml/vpatternconverter.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file vpatternconverter.h
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 11 12, 2014
|
||||||
|
**
|
||||||
|
** @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) 2014 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> 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 <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#ifndef VPATTERNCONVERTER_H
|
||||||
|
#define VPATTERNCONVERTER_H
|
||||||
|
|
||||||
|
#include "vabstractconverter.h"
|
||||||
|
|
||||||
|
class VPatternConverter : public VAbstractConverter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
VPatternConverter();
|
||||||
|
|
||||||
|
static QString CurrentSchema();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // VPATTERNCONVERTER_H
|
|
@ -3,8 +3,10 @@
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/vabstractconverter.h \
|
$$PWD/vabstractconverter.h \
|
||||||
$$PWD/vdomdocument.h
|
$$PWD/vdomdocument.h \
|
||||||
|
$$PWD/vpatternconverter.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/vabstractconverter.cpp \
|
$$PWD/vabstractconverter.cpp \
|
||||||
$$PWD/vdomdocument.cpp
|
$$PWD/vdomdocument.cpp \
|
||||||
|
$$PWD/vpatternconverter.cpp
|
||||||
|
|
Loading…
Reference in New Issue
Block a user