Skip to content

Commit d59b574

Browse files
committed
Rename SystemConfig to AppConfig
1 parent 44bf040 commit d59b574

File tree

11 files changed

+28
-35
lines changed

11 files changed

+28
-35
lines changed

src/gui/creds/credentials.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "accessmanager.h"
1717
#include "account.h"
18-
#include "config/systemconfig.h"
18+
#include "config/appconfig.h"
1919
#include "creds/credentialmanager.h"
2020
#include "oauth.h"
2121
#include "requestauthenticationcontroller.h"
@@ -85,7 +85,7 @@ Credentials::Credentials(const QString &token, const QString &refreshToken, Acco
8585
, _accessToken(token)
8686
, _refreshToken(refreshToken)
8787
, _ready(false)
88-
, _openIdConfig(SystemConfig().openIdConfig())
88+
, _openIdConfig(AppConfig().openIdConfig())
8989
{
9090
if (!token.isEmpty() && !refreshToken.isEmpty())
9191
_ready = true;

src/gui/creds/oauth.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "oauth.h"
1616

1717
#include "accessmanager.h"
18-
#include "config/systemconfig.h"
1918
#include "creds/credentialssupport.h"
2019
#include "gui/networkadapters/userinfoadapter.h"
2120
#include "libsync/creds/credentialmanager.h"

src/gui/creds/requestauthenticationcontroller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "accountmodalwidget.h"
2222
#include "settingsdialog.h"
2323

24-
#include <config/systemconfig.h>
24+
#include <config/appconfig.h>
2525

2626
namespace OCC {
2727

@@ -60,7 +60,7 @@ void RequestAuthenticationController::startAuthentication(Account *account)
6060
delete _oauth;
6161
_oauth = nullptr;
6262
}
63-
SystemConfig systemConfig;
63+
AppConfig systemConfig;
6464
_account = account;
6565
_oauth = new AccountBasedOAuth(_account, systemConfig.openIdConfig(), this);
6666
connect(_oauth, &OAuth::authorisationLinkChanged, this, &RequestAuthenticationController::authUrlReady);

src/gui/newaccountwizard/oauthpagecontroller.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515

1616
#include "accessmanager.h"
1717
#include "accountmanager.h"
18-
#include "config/systemconfig.h"
18+
#include "config/appconfig.h"
1919
#include "networkadapters/fetchcapabilitiesadapter.h"
2020
#include "networkadapters/userinfoadapter.h"
2121
#include "networkadapters/webfingerlookupadapter.h"
22-
#include "resources.h"
2322
#include "template.h"
2423
#include "theme.h"
2524

@@ -209,7 +208,7 @@ bool OAuthPageController::validate()
209208
_authEndpoint.clear();
210209
_urlField->clear();
211210

212-
SystemConfig systemConfig;
211+
AppConfig systemConfig;
213212
_oauth = new OAuth(_authUrl, {}, systemConfig.openIdConfig(), _accessManager.get(), this);
214213
// if we ever need to split out the auth link calculation, it's coming from fetchWellKnown which is a subset of
215214
// the "full" authentication routine in the oauth impl

src/gui/newaccountwizard/urlpagecontroller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "urlpagecontroller.h"
1515

1616
#include "accessmanager.h"
17-
#include "config/systemconfig.h"
17+
#include "config/appconfig.h"
1818
#include "networkadapters/determineauthtypeadapter.h"
1919
#include "networkadapters/discoverwebfingerserviceadapter.h"
2020
#include "networkadapters/resolveurladapter.h"
@@ -39,7 +39,7 @@ UrlPageController::UrlPageController(QWizardPage *page, AccessManager *accessMan
3939
return;
4040
}
4141

42-
SystemConfig systemConfig;
42+
AppConfig systemConfig;
4343
QString serverUrl = systemConfig.serverUrl();
4444
// no server url was given by any means, so the user has to provide one
4545
if (serverUrl.isEmpty()) {

src/libsync/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ set(libsync_SRCS
5252
abstractcorejob.cpp
5353

5454
appprovider.cpp
55-
config/systemconfig.cpp
55+
config/appconfig.cpp
5656
config/openidconfig.cpp
5757
)
5858

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
// SPDX-FileCopyrightText: 2026 Thomas Müller <thomas.mueller@tmit.eu>
33

4-
#include "systemconfig.h"
4+
#include "appconfig.h"
55

66
#include "../theme.h"
77
#include "common/utility.h"
@@ -17,7 +17,7 @@ Q_LOGGING_CATEGORY(lcSystemConfig, "sync.systemconfig", QtInfoMsg)
1717

1818
namespace chrono = std::chrono;
1919

20-
SystemConfig::SystemConfig()
20+
AppConfig::AppConfig()
2121
{
2222
_serverUrl = Theme::instance()->overrideServerUrlV2();
2323
// If a theme provides a hardcoded URL, do not allow for URL change.
@@ -47,7 +47,7 @@ SystemConfig::SystemConfig()
4747
}
4848
}
4949

50-
OpenIdConfig SystemConfig::loadOpenIdConfigFromTheme()
50+
OpenIdConfig AppConfig::loadOpenIdConfigFromTheme()
5151
{
5252
Theme *theme = Theme::instance();
5353

@@ -63,7 +63,7 @@ OpenIdConfig SystemConfig::loadOpenIdConfigFromTheme()
6363
return cfg;
6464
}
6565

66-
OpenIdConfig SystemConfig::loadOpenIdConfigFromSystemConfig(const QSettings &system)
66+
OpenIdConfig AppConfig::loadOpenIdConfigFromSystemConfig(const QSettings &system)
6767
{
6868
QString clientId = system.value(OidcClientIdKey, QString()).toString();
6969
QString clientSecret = system.value(OidcClientSecretKey, QString()).toString();
@@ -87,7 +87,7 @@ OpenIdConfig SystemConfig::loadOpenIdConfigFromSystemConfig(const QSettings &sys
8787
return OpenIdConfig(clientId, clientSecret, ports, scopes, prompt);
8888
}
8989

90-
QString SystemConfig::configPath(const QOperatingSystemVersion::OSType& os, const Theme& theme)
90+
QString AppConfig::configPath(const QOperatingSystemVersion::OSType& os, const Theme& theme)
9191
{
9292
// Important: these paths conform to how names typically work on the systems on which they are used. This includes usage of upper-/lowercase.
9393

@@ -108,22 +108,22 @@ QString SystemConfig::configPath(const QOperatingSystemVersion::OSType& os, cons
108108
return QString("/etc/%1/%1.ini").arg(theme.appName());
109109
}
110110

111-
bool SystemConfig::allowServerUrlChange() const
111+
bool AppConfig::allowServerUrlChange() const
112112
{
113113
return _allowServerURLChange;
114114
}
115115

116-
QString SystemConfig::serverUrl() const
116+
QString AppConfig::serverUrl() const
117117
{
118118
return _serverUrl;
119119
}
120120

121-
bool SystemConfig::skipUpdateCheck() const
121+
bool AppConfig::skipUpdateCheck() const
122122
{
123123
return _skipUpdateCheck;
124124
}
125125

126-
OpenIdConfig SystemConfig::openIdConfig() const
126+
OpenIdConfig AppConfig::openIdConfig() const
127127
{
128128
return _openIdConfig;
129129
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace OCC {
1616

1717
/**
18-
* @brief The SystemConfig class
18+
* @brief The AppConfig class
1919
* @ingroup libsync
2020
* @note This class provides access to system-wide configuration settings.
2121
* These settings are typically read-only and affect the behavior of the application globally.
@@ -63,10 +63,10 @@ namespace OCC {
6363
* "Prompt"="select_account consent"
6464
*
6565
*/
66-
class OWNCLOUDSYNC_EXPORT SystemConfig
66+
class OWNCLOUDSYNC_EXPORT AppConfig
6767
{
6868
public:
69-
explicit SystemConfig();
69+
explicit AppConfig();
7070
/**
7171
* Determine if changing the server URL is allowed based on system configuration.
7272
* This value is only relevant if SystemConfig::serverUrl() returns a non-empty string.

src/libsync/configfile.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@
1414

1515
#include "common/asserts.h"
1616
#include "common/utility.h"
17-
#include "common/version.h"
1817

19-
#include "config/systemconfig.h"
18+
#include "config/appconfig.h"
2019
#ifdef Q_OS_WIN
2120
#include "common/utility_win.h"
2221
#endif
2322
#include "configfile.h"
2423
#include "logger.h"
2524
#include "theme.h"
2625

27-
#include "creds/abstractcredentials.h"
28-
2926
#include "csync_exclude.h"
3027

3128
#include <QHeaderView>

test/testoauth.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "testutils/syncenginetestutils.h"
1414
#include "theme.h"
1515

16-
#include <config/systemconfig.h>
16+
#include <config/appconfig.h>
1717

1818
using namespace std::chrono_literals;
1919
using namespace OCC;
@@ -157,7 +157,7 @@ class OAuthTestCase : public QObject
157157

158158
QObject::connect(&desktopServiceHook, &DesktopServiceHook::hooked, this, &OAuthTestCase::openBrowserHook);
159159

160-
SystemConfig config;
160+
AppConfig config;
161161
auto out = std::make_unique<AccountBasedOAuth>(account, config.openIdConfig(), nullptr);
162162
QObject::connect(out.get(), &OAuth::result, this, &OAuthTestCase::oauthResult);
163163
return out;

0 commit comments

Comments
 (0)