diff --git a/GUI/coregui/mainwindow/OutputDataIOService.cpp b/GUI/coregui/mainwindow/OutputDataIOService.cpp index 68f6af620427cd879d65e232ff1a76b0e615db0f..b8f43f2d60a3cc52de6645c206fe0698e205e97f 100644 --- a/GUI/coregui/mainwindow/OutputDataIOService.cpp +++ b/GUI/coregui/mainwindow/OutputDataIOService.cpp @@ -50,7 +50,7 @@ void OutputDataIOService::save(const QString& projectDir) OutputDataDirHistory newHistory; - for (SaveLoadInterface* item : nonXMLItems()) { + for (SaveLoadInterface* item : dataInterfaces()) { if (m_history.wasModifiedSinceLastSave(projectDir, item)) item->saveData(projectDir); newHistory.markAsSaved(item); @@ -65,11 +65,11 @@ void OutputDataIOService::save(const QString& projectDir) m_history.setHistory(projectDir, newHistory); } -void OutputDataIOService::load(const QString& projectDir, MessageService* messageService) +void OutputDataIOService::loadDataFiles(const QString& projectDir, MessageService* messageService) { OutputDataDirHistory newHistory; - for (SaveLoadInterface* item : nonXMLItems()) { + for (SaveLoadInterface* item : dataInterfaces()) { try { item->loadData(projectDir); newHistory.markAsSaved(item); @@ -99,7 +99,7 @@ void OutputDataIOService::load(const QString& projectDir, MessageService* messag //! Returns all non-XML items available for save/load. -QVector<SaveLoadInterface*> OutputDataIOService::nonXMLItems() const +QVector<SaveLoadInterface*> OutputDataIOService::dataInterfaces() const { QVector<SaveLoadInterface*> result; diff --git a/GUI/coregui/mainwindow/OutputDataIOService.h b/GUI/coregui/mainwindow/OutputDataIOService.h index 39bd9fe7f76f25bba60ec4d5a36922ff4cbd7c78..252816e74dc687fe9f739084a49d8d9139fca494 100644 --- a/GUI/coregui/mainwindow/OutputDataIOService.h +++ b/GUI/coregui/mainwindow/OutputDataIOService.h @@ -37,9 +37,9 @@ public: void save(const QString& projectDir); - void load(const QString& projectDir, MessageService* messageService = nullptr); + void loadDataFiles(const QString& projectDir, MessageService* messageService = nullptr); - QVector<SaveLoadInterface*> nonXMLItems() const; + QVector<SaveLoadInterface*> dataInterfaces() const; private: void cleanOldFiles(const QString& projectDir, const QStringList& oldSaves, diff --git a/GUI/coregui/mainwindow/projectdocument.cpp b/GUI/coregui/mainwindow/projectdocument.cpp index 8f387b5a7d0c961894db864029c930b43214b8f9..f88857df23efbd83e8cd88c75f7af93f17593292 100644 --- a/GUI/coregui/mainwindow/projectdocument.cpp +++ b/GUI/coregui/mainwindow/projectdocument.cpp @@ -126,7 +126,7 @@ void ProjectDocument::saveProjectData(const QString& project_file_name) m_dataService->save(ProjectUtils::projectDir(project_file_name)); } -void ProjectDocument::loadDataFile(const QString& project_file_name) +void ProjectDocument::loadProjectFile(const QString& project_file_name) { QElapsedTimer timer1, timer2; timer1.start(); @@ -144,11 +144,11 @@ void ProjectDocument::loadDataFile(const QString& project_file_name) try { disconnectModels(); - readFrom(&file); + readProject(&file); file.close(); timer2.start(); - m_dataService->load(projectDir(), m_messageService); + m_dataService->loadDataFiles(projectDir(), m_messageService); connectModels(); if (m_messageService->warningCount()) @@ -205,7 +205,7 @@ bool ProjectDocument::hasErrors() const bool ProjectDocument::hasData() const { - return !m_dataService->nonXMLItems().isEmpty(); + return !m_dataService->dataInterfaces().isEmpty(); } QString ProjectDocument::documentVersion() const @@ -222,7 +222,7 @@ void ProjectDocument::onModelChanged() emit modified(); } -void ProjectDocument::readFrom(QIODevice* device) +void ProjectDocument::readProject(QIODevice* device) { ASSERT(m_messageService); QXmlStreamReader reader(device); diff --git a/GUI/coregui/mainwindow/projectdocument.h b/GUI/coregui/mainwindow/projectdocument.h index fd612e850e3c68f3bdbdd37f4788f971c32107ad..e35924e39ef200e8c2b2375e3a60b9ae371b71a8 100644 --- a/GUI/coregui/mainwindow/projectdocument.h +++ b/GUI/coregui/mainwindow/projectdocument.h @@ -61,7 +61,7 @@ public: void saveProjectFile(const QString& project_file_name, bool autoSave = false); void saveProjectData(const QString& project_file_name); - void loadDataFile(const QString& project_file_name); + void loadProjectFile(const QString& project_file_name); bool hasValidNameAndPath(); @@ -89,7 +89,7 @@ public slots: void onModelChanged(); private: - void readFrom(QIODevice* device); + void readProject(QIODevice* device); void writeTo(QIODevice* device); void disconnectModels(); diff --git a/GUI/coregui/mainwindow/projectmanager.cpp b/GUI/coregui/mainwindow/projectmanager.cpp index 248b979d987a7dcb5ebe774cf4804e7e67580d7c..482070506334b685571fdb0823631f89093a975a 100644 --- a/GUI/coregui/mainwindow/projectmanager.cpp +++ b/GUI/coregui/mainwindow/projectmanager.cpp @@ -380,12 +380,12 @@ void ProjectManager::loadProject(const QString& projectFileName) if (useAutosave && restoreProjectDialog(projectFileName)) { QApplication::setOverrideCursor(Qt::WaitCursor); - m_project_document->loadDataFile(ProjectUtils::autosaveName(projectFileName)); + m_project_document->loadProjectFile(ProjectUtils::autosaveName(projectFileName)); m_project_document->setProjectFileName(projectFileName); m_project_document->setModified(true); } else { QApplication::setOverrideCursor(Qt::WaitCursor); - m_project_document->loadDataFile(projectFileName); + m_project_document->loadProjectFile(projectFileName); } QApplication::restoreOverrideCursor(); } diff --git a/Tests/UnitTests/GUI/TestDataItemViews.cpp b/Tests/UnitTests/GUI/TestDataItemViews.cpp index b0a818f55547d82b4007fffe95751ffbbd24050b..f49c9edbc16d6f3a7fa40ad77f84e73e0917a21b 100644 --- a/Tests/UnitTests/GUI/TestDataItemViews.cpp +++ b/Tests/UnitTests/GUI/TestDataItemViews.cpp @@ -147,7 +147,7 @@ TEST_F(TestDataItemViews, testSavingLinkedData) ProjectDocument document; document.setApplicationModels(&models); document.setLogger(&message_service); - document.loadDataFile(projectFileName); + document.loadProjectFile(projectFileName); SessionModel* real_data_model = models.realDataModel(); auto view_item = real_data_model->topItem<DataPropertyContainer>(); diff --git a/Tests/UnitTests/GUI/TestOutputDataIOService.cpp b/Tests/UnitTests/GUI/TestOutputDataIOService.cpp index 8fe0b279d55f3ad75841410a89d0af275b376edd..7b998f1887a9be32208b0f97271c3d3d0fa28629 100644 --- a/Tests/UnitTests/GUI/TestOutputDataIOService.cpp +++ b/Tests/UnitTests/GUI/TestOutputDataIOService.cpp @@ -63,7 +63,7 @@ TEST_F(TestOutputDataIOService, test_nonXMLData) // checking data items of OutputDataIOService OutputDataIOService service(&models); - EXPECT_EQ(service.nonXMLItems().size(), 3); + EXPECT_EQ(service.dataInterfaces().size(), 3); // checking data items of ApplicationModels dataItems = models.nonXMLItems(); @@ -271,7 +271,7 @@ TEST_F(TestOutputDataIOService, test_RealDataItemWithNativeData) // checking data items of OutputDataIOService OutputDataIOService service(&models); - EXPECT_EQ(service.nonXMLItems().size(), 5); + EXPECT_EQ(service.dataInterfaces().size(), 5); const QString projectDir("test_NativeData"); GuiUnittestUtils::create_dir(projectDir); diff --git a/Tests/UnitTests/GUI/TestSavingSpecularData.cpp b/Tests/UnitTests/GUI/TestSavingSpecularData.cpp index 8adf5a8d981a613d105e3069476a6160782e20bb..8fd851afd25c1c0fd4225a6a9418d170d6eb32d9 100644 --- a/Tests/UnitTests/GUI/TestSavingSpecularData.cpp +++ b/Tests/UnitTests/GUI/TestSavingSpecularData.cpp @@ -91,7 +91,7 @@ TEST_F(TestSavingSpecularData, test_SpecularInsturment) // checking data items of OutputDataIOService OutputDataIOService service(&models); - EXPECT_EQ(service.nonXMLItems().size(), 1); + EXPECT_EQ(service.dataInterfaces().size(), 1); // checking data items of ApplicationModels dataItems = models.nonXMLItems(); @@ -120,7 +120,7 @@ TEST_F(TestSavingSpecularData, test_InstrumentInJobItem) EXPECT_EQ(models.jobModel()->nonXMLItems().size(), 2); OutputDataIOService service(&models); - EXPECT_EQ(service.nonXMLItems().size(), 2); + EXPECT_EQ(service.dataInterfaces().size(), 2); auto dataItems = models.nonXMLItems(); EXPECT_EQ(dataItems.size(), 2); @@ -129,7 +129,7 @@ TEST_F(TestSavingSpecularData, test_InstrumentInJobItem) // hiding pointwise axis, should be saved anyway axis_group->setCurrentType("BasicAxis"); EXPECT_EQ(models.jobModel()->nonXMLItems().size(), 2); - EXPECT_EQ(service.nonXMLItems().size(), 2); + EXPECT_EQ(service.dataInterfaces().size(), 2); dataItems = models.nonXMLItems(); EXPECT_EQ(dataItems.size(), 2); EXPECT_EQ(dataItems.indexOf(dataItem), 0);