Skip to content

Commit

Permalink
Includes-cleanup (#364)
Browse files Browse the repository at this point in the history
* Rename Api class

* Rename DataProvider

* Rename DataSourceFactory

* Rename MainScene

* Rename Link

* Rename LinksDecorator

* Rename LinksString

* Rename LinkTools

* Rename AppSettings

* Fix includes

* Fix capitalization of commonTools path

* Fix capitalization in graph path

* Fix case in staticDataStorage path

* Formatting fix

* Format fix
  • Loading branch information
SavenkovIgor authored Apr 1, 2024
1 parent 13f0b2c commit 649cf9f
Show file tree
Hide file tree
Showing 104 changed files with 235 additions and 233 deletions.
122 changes: 62 additions & 60 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,49 +48,49 @@ set_target_properties (TermGraph PROPERTIES AUTORCC ON)
target_sources (TermGraph
PRIVATE
"android/AndroidManifest.xml"
"source/api.cpp"
"source/api.h"
"source/CommonTools/Errors.h"
"source/CommonTools/GroupUuid.h"
"source/CommonTools/HandyTypes.h"
"source/CommonTools/JsonTools.h"
"source/CommonTools/NetworkTools.h"
"source/CommonTools/Platform.h"
"source/CommonTools/SafeUuid.h"
"source/CommonTools/TermUuid.h"
"source/CommonTools/Validator.h"
"source/dataprovider.cpp"
"source/dataprovider.h"
"source/datasourcefactory.cpp"
"source/datasourcefactory.h"
"source/Graph/Edge.hpp"
"source/Graph/Forest.hpp"
"source/Graph/Graph.hpp"
"source/Graph/GraphData.hpp"
"source/Graph/Node.hpp"
"source/helpers/appsettings.cpp"
"source/helpers/appsettings.h"
"source/Api.cpp"
"source/Api.h"
"source/commonTools/Errors.h"
"source/commonTools/GroupUuid.h"
"source/commonTools/HandyTypes.h"
"source/commonTools/JsonTools.h"
"source/commonTools/NetworkTools.h"
"source/commonTools/Platform.h"
"source/commonTools/SafeUuid.h"
"source/commonTools/TermUuid.h"
"source/commonTools/Validator.h"
"source/DataProvider.cpp"
"source/DataProvider.h"
"source/DataSourceFactory.cpp"
"source/DataSourceFactory.h"
"source/graph/Edge.hpp"
"source/graph/Forest.hpp"
"source/graph/Graph.hpp"
"source/graph/GraphData.hpp"
"source/graph/Node.hpp"
"source/helpers/AppSettings.cpp"
"source/helpers/AppSettings.h"
"source/helpers/appstyle.h"
"source/helpers/exclusivecall.h"
"source/helpers/firststartpreparer.cpp"
"source/helpers/firststartpreparer.h"
"source/helpers/intmatrix.cpp"
"source/helpers/intmatrix.h"
"source/helpers/link/link.cpp"
"source/helpers/link/link.h"
"source/helpers/link/linksdecorator.cpp"
"source/helpers/link/linksdecorator.h"
"source/helpers/link/linksstring.cpp"
"source/helpers/link/linksstring.h"
"source/helpers/link/linktools.cpp"
"source/helpers/link/linktools.h"
"source/helpers/link/Link.cpp"
"source/helpers/link/Link.h"
"source/helpers/link/LinksDecorator.cpp"
"source/helpers/link/LinksDecorator.h"
"source/helpers/link/LinksString.cpp"
"source/helpers/link/LinksString.h"
"source/helpers/link/LinkTools.cpp"
"source/helpers/link/LinkTools.h"
"source/helpers/linktermdistancecache.cpp"
"source/helpers/linktermdistancecache.h"
"source/helpers/simplelistenserver.cpp"
"source/helpers/simplelistenserver.h"
"source/main.cpp"
"source/mainscene.cpp"
"source/mainscene.h"
"source/MainScene.cpp"
"source/MainScene.h"
"source/managers/groupsmanager.cpp"
"source/managers/groupsmanager.h"
"source/managers/linkshardeningmanager.cpp"
Expand Down Expand Up @@ -130,9 +130,9 @@ target_sources (TermGraph
"source/model/term/termdatawrapper.h"
"source/model/term/termsmodel.cpp"
"source/model/term/termsmodel.h"
"source/StaticDataStorage/data/StaticData.qrc"
"source/StaticDataStorage/StaticDataStorage.cpp"
"source/StaticDataStorage/StaticDataStorage.h"
"source/staticDataStorage/data/StaticData.qrc"
"source/staticDataStorage/StaticDataStorage.cpp"
"source/staticDataStorage/StaticDataStorage.h"
"source/TermDataInterface/DataStorageInterface.h"
"source/TermDataInterface/groupsummary.cpp"
"source/TermDataInterface/GroupSummary.h"
Expand Down Expand Up @@ -297,36 +297,36 @@ if (BUILD_TESTING)
# Application sources
target_sources (TermGraphTest
PRIVATE
"source/CommonTools/Errors.h"
"source/CommonTools/GroupUuid.h"
"source/CommonTools/HandyTypes.h"
"source/CommonTools/JsonTools.h"
"source/CommonTools/NetworkTools.h"
"source/CommonTools/Platform.h"
"source/CommonTools/SafeUuid.h"
"source/CommonTools/TermUuid.h"
"source/CommonTools/Validator.h"
"source/Graph/Edge.hpp"
"source/Graph/Forest.hpp"
"source/Graph/Graph.hpp"
"source/Graph/GraphData.hpp"
"source/Graph/Node.hpp"
"source/commonTools/Errors.h"
"source/commonTools/GroupUuid.h"
"source/commonTools/HandyTypes.h"
"source/commonTools/JsonTools.h"
"source/commonTools/NetworkTools.h"
"source/commonTools/Platform.h"
"source/commonTools/SafeUuid.h"
"source/commonTools/TermUuid.h"
"source/commonTools/Validator.h"
"source/graph/Edge.hpp"
"source/graph/Forest.hpp"
"source/graph/Graph.hpp"
"source/graph/GraphData.hpp"
"source/graph/Node.hpp"
"source/helpers/intmatrix.cpp"
"source/helpers/intmatrix.h"
"source/helpers/link/link.cpp"
"source/helpers/link/link.h"
"source/helpers/link/linksdecorator.cpp"
"source/helpers/link/linksdecorator.h"
"source/helpers/link/linksstring.cpp"
"source/helpers/link/linksstring.h"
"source/helpers/link/linktools.cpp"
"source/helpers/link/linktools.h"
"source/helpers/link/Link.cpp"
"source/helpers/link/Link.h"
"source/helpers/link/LinksDecorator.cpp"
"source/helpers/link/LinksDecorator.h"
"source/helpers/link/LinksString.cpp"
"source/helpers/link/LinksString.h"
"source/helpers/link/LinkTools.cpp"
"source/helpers/link/LinkTools.h"
"source/model/enums.h"
"source/model/graphicitem/graphicitem.cpp"
"source/model/graphicitem/graphicitem.h"
"source/StaticDataStorage/data/StaticData.qrc"
"source/StaticDataStorage/StaticDataStorage.cpp"
"source/StaticDataStorage/StaticDataStorage.h"
"source/staticDataStorage/data/StaticData.qrc"
"source/staticDataStorage/StaticDataStorage.cpp"
"source/staticDataStorage/StaticDataStorage.h"
"source/TermDataInterface/DataStorageInterface.h"
"source/TermDataInterface/groupsummary.cpp"
"source/TermDataInterface/GroupSummary.h"
Expand Down Expand Up @@ -388,6 +388,8 @@ if (BUILD_TESTING)
"test/validatortest.cpp"
)

target_include_directories (TermGraphTest PRIVATE "${PROJECT_SOURCE_DIR}/source/")

target_include_directories (TermGraphTest PRIVATE ${PROJECT_SOURCE_DIR})
target_link_libraries (TermGraphTest GTest::gtest GTest::gtest_main)
target_link_libraries (TermGraphTest Qt6::Core Qt6::Gui Qt6::Qml Qt6::Sql)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ If you find an error in the static graph data in termgraph.app or a missing feat
1. **Fork the repository:** Fork the repository to your GitHub account. This will create a copy of the project in your account, which you can work on without affecting the original repository.
2. **Create a new branch:** Create a new branch with a descriptive name in your forked repository. This will help keep the changes organized and make it easier for me to review your contributions. For example, use branch names like fix-node-definition or update-static-graph-data.
3. **Commit your changes:** Make the necessary changes in your branch, following the coding style guidelines mentioned earlier. Be sure to add clear and informative commit messages that describe the changes you've made.
4. **Create a pull request:** Once you're confident in your changes, create a pull request from your branch to the original TermGraph repository. Provide a short description of the changes you made and why you think they're necessary. This will help me understand the context and intent behind your contribution. Wait for GitHub Actions to finish. It runs CTest, so you can check if all other stuff is working as expected.
5. **Static graph changes:** If you're updating the static graph data (anything from `lib/StaticDataStorage/data/*.json`), keep in mind that the GitHub workflow will run CTest, which would validate the JSON files in this folder.
4. **Create a pull request:** Once you're confident in your changes, create a pull request from your branch to the original TermGraph repository. Provide a short description of the changes you made and why you think they're necessary. This will help me understand the context and intent behind your contribution. Wait for GitHub Actions to finish. It runs CTest, so you can check if all other stuff is working as expected.
5. **Static graph changes:** If you're updating the static graph data (anything from `lib/staticDataStorage/data/*.json`), keep in mind that the GitHub workflow will run CTest, which would validate the JSON files in this folder.

## JSON Format at Static Data Storage 📄

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ You can start tests from:
│ ├── Tools/ # Some qml debugging tools
├── resources/ # Resources: app icons, main html wrapper etc...
├── source/ # Main source code
│ ├── CommonTools/ # Some common tools with wide reuse
│ ├── Graph/ # Graph headers
│ ├── commonTools/ # Some common tools with wide reuse
│ ├── graph/ # Graph headers
│ ├── QrcHelpImages/ # Help images resources
│ ├── StaticDataStorage/ # Static data storage. Qrc with terms info
│ ├── staticDataStorage/ # Static data storage. Qrc with terms info
│ ├── TermDataInterface/ # Interface, describing data connection interface
│ ├── TermDataStorage/ # Data storage sqlite
│ └── Text # Text processing
Expand Down
4 changes: 2 additions & 2 deletions source/api.cpp → source/Api.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright © 2016-2023. Savenkov Igor
// SPDX-License-Identifier: GPL-3.0-or-later

#include "source/api.h"
#include "source/Api.h"

#include <QQmlEngine>

#include "source/CommonTools/Platform.h"
#include "source/commonTools/Platform.h"

#include "source/managers/notificationmanager.h"

Expand Down
2 changes: 1 addition & 1 deletion source/api.h → source/Api.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <QObject>
#include <QQmlEngine>

#include "source/MainScene.h"
#include "source/helpers/firststartpreparer.h"
#include "source/mainscene.h"
#include "source/managers/groupsmanager.h"
#include "source/managers/syncmanager.h"

Expand Down
4 changes: 2 additions & 2 deletions source/dataprovider.cpp → source/DataProvider.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright © 2016-2023. Savenkov Igor
// SPDX-License-Identifier: GPL-3.0-or-later

#include "dataprovider.h"
#include "source/DataProvider.h"

#include <ranges>

#include "source/datasourcefactory.h"
#include "source/DataSourceFactory.h"

namespace rng = std::ranges;

Expand Down
6 changes: 3 additions & 3 deletions source/dataprovider.h → source/DataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include <QObject>

#include <TermDataInterface/DataStorageInterface.h>
#include <TermDataInterface/GroupSummary.h>
#include <TermDataInterface/TermData.h>
#include "source/TermDataInterface/DataStorageInterface.h"
#include "source/TermDataInterface/GroupSummary.h"
#include "source/TermDataInterface/TermData.h"

class DataProvider : public QObject
{
Expand Down
12 changes: 6 additions & 6 deletions source/datasourcefactory.cpp → source/DataSourceFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Copyright © 2016-2023. Savenkov Igor
// SPDX-License-Identifier: GPL-3.0-or-later

#include "datasourcefactory.h"
#include "source/DataSourceFactory.h"

#include <QHostAddress>

#include "source/CommonTools/NetworkTools.h"
#include "source/CommonTools/Platform.h"
#include <StaticDataStorage/StaticDataStorage.h>
#include "source/commonTools/NetworkTools.h"
#include "source/commonTools/Platform.h"
#include "source/staticDataStorage/StaticDataStorage.h"

#ifndef Q_OS_WASM
#include "source/TermDataConnection/DataStorageConnection.h"
#include "source/helpers/appsettings.h"
#include "source/helpers/AppSettings.h"

#include <TermDataStorage/LocalDataStorage.h>
#include "source/TermDataStorage/LocalDataStorage.h"
#endif

std::unique_ptr<DataStorageInterface> DataSourceFactory::defaultSource()
Expand Down
2 changes: 1 addition & 1 deletion source/datasourcefactory.h → source/DataSourceFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <memory>

#include <TermDataInterface/DataStorageInterface.h>
#include "source/TermDataInterface/DataStorageInterface.h"

struct DataSourceFactory
{
Expand Down
2 changes: 1 addition & 1 deletion source/mainscene.cpp → source/MainScene.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright © 2016-2023. Savenkov Igor
// SPDX-License-Identifier: GPL-3.0-or-later

#include "source/mainscene.h"
#include "source/MainScene.h"

#ifndef Q_OS_WASM
#include <QThread>
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions source/TermDataConnection/DataStorageConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>

#include "source/CommonTools/HandyTypes.h"
#include "source/CommonTools/NetworkTools.h"
#include "source/commonTools/HandyTypes.h"
#include "source/commonTools/NetworkTools.h"

#include <TermDataInterface/DataStorageInterface.h>
#include <TermDataInterface/GroupSummary.h>
#include <TermDataInterface/TermData.h>
#include "source/TermDataInterface/DataStorageInterface.h"
#include "source/TermDataInterface/GroupSummary.h"
#include "source/TermDataInterface/TermData.h"

#include "NetWrapper.h"

Expand Down
8 changes: 4 additions & 4 deletions source/TermDataInterface/DataStorageInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#include <QString>
#include <QUuid>

#include "source/CommonTools/GroupUuid.h"
#include "source/CommonTools/TermUuid.h"
#include <source/TermDataInterface/GroupSummary.h>
#include <source/TermDataInterface/TermData.h>
#include "source/TermDataInterface/GroupSummary.h"
#include "source/TermDataInterface/TermData.h"
#include "source/commonTools/GroupUuid.h"
#include "source/commonTools/TermUuid.h"

// Interface
class DataStorageInterface
Expand Down
6 changes: 3 additions & 3 deletions source/TermDataInterface/GroupSummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <QString>
#include <QUuid>

#include "source/CommonTools/GroupUuid.h"
#include "source/CommonTools/HandyTypes.h"
#include "source/CommonTools/JsonTools.h"
#include "source/commonTools/GroupUuid.h"
#include "source/commonTools/HandyTypes.h"
#include "source/commonTools/JsonTools.h"

#include "GroupValidator.h"

Expand Down
8 changes: 4 additions & 4 deletions source/TermDataInterface/GroupValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#include <QJsonObject>

#include "source/CommonTools/Errors.h"
#include "source/CommonTools/GroupUuid.h"
#include "source/CommonTools/JsonTools.h"
#include "source/CommonTools/Validator.h"
#include "source/commonTools/Errors.h"
#include "source/commonTools/GroupUuid.h"
#include "source/commonTools/JsonTools.h"
#include "source/commonTools/Validator.h"

class GroupJsonValidator : public Validator<QJsonObject>
{
Expand Down
2 changes: 1 addition & 1 deletion source/TermDataInterface/StaticGroupData.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <QDateTime>

#include "source/CommonTools/HandyTypes.h"
#include "source/commonTools/HandyTypes.h"

#include "GroupSummary.h"
#include "TermData.h"
Expand Down
8 changes: 4 additions & 4 deletions source/TermDataInterface/TermData.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include <QString>
#include <QUuid>

#include "source/CommonTools/GroupUuid.h"
#include "source/CommonTools/HandyTypes.h"
#include "source/CommonTools/JsonTools.h"
#include "source/CommonTools/TermUuid.h"
#include "source/commonTools/GroupUuid.h"
#include "source/commonTools/HandyTypes.h"
#include "source/commonTools/JsonTools.h"
#include "source/commonTools/TermUuid.h"

#include "TermValidator.h"

Expand Down
10 changes: 5 additions & 5 deletions source/TermDataInterface/TermValidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#include <QJsonObject>

#include "source/CommonTools/GroupUuid.h"
#include "source/CommonTools/JsonTools.h"
#include "source/CommonTools/TermUuid.h"
#include "source/CommonTools/Validator.h"
#include "source/commonTools/GroupUuid.h"
#include "source/commonTools/JsonTools.h"
#include "source/commonTools/TermUuid.h"
#include "source/commonTools/Validator.h"

#include <source/Text/TextTools.h>
#include "source/Text/TextTools.h"

class TermJsonValidator : public Validator<QJsonObject>
{
Expand Down
2 changes: 1 addition & 1 deletion source/TermDataInterface/termdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "source/TermDataInterface/TermData.h"

#include <source/Text/TextTools.h>
#include "source/Text/TextTools.h"

TermData TermData::createGhost(const QString& term, GroupUuid groupUuid)
{
Expand Down
Loading

0 comments on commit 649cf9f

Please sign in to comment.