Move XSD files to library.

--HG--
branch : feature
This commit is contained in:
dismine 2014-12-11 17:12:16 +02:00
parent 21d1a781fd
commit fb405d5754
12 changed files with 102 additions and 7 deletions

View File

@ -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

View File

@ -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());

View File

@ -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()

View File

@ -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>

View File

@ -28,7 +28,8 @@
#include "vabstractconverter.h" #include "vabstractconverter.h"
//---------------------------------------------------------------------------------------------------------------------
VAbstractConverter::VAbstractConverter() VAbstractConverter::VAbstractConverter()
:VDomDocument()
{ {
} }

View File

@ -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

View 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");
}

View 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

View File

@ -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