// Db.cpp // // Copyright (C) 2013-2026 Jaye Evins // // This file is part of gLabels-qt. // // gLabels-qt 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. // // gLabels-qt 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 gLabels-qt. If not, see . // #include "Db.hpp" #include "Config.hpp" #include "StrUtil.hpp" #include "FileUtil.hpp" #include "GenericTemplate.hpp" #include "Settings.hpp" #include "XmlCategoryParser.hpp" #include "XmlPaperParser.hpp" #include "XmlTemplateParser.hpp" #include "XmlTemplateCreator.hpp" #include "XmlVendorParser.hpp" #include #include #include // // Private // namespace { using namespace glabels::model; const QString empty = ""; bool partNameLessThan( const Template& a, const Template& b ) { return StrUtil::comparePartNames( a.name(), b.name() ) < 0; } } namespace glabels::model { // // Static data // QList Db::mPapers; QMap Db::mPapersNameMap; QMap Db::mPapersIdMap; QStringList Db::mPaperIds; QStringList Db::mPaperNames; QList Db::mCategories; QMap Db::mCategoriesNameMap; QMap Db::mCategoriesIdMap; QStringList Db::mCategoryIds; QStringList Db::mCategoryNames; QList Db::mVendors; QMap Db::mVendorsNameMap; QStringList Db::mVendorNames; QList