feat(GODT-3046): removed unused error notifications, and added default user to bridge-gui-tester.

This commit is contained in:
Xavier Michelon
2023-11-01 09:36:28 +01:00
parent b34f5d072f
commit 5ca9a7db37
19 changed files with 684 additions and 718 deletions

View File

@ -208,17 +208,19 @@ QString randomLastName() {
//****************************************************************************************************************************************************
//
/// \param[in] firstName The user's first name. If empty, a random common US first name is used.
/// \param[in] lastName The user's last name. If empty, a random common US last name is used.
/// \return The user
//****************************************************************************************************************************************************
SPUser randomUser() {
SPUser randomUser(QString const &firstName, QString const &lastName) {
SPUser user = User::newUser(nullptr);
user->setID(QUuid::createUuid().toString());
QString const firstName = randomFirstName();
QString const lastName = randomLastName();
QString const username = QString("%1.%2").arg(firstName.toLower(), lastName.toLower());
QString const first = firstName.isEmpty() ? randomFirstName() : firstName;
QString const last = lastName.isEmpty() ? randomLastName() : lastName;
QString const username = QString("%1.%2").arg(first.toLower(), last.toLower());
user->setUsername(username);
user->setAddresses(QStringList() << (username + "@proton.me") << (username + "@protonmail.com"));
user->setPassword(QUuid().createUuid().toString(QUuid::StringFormat::WithoutBraces).left(20));
user->setPassword(QUuid::createUuid().toString(QUuid::StringFormat::WithoutBraces).left(20));
user->setAvatarText(firstName.left(1) + lastName.left(1));
user->setState(UserState::Connected);
user->setSplitMode(false);
@ -229,6 +231,16 @@ SPUser randomUser() {
}
//****************************************************************************************************************************************************
/// \return The default user. The name Eric Norbert is used on the proton.me website, and should be used for screenshots.
//****************************************************************************************************************************************************
SPUser defaultUser() {
SPUser user = randomUser("Eric", "Norbert");
user->setAddresses({"eric.norbert@proton.me", "eric_norbert_writes@protonmail.com"}); // we override the address list with addresses commonly used on screenshots proton.me
return user;
}
//****************************************************************************************************************************************************
/// \return The OS the application is running on.
//****************************************************************************************************************************************************

View File

@ -44,7 +44,8 @@ QString goos(); ///< return the value of Go's GOOS for the current platform ("d
qint64 randN(qint64 n); ///< return a random integer in the half open range [0,n)
QString randomFirstName(); ///< Get a random first name from a pre-determined list.
QString randomLastName(); ///< Get a random first name from a pre-determined list.
SPUser randomUser(); ///< Get a random user.
SPUser defaultUser(); ///< Return The default user, with the name and addresses used on screenshots on proton.me
SPUser randomUser(QString const &firstName = "", QString const &lastName = ""); ///< Get a random user.
OS os(); ///< Return the operating system.
bool onLinux(); ///< Check if the OS is Linux.
bool onMacOS(); ///< Check if the OS is macOS.

View File

@ -1298,18 +1298,10 @@ void GRPCClient::processCacheEvent(DiskCacheEvent const &event) {
switch (event.event_case()) {
case DiskCacheEvent::kError: {
switch (event.error().type()) {
case DISK_CACHE_UNAVAILABLE_ERROR:
this->logError("Cache error received: diskCacheUnavailable.");
emit diskCacheUnavailable();
break;
case CANT_MOVE_DISK_CACHE_ERROR:
this->logError("Cache error received: cantMoveDiskCache.");
emit cantMoveDiskCache();
break;
case DISK_FULL_ERROR:
this->logError("Cache error received: diskFull.");
emit diskFull();
break;
default:
this->logError("Unknown cache error event received.");
break;

View File

@ -113,9 +113,7 @@ public:
grpc::Status setDiskCachePath(QUrl const &path); ///< Performs the 'setDiskCachePath' call
signals:
void diskCacheUnavailable();
void cantMoveDiskCache();
void diskFull();
void diskCachePathChanged(QUrl const &path);
void diskCachePathChangeFinished();