diff --git a/GUI/Model/Axis/AmplitudeAxisItem.cpp b/GUI/Model/Axis/AmplitudeAxisItem.cpp index 3f4703772ab06e2444ab3e916f8f22431ad20d2a..af3ac76be1772a5e13ce0b9e7b218f615cae6876 100644 --- a/GUI/Model/Axis/AmplitudeAxisItem.cpp +++ b/GUI/Model/Axis/AmplitudeAxisItem.cpp @@ -66,6 +66,7 @@ void AmplitudeAxisItem::writeTo(QXmlStreamWriter* w) const void AmplitudeAxisItem::readFrom(QXmlStreamReader* r) { const uint version = XML::readUIntAttribute(r, XML::Attrib::version); + Q_UNUSED(version); while (r->readNextStartElement()) { QString tag = r->name().toString(); @@ -81,7 +82,7 @@ void AmplitudeAxisItem::readFrom(QXmlStreamReader* r) XML::gotoEndElementOfTag(r, tag); // log range, orders of magniture - } else if (version >= 2 && tag == Tag::LogRangeOrders) { + } else if (tag == Tag::LogRangeOrders) { XML::readAttribute(r, XML::Attrib::value, &m_logRangeOrders); XML::gotoEndElementOfTag(r, tag); diff --git a/GUI/Model/Data/DataItem.cpp b/GUI/Model/Data/DataItem.cpp index 93f0c92961e92166aaafab9572ae994fb862abd2..007b9c0f900f4ecc81ec4c7bdabfb0eb2c110144 100644 --- a/GUI/Model/Data/DataItem.cpp +++ b/GUI/Model/Data/DataItem.cpp @@ -28,7 +28,7 @@ namespace { namespace Tag { const QString FileName("FileName"); -const QString AxesUnits("AxesUnits"); +const QString AxesUnits("AxesUnits"); // obsolete since 22.0 const QString XAxis("XAxis"); const QString YAxis("YAxis"); @@ -222,7 +222,7 @@ QString DataItem::yAxisLabel() const void DataItem::writeTo(QXmlStreamWriter* w) const { - XML::writeAttribute(w, XML::Attrib::version, uint(2)); + XML::writeAttribute(w, XML::Attrib::version, uint(3)); // file name w->writeStartElement(Tag::FileName); @@ -242,7 +242,8 @@ void DataItem::writeTo(QXmlStreamWriter* w) const void DataItem::readFrom(QXmlStreamReader* r) { - // const uint version = XML::readUIntAttribute(r, XML::Attrib::version); + const uint version = XML::readUIntAttribute(r, XML::Attrib::version); + Q_UNUSED(version); while (r->readNextStartElement()) { QString tag = r->name().toString(); diff --git a/GUI/Model/Device/DatafileItem.cpp b/GUI/Model/Device/DatafileItem.cpp index 417ce94f9aa0ded01c87862f16b1282dbdb35315..2b45e156b277213fc9ecff1159d2289ae767d697 100644 --- a/GUI/Model/Device/DatafileItem.cpp +++ b/GUI/Model/Device/DatafileItem.cpp @@ -199,8 +199,6 @@ void DatafileItem::writeTo(QXmlStreamWriter* w) const { XML::writeAttribute(w, XML::Attrib::version, uint(2)); - // NOTE: The ordering of the XML elements is important in initialization - // instrument id w->writeStartElement(Tag::InstrumentId); XML::writeAttribute(w, XML::Attrib::value, m_instrumentId); diff --git a/GUI/Model/Job/JobItem.cpp b/GUI/Model/Job/JobItem.cpp index df634480e3b5b57ed6055273fbb7034a31f891fb..85189d9672178a006b4dc58f3e5f3a4f9ffd77e1 100644 --- a/GUI/Model/Job/JobItem.cpp +++ b/GUI/Model/Job/JobItem.cpp @@ -293,10 +293,10 @@ DatafileItem* JobItem::createDatafileItem() return m_realItem.get(); } -void JobItem::copyDatafileItemIntoJob(const DatafileItem* srcDatafileItem) +void JobItem::copyDatafileItemIntoJob(const DatafileItem* source) { createDatafileItem(); - srcDatafileItem->copyTo(realItem()); + source->copyTo(realItem()); if (rank() == 1) { m_realItem->data1DItem()->setRealPlotStyle(); @@ -372,8 +372,6 @@ void JobItem::writeTo(QXmlStreamWriter* w) const { XML::writeAttribute(w, XML::Attrib::version, uint(2)); - // NOTE: The ordering of the XML elements is important in initialization - // simulation options w->writeStartElement(Tag::SimulationOptions); m_simulationOptionsItem->writeTo(w); diff --git a/GUI/Model/Job/JobItem.h b/GUI/Model/Job/JobItem.h index 118b02d024b88635e7272cd1f6a86e784238e826..6a93731e85b0000442ba0194323481d207658cd5 100644 --- a/GUI/Model/Job/JobItem.h +++ b/GUI/Model/Job/JobItem.h @@ -124,7 +124,7 @@ public: DataItem* diffDataItem(); DatafileItem* createDatafileItem(); - void copyDatafileItemIntoJob(const DatafileItem* srcDatafileItem); + void copyDatafileItemIntoJob(const DatafileItem* source); DatafileItem* realItem(); void adjustReaDataToJobInstrument(); diff --git a/GUI/Model/Mask/MaskItems.cpp b/GUI/Model/Mask/MaskItems.cpp index 4367c9a85e27ea5a68675a36ea413f17159b1aff..8887dfa3d4a24fa355476967f8bf66e9562d207b 100644 --- a/GUI/Model/Mask/MaskItems.cpp +++ b/GUI/Model/Mask/MaskItems.cpp @@ -28,7 +28,6 @@ const QString Angle("Angle"); const QString BaseData("BaseData"); const QString IsClosed("IsClosed"); const QString IsVisible("IsVisible"); -const QString Mask("Mask"); const QString MaskValue("MaskValue"); const QString Name("Name"); const QString PolygonPoint("PolygonPoint"); diff --git a/GUI/Model/Project/ProjectDocument.cpp b/GUI/Model/Project/ProjectDocument.cpp index 7566fef6ee9a5eee25172321ac7e8960a91f2fdc..f115cd6dc75119f261523b60c67f6f8bad694a24 100644 --- a/GUI/Model/Project/ProjectDocument.cpp +++ b/GUI/Model/Project/ProjectDocument.cpp @@ -42,7 +42,7 @@ const QString SimulationOptions("SimulationOptions"); const QString InstrumentModel("InstrumentModel"); const QString SampleModel("SampleModel"); const QString JobModel("JobModel"); -const QString DatafilesModel("DatafilesModel"); +const QString RealModel("RealModel"); const QString ActiveView("ActiveView"); } // namespace Tag @@ -219,8 +219,6 @@ void ProjectDocument::onModelChanged() void ProjectDocument::writeProject(QIODevice* device) { - // NOTE: The ordering of the XML elements is important in initialization - QXmlStreamWriter w(device); w.setAutoFormatting(true); w.writeStartDocument(); @@ -249,7 +247,7 @@ void ProjectDocument::writeProject(QIODevice* device) w.writeEndElement(); // real model - w.writeStartElement(Tag::DatafilesModel); + w.writeStartElement(Tag::RealModel); m_realModel.writeTo(&w); w.writeEndElement(); @@ -311,7 +309,7 @@ ProjectDocument::ReadResult ProjectDocument::readProject(QIODevice* device, XML::gotoEndElementOfTag(&r, tag); // real model - } else if (tag == Tag::DatafilesModel) { + } else if (tag == Tag::RealModel) { // 'm_instrumentModel' should be read before m_realModel.readFrom(&r); XML::gotoEndElementOfTag(&r, tag); diff --git a/GUI/View/Instrument/InstrumentListing.cpp b/GUI/View/Instrument/InstrumentListing.cpp index ced2275faf4239da67a4b480fe731f92a68e86b5..031792d7af2184218ca62753edf16c37657ab920 100644 --- a/GUI/View/Instrument/InstrumentListing.cpp +++ b/GUI/View/Instrument/InstrumentListing.cpp @@ -33,7 +33,7 @@ InstrumentListing::InstrumentListing(ProjectDocument* document) setViewMode(QListView::IconMode); setIconSize(QSize(96, 84)); setMovement(QListView::Static); - setMaximumWidth(200); + setFixedWidth(iconSize().width() + 10); setSelectionMode(QAbstractItemView::SingleSelection); setModel(m_model);