Skip to content

Commit

Permalink
Merge branch 'master' into qstring-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech authored Oct 31, 2024
2 parents f209227 + 6af7f81 commit d9f91aa
Show file tree
Hide file tree
Showing 9 changed files with 571 additions and 555 deletions.
9 changes: 7 additions & 2 deletions src/gui/accountmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,18 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s

const auto settingsMapKeys = acc->_settingsMap.keys();
for (const auto &key : settingsMapKeys) {
if (!acc->_settingsMap.value(key).isValid()) {
continue;
}

settings.setValue(key, acc->_settingsMap.value(key));
}
settings.setValue(QLatin1String(authTypeC), acc->_credentials->authType());

// HACK: Save http_user also as user
if (acc->_settingsMap.contains(httpUserC)) {
settings.setValue(userC, acc->_settingsMap.value(httpUserC));
const auto settingsMap = acc->_settingsMap;
if (settingsMap.contains(httpUserC) && settingsMap.value(httpUserC).isValid()) {
settings.setValue(userC, settingsMap.value(httpUserC));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/creds/webflowcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void WebFlowCredentials::forgetSensitiveData() {

_account->deleteAppPassword();

const QString kck = keychainKey(_account->url().toString(), _user, _account->id());
const auto kck = keychainKey(_account->url().toString(), _user, _account->id());
if (kck.isEmpty()) {
qCDebug(lcWebFlowCredentials()) << "InvalidateToken: User is empty, bailing out!";
return;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/wizard/owncloudadvancedsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ void OwncloudAdvancedSetupPage::stopSpinner()

QUrl OwncloudAdvancedSetupPage::serverUrl() const
{
const QString urlString = dynamic_cast<OwncloudWizard *>(wizard())->ocUrl();
const QString user = dynamic_cast<OwncloudWizard *>(wizard())->getCredentials()->user();
const auto urlString = dynamic_cast<OwncloudWizard *>(wizard())->ocUrl();
const auto user = dynamic_cast<OwncloudWizard *>(wizard())->getCredentials()->user();

QUrl url(urlString);
url.setUserName(user);
Expand Down
11 changes: 6 additions & 5 deletions src/libsync/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,9 @@ QUrl Account::deprecatedPrivateLinkUrl(const QByteArray &numericFileId) const
*/
void Account::clearCookieJar()
{
auto jar = qobject_cast<CookieJar *>(_am->cookieJar());
const auto jar = qobject_cast<CookieJar *>(_am->cookieJar());
ASSERT(jar);
jar->setAllCookies(QList<QNetworkCookie>());
emit wantsAccountSaved(this);
}

/*! This shares our official cookie jar (containing all the tasty
Expand Down Expand Up @@ -530,11 +529,12 @@ void Account::setUserVisibleHost(const QString &host)
QVariant Account::credentialSetting(const QString &key) const
{
if (_credentials) {
QString prefix = _credentials->authType();
QVariant value = _settingsMap.value(prefix + "_" + key);
const auto prefix = _credentials->authType();
auto value = _settingsMap.value(prefix + "_" + key);
if (value.isNull()) {
value = _settingsMap.value(key);
}

return value;
}
return QVariant();
Expand Down Expand Up @@ -829,9 +829,10 @@ void Account::writeAppPasswordOnce(QString appPassword){
}

void Account::retrieveAppPassword(){
const QString key = credentials()->user() + app_password;
const QString kck = AbstractCredentials::keychainKey(
url().toString(),
credentials()->user() + app_password,
key,
id()
);

Expand Down
6 changes: 3 additions & 3 deletions translations/client_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ Diese Aktion bricht jede derzeit laufende Synchronisierung ab.</translation>
<message>
<location filename="../src/gui/accountsettings.cpp" line="1250"/>
<source>Obtaining authorization from the browser. &lt;a href=&apos;%1&apos;&gt;Click here&lt;/a&gt; to re-open the browser.</source>
<translation>Berechtigung vom Browser einholen. &lt;a href=&apos;%1&apos;&gt; Klicken Sie hier &lt;/a&gt;, um den Browser erneut zu öffnen.</translation>
<translation>Berechtigung mittels Browser erteilen. &lt;a href=&apos;%1&apos;&gt; Klicken Sie hier &lt;/a&gt;, um den Browser erneut zu öffnen.</translation>
</message>
<message>
<location filename="../src/gui/accountsettings.cpp" line="1254"/>
Expand Down Expand Up @@ -4206,7 +4206,7 @@ Dies ist ein neuer, experimenteller Modus. Wenn Sie sich entscheiden, ihn zu ver
<message>
<location filename="../src/libsync/discovery.cpp" line="355"/>
<source>The file name is a reserved name on this file system.</source>
<translation>Der Dateiname ist ein reservierter Name in diesem Dateisystem.</translation>
<translation>Der Dateiname ist in diesem Dateisystem reserviert.</translation>
</message>
<message>
<location filename="../src/libsync/discovery.cpp" line="394"/>
Expand Down Expand Up @@ -4289,7 +4289,7 @@ Dies ist ein neuer, experimenteller Modus. Wenn Sie sich entscheiden, ihn zu ver
<message>
<location filename="../src/libsync/discovery.cpp" line="441"/>
<source> Reason: the entire filename is forbidden.</source>
<translation> Grund: Der gesamte Dateiname ist verboten.</translation>
<translation> Grund: Der gesamte Dateiname ist unzulässig.</translation>
</message>
<message>
<location filename="../src/libsync/discovery.cpp" line="442"/>
Expand Down
Loading

0 comments on commit d9f91aa

Please sign in to comment.