Skip to content

Commit

Permalink
refactor: Remove restricted class for less coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
ltoenning committed Nov 9, 2024
1 parent 083f98c commit bad3220
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 38 deletions.
3 changes: 1 addition & 2 deletions src/blackcore/webdataservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "blackmisc/fileutils.h"
#include "blackmisc/logcategories.h"
#include "blackmisc/logmessage.h"
#include "blackmisc/restricted.h"
#include "blackmisc/statusmessage.h"
#include "blackmisc/worker.h"
#include "blackmisc/threadutils.h"
Expand Down Expand Up @@ -47,7 +46,7 @@ using namespace BlackMisc::Weather;

namespace BlackCore
{
CWebDataServices::CWebDataServices(CWebReaderFlags::WebReader readers, const CDatabaseReaderConfigList &dbReaderConfig, BlackMisc::Restricted<CApplication>, QObject *parent) : QObject(parent), m_dbReaderConfig(dbReaderConfig)
CWebDataServices::CWebDataServices(CWebReaderFlags::WebReader readers, const CDatabaseReaderConfigList &dbReaderConfig, QObject *parent) : QObject(parent), m_dbReaderConfig(dbReaderConfig)
{
if (!sApp) { return; } // shutting down

Expand Down
5 changes: 1 addition & 4 deletions src/blackcore/webdataservices.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "blackmisc/network/voicecapabilities.h"
#include "blackmisc/weather/metarlist.h"
#include "blackmisc/weather/metar.h"
#include "blackmisc/restricted.h"
#include "blackmisc/statusmessagelist.h"
#include "blackmisc/countrylist.h"

Expand Down Expand Up @@ -55,8 +54,6 @@ namespace BlackMisc

namespace BlackCore
{
class CApplication;

namespace Vatsim
{
class CVatsimDataFileReader;
Expand Down Expand Up @@ -88,7 +85,7 @@ namespace BlackCore
static const QStringList &getLogCategories();

//! Constructor, only allowed from BlackCore::CApplication
CWebDataServices(CWebReaderFlags::WebReader readerFlags, const BlackCore::Db::CDatabaseReaderConfigList &dbReaderConfig, BlackMisc::Restricted<CApplication>, QObject *parent = nullptr);
CWebDataServices(CWebReaderFlags::WebReader readerFlags, const BlackCore::Db::CDatabaseReaderConfigList &dbReaderConfig, QObject *parent = nullptr);

//! Destructor
virtual ~CWebDataServices() override;
Expand Down
3 changes: 1 addition & 2 deletions src/blackgui/stylesheetutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "blackmisc/logmessage.h"
#include "blackmisc/swiftdirectories.h"
#include "blackmisc/directoryutils.h"
#include "blackmisc/restricted.h"

#include <QAbstractScrollArea>
#include <QCoreApplication>
Expand All @@ -31,7 +30,7 @@ using namespace BlackMisc;

namespace BlackGui
{
CStyleSheetUtility::CStyleSheetUtility(BlackMisc::Restricted<CGuiApplication>, QObject *parent) : QObject(parent)
CStyleSheetUtility::CStyleSheetUtility(QObject *parent) : QObject(parent)
{
this->read();
connect(&m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
Expand Down
5 changes: 1 addition & 4 deletions src/blackgui/stylesheetutility.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "blackgui/blackguiexport.h"
#include "blackmisc/logcategories.h"
#include "blackmisc/restricted.h"
#include "blackmisc/digestsignal.h"

#include <QFileSystemWatcher>
Expand All @@ -25,16 +24,14 @@ class QWidget;

namespace BlackGui
{
class CGuiApplication;

//! Reads and provides style sheets
class BLACKGUI_EXPORT CStyleSheetUtility : public QObject
{
Q_OBJECT

public:
//! Constructor
explicit CStyleSheetUtility(BlackMisc::Restricted<CGuiApplication>, QObject *parent = nullptr);
explicit CStyleSheetUtility(QObject *parent = nullptr);

//! Log cats.
static const QStringList &getLogCategories();
Expand Down
1 change: 0 additions & 1 deletion src/blackmisc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ add_library(misc SHARED
range.h
registermetadata.cpp
registermetadata.h
restricted.h
rgbcolor.cpp
rgbcolor.h
sequence.cpp
Expand Down
25 changes: 0 additions & 25 deletions src/blackmisc/restricted.h

This file was deleted.

0 comments on commit bad3220

Please sign in to comment.