Skip to content

Commit

Permalink
Merge branch 'master' into work/load-translations-early
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Oct 27, 2023
2 parents 42a5a00 + 468099d commit 40b1243
Show file tree
Hide file tree
Showing 53 changed files with 1,698 additions and 1,363 deletions.
13 changes: 7 additions & 6 deletions .github/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ __TODO__:
### Copy for Each Build (Beta/RC)

* [ ] DEV: Tag (Beta or RC) and build [builds](https://confluence.owncloud.com/display/OG/Build+and+Tags#BuildandTags-Sprintbuild) for theme 'ownCloud' and 'testpilotcloud' (includes ChangeLog for the tag on https://github.com/owncloud/client/releases/)
* [ ] Smoke test
* [ ] GitHub release
* [ ] QA: [Smoke test](https://owncloud.testrail.io/index.php?/cases/view/2469) (for public prelease)
* [ ] DEV: GitHub release
* [ ] Beta/RC [Communication](https://confluence.owncloud.com/x/loJK)
* [ ] Inform ``#updates`` and ``#marketing`` that we have Beta/RC
* [ ] For public prerelease: Tell marketing to send email to beta testers
* [ ] For public prerelease: Write Central post https://central.owncloud.org/tags/c/news/desktop with link to github release
* [ ] Inform ``#updates`` that we have Beta/RC
* [ ] For public prerelease: Inform ``#marketing`` and tell them to send email to beta testers
* [ ] For public prerelease: Write/edit Central post https://central.owncloud.org/tags/c/news/desktop with link to github release
* [ ] DEV: Prepare the update server for new version (AppImages included)
* [ ] DEV: Provide 'testpilotcloud' on **Beta** update channel

Expand Down Expand Up @@ -73,11 +73,12 @@ __TODO__:

* [ ] QA: [Smoke test](https://confluence.owncloud.com/display/OG/Manual+Tests#ManualTests-SmokeTest)
* [ ] DEV: Publish the release in GitHub
* [ ] QA: Update lines 4 and 5 of [install docs](https://github.com/owncloud/docs-client-desktop/blob/master/modules/ROOT/pages/installing.adoc) with the final build number
* [ ] QA: Check that [documentation](https://doc.owncloud.com/desktop/next/) offers the new version

### [Marketing and Communication](https://confluence.owncloud.com/display/OG/Marketing+and+Communication)

* [ ] QA: Ping ``#marketing``: @bwalter to update links on https://owncloud.com/desktop-app/ (provide links from github releases) and @mfeilner to update [wiki de](https://de.wikipedia.org/wiki/OwnCloud), [wiki en](https://en.wikipedia.org/wiki/OwnCloud), [wikidata](https://www.wikidata.org/wiki/Q20763576))
* [ ] QA: Ping ``#marketing``at marketing@owncloud.com; @bwalter to update links on https://owncloud.com/desktop-app/ (provide links from github releases) and @mfeilner to update [wiki de](https://de.wikipedia.org/wiki/OwnCloud), [wiki en](https://en.wikipedia.org/wiki/OwnCloud), [wikidata](https://www.wikidata.org/wiki/Q20763576))
* [ ] QA: Central post https://central.owncloud.org/tags/c/news/desktop
* [ ] QA: Inform on ``#updates`` channel
* [ ] QA: Inform [packagers](https://confluence.owncloud.com/x/QYLEAg)
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ Summary
-------

* Bugfix - Crash when accepting a notification: [#11226](https://github.com/owncloud/client/issues/11226)
* Bugfix - Fix crash on start-up when starting shell integration: [#11280](https://github.com/owncloud/client/issues/11280)
* Bugfix - Properly schedule the sync after an account was added: [#11308](https://github.com/owncloud/client/issues/11308)
* Bugfix - Don't start credentials save jobs during shutdown: [#11313](https://github.com/owncloud/client/pull/11313)
* Change - Remove unused command line option --language: [#11245](https://github.com/owncloud/client/issues/11245)
* Change - Windows: always use fusion style: [#11275](https://github.com/owncloud/client/issues/11275)

Details
-------
Expand All @@ -20,6 +24,30 @@ Details

https://github.com/owncloud/client/issues/11226

* Bugfix - Fix crash on start-up when starting shell integration: [#11280](https://github.com/owncloud/client/issues/11280)

A possible crash has been fixed that could occur during start-up, when the shell integration
started doing requests before the client itself completed starting up.

https://github.com/owncloud/client/issues/11280
https://github.com/owncloud/client/pull/11288

* Bugfix - Properly schedule the sync after an account was added: [#11308](https://github.com/owncloud/client/issues/11308)

We fixed a bug where a folder was scheduled to be synced before the account reported it was ready.
This resulted in the sync having no effect and the folder was then only synced once we polled the
etag.

https://github.com/owncloud/client/issues/11308

* Bugfix - Don't start credentials save jobs during shutdown: [#11313](https://github.com/owncloud/client/pull/11313)

Due to a bug we "re saved" the credentials during application shutdown. As the application was
quitting while the jobs where running we might have encountered corruped credentials or
crashes.

https://github.com/owncloud/client/pull/11313

* Change - Remove unused command line option --language: [#11245](https://github.com/owncloud/client/issues/11245)

This option was used before the UI language could be chosen in the settings. The option
Expand All @@ -28,6 +56,14 @@ Details
https://github.com/owncloud/client/issues/11245
https://github.com/owncloud/client/pull/11270

* Change - Windows: always use fusion style: [#11275](https://github.com/owncloud/client/issues/11275)

We already used the fusion style on Windows for years if the system used dpi scaling. Since Qt6.5
the fusion style also support the dark theme on Windows. Those two reasons convinced us that
always using the fusion style on Windows will result in the best experience for the users.

https://github.com/owncloud/client/issues/11275

Changelog for ownCloud Desktop Client [5.0.0] (2023-10-05)
=======================================
The following sections list the changes in ownCloud Desktop Client 5.0.0 relevant to
Expand Down
8 changes: 8 additions & 0 deletions changelog/unreleased/11275
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Change: Windows: always use fusion style

We already used the fusion style on Windows for years if the system used dpi scaling.
Since Qt6.5 the fusion style also support the dark theme on Windows.
Those two reasons convinced us that always using the fusion style on Windows will result
in the best experience for the users.

https://github.com/owncloud/client/issues/11275
8 changes: 8 additions & 0 deletions changelog/unreleased/11288
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Fix crash on start-up when starting shell integration

A possible crash has been fixed that could occur during start-up, when
the shell integration started doing requests before the client itself
completed starting up.

https://github.com/owncloud/client/issues/11280
https://github.com/owncloud/client/pull/11288
6 changes: 6 additions & 0 deletions changelog/unreleased/11308
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Properly schedule the sync after an account was added

We fixed a bug where a folder was scheduled to be synced before the account reported it was ready.
This resulted in the sync having no effect and the folder was then only synced once we polled the etag.

https://github.com/owncloud/client/issues/11308
6 changes: 6 additions & 0 deletions changelog/unreleased/11313
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Don't start credentials save jobs during shutdown

Due to a bug we "re saved" the credentials during application shutdown.
As the application was quitting while the jobs where running we might have encountered corruped credentials or crashes.

https://github.com/owncloud/client/pull/11313
9 changes: 1 addition & 8 deletions src/crashreporter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);

#ifdef Q_OS_WIN
// The Windows style still has pixelated elements with Qt 5.6,
// it's recommended to use the Fusion style in this case, even
// though it looks slightly less native. Check here after the
// QApplication was constructed, but before any QWidget is
// constructed.
if (!qFuzzyCompare(app.devicePixelRatio(), 1)) {
QApplication::setStyle(QStringLiteral("fusion"));
}
QApplication::setStyle(QStringLiteral("fusion"));
#endif // Q_OS_WIN

if (app.arguments().size() != 2) {
Expand Down
14 changes: 11 additions & 3 deletions src/gui/accountsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,10 @@ void AccountSettings::slotAccountStateChanged()
_toggleSignInOutAction->setText(tr("Log out"));
}

ui->addButton->setEnabled(state == AccountState::Connected);
if (state == AccountState::Connected) {
ui->_folderList->setItemsExpandable(true);
ui->addButton->setEnabled(true);

if (_accountState->supportsSpaces()) {
ui->addButton->setText(tr("Add Space"));
ui->addButton->setToolTip(tr("Click this button to add a Space."));
Expand All @@ -840,8 +841,15 @@ void AccountSettings::slotAccountStateChanged()
}
} else {
ui->_folderList->setItemsExpandable(false);
ui->addButton->setText(tr("Add Folder"));
ui->addButton->setToolTip(tr("You need to be connected to add a folder."));
ui->addButton->setEnabled(false);

if (_accountState->supportsSpaces()) {
ui->addButton->setText(tr("Add Space"));
ui->addButton->setToolTip(tr("You need to be connected to add a Space."));
} else {
ui->addButton->setText(tr("Add Folder"));
ui->addButton->setToolTip(tr("You need to be connected to add a folder."));
}

/* check if there are expanded root items, if so, close them */
ui->_folderList->collapseAll();
Expand Down
7 changes: 5 additions & 2 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void Application::slotAccountStateAdded(AccountStatePtr accountState) const
});

// Hook up the folder manager slots to the account state's signals:
connect(accountState.data(), &AccountState::stateChanged, FolderMan::instance(), &FolderMan::slotAccountStateChanged);
connect(accountState.data(), &AccountState::isConnectedChanged, FolderMan::instance(), &FolderMan::slotIsConnectedChanged);
connect(accountState->account().data(), &Account::serverVersionChanged, FolderMan::instance(),
[account = accountState->account().data()] { FolderMan::instance()->slotServerVersionChanged(account); });
accountState->checkConnectivity();
Expand All @@ -183,7 +183,10 @@ void Application::slotCleanup()
_gui->slotShutdown();
delete _gui;

AccountManager::instance()->save();
// by now the credentials are supposed to be persisted
// don't start async credentials jobs during shutdown
AccountManager::instance()->save(false);

FolderMan::instance()->unloadAndDeleteAllFolders();

// Remove the account from the account manager so it can be deleted.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void FolderMan::slotSyncOnceFileUnlocks(const QString &path, FileSystem::LockMod
_lockWatcher->addFile(path, mode);
}

void FolderMan::slotAccountStateChanged()
void FolderMan::slotIsConnectedChanged()
{
AccountStatePtr accountState(qobject_cast<AccountState *>(sender()));
if (!accountState) {
Expand Down
2 changes: 1 addition & 1 deletion src/gui/folderman.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public slots:
* Schedules folders of newly connected accounts, terminates and
* de-schedules folders of disconnected accounts.
*/
void slotAccountStateChanged();
void slotIsConnectedChanged();

/**
* restart the client as soon as it is possible, ie. no folders syncing.
Expand Down
6 changes: 5 additions & 1 deletion src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "common/version.h"
#include "gui/translations.h"
#include "libsync/logger.h"
#include "socketapi/socketapi.h"

#include <kdsingleapplication.h>

Expand Down Expand Up @@ -470,7 +471,7 @@ int main(int argc, char **argv)
return -1;
}

FolderMan::instance()->setSyncEnabled(true);
folderManager->setSyncEnabled(true);

auto ocApp = Application::createInstance(platform.get(), displayLanguage, options.debugMode);

Expand Down Expand Up @@ -523,5 +524,8 @@ int main(int argc, char **argv)
QTimer::singleShot(0, ocApp->gui(), &ownCloudGui::runNewAccountWizard);
}

// Now that everything is up and running, start accepting connections/requests from the shell integration.
folderManager->socketApi()->startShellIntegration();

return app.exec();
}
14 changes: 10 additions & 4 deletions src/gui/scheduling/etagwatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ void ETagWatcher::updateEtag(Folder *f, const QString &etag)
if (OC_ENSURE_NOT(etag.isEmpty())) {
auto &info = _lastEtagJob[f];
if (f->canSync() && info.etag != etag) {
qCDebug(lcEtagWatcher) << "Scheduling sync of" << f->displayName() << "due to an etag change";
qCDebug(lcEtagWatcher) << "Scheduling sync of" << f->displayName() << f->path() << "due to an etag change";
info.etag = etag;
_folderMan->scheduler()->enqueueFolder(f);
}
info.lastUpdate.reset();
} else {
qCWarning(lcEtagWatcher) << "Invalid empty etag received for" << f->displayName() << f->path();
}
}

Expand All @@ -102,11 +104,15 @@ void ETagWatcher::startOC10EtagJob(Folder *f)
requestEtagJob->setTimeout(pollTimeoutC);
connect(requestEtagJob, &RequestEtagJob::finishedSignal, this, [requestEtagJob, f, this] {
if (requestEtagJob->httpStatusCode() == 207) {
updateEtag(f, requestEtagJob->etag());
f->accountState()->tagLastSuccessfullETagRequest(requestEtagJob->responseQTimeStamp());
if (OC_ENSURE_NOT(requestEtagJob->etag().isEmpty())) {
f->accountState()->tagLastSuccessfullETagRequest(requestEtagJob->responseQTimeStamp());
updateEtag(f, requestEtagJob->etag());
} else {
qCWarning(lcEtagWatcher) << "Invalid empty etag received for" << f->displayName() << f->path() << requestEtagJob;
}
}
});
qCDebug(lcEtagWatcher) << "Starting etag check for folder" << f->displayName();
qCDebug(lcEtagWatcher) << "Starting etag check for folder" << f->displayName() << f->path();
requestEtagJob->start();
}
}
Expand Down
32 changes: 17 additions & 15 deletions src/gui/socketapi/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,39 +140,28 @@ SocketApi::SocketApi(QObject *parent)
qRegisterMetaType<QSharedPointer<SocketApiJob>>("QSharedPointer<SocketApiJob>");
qRegisterMetaType<QSharedPointer<SocketApiJobV2>>("QSharedPointer<SocketApiJobV2>");

const QString socketPath = Utility::socketApiSocketPath();
_socketPath = Utility::socketApiSocketPath();

// Remove any old socket that might be lying around:
SocketApiServer::removeServer(socketPath);
SocketApiServer::removeServer(_socketPath);

// Create the socket path:
if (!Utility::isMac()) {
// Not on macOS: there the directory is there, and created for us by the sandboxing
// environment, because we belong to an App Group.
QFileInfo info(socketPath);
QFileInfo info(_socketPath);
if (!info.dir().exists()) {
bool result = info.dir().mkpath(QStringLiteral("."));
qCDebug(lcSocketApi) << "creating" << info.dir().path() << result;
if (result) {
QFile::setPermissions(socketPath,
QFile::Permissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner));
QFile::setPermissions(_socketPath, QFile::Permissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner));
}
}
}

// Wire up the server instance to us, so we can accept new connections:
connect(&_localServer, &SocketApiServer::newConnection, this, &SocketApi::slotNewConnection);

// Start listeneing:
if (_localServer.listen(socketPath)) {
qCInfo(lcSocketApi) << "server started, listening at " << socketPath;
} else {
qCWarning(lcSocketApi) << "can't start server" << socketPath;
}

// Now we're ready to start the native shell integration:
Utility::startShellIntegration();

connect(AccountManager::instance(), &AccountManager::accountRemoved, this, [this](const auto &accountState) {
if (_registeredAccounts.contains(accountState->account())) {
unregisterAccount(accountState->account());
Expand All @@ -189,6 +178,19 @@ SocketApi::~SocketApi()
_listeners.clear();
}

void SocketApi::startShellIntegration()
{
// Start listeneing:
if (_localServer.listen(_socketPath)) {
qCInfo(lcSocketApi) << "server started, listening at " << _socketPath;
} else {
qCWarning(lcSocketApi) << "can't start server" << _socketPath;
}

// Now we're ready to start the native shell integration:
Utility::startShellIntegration();
}

void SocketApi::slotNewConnection()
{
// Note that on macOS this is not actually a line-based QIODevice, it's a SocketApiSocket which is our
Expand Down
3 changes: 3 additions & 0 deletions src/gui/socketapi/socketapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class SocketApi : public QObject
explicit SocketApi(QObject *parent = nullptr);
~SocketApi() override;

void startShellIntegration();

public slots:
void registerAccount(const AccountPtr &a);
void unregisterAccount(const AccountPtr &a);
Expand Down Expand Up @@ -155,6 +157,7 @@ private slots:

QString buildRegisterPathMessage(const QString &path);

QString _socketPath;
QSet<Folder *> _registeredFolders;
QSet<AccountPtr> _registeredAccounts;
QMap<SocketApiSocket *, QSharedPointer<SocketListener>> _listeners;
Expand Down

0 comments on commit 40b1243

Please sign in to comment.