mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-06 08:35:27 +02:00
accountadapter: do not set incorrect ringtone on creation
On GNU/Linux, the ringtone is managed by the deamon. No need to manage it (incorrectly) in the client Change-Id: I38fe783d6bd0778f702ee6da333468c54d59d678 GitLab: #351
This commit is contained in:
parent
2eac155b0c
commit
12daccb51f
2 changed files with 33 additions and 22 deletions
|
@ -99,7 +99,9 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
|||
&lrc::api::NewAccountModel::accountAdded,
|
||||
[this, registeredName, settings, isCreating](const QString& accountId) {
|
||||
auto confProps = lrcInstance_->accountModel().getAccountConfig(accountId);
|
||||
#ifdef Q_OS_WIN
|
||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||
#endif
|
||||
confProps.isRendezVous = settings["isRendezVous"].toBool();
|
||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||
|
||||
|
@ -108,19 +110,21 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
|||
.toBool();
|
||||
if (!registeredName.isEmpty()) {
|
||||
QObject::disconnect(registeredNameSavedConnection_);
|
||||
registeredNameSavedConnection_ = connect(
|
||||
&lrcInstance_->accountModel(),
|
||||
&lrc::api::NewAccountModel::profileUpdated,
|
||||
[this, showBackup, addedAccountId = accountId](const QString& accountId) {
|
||||
if (addedAccountId == accountId) {
|
||||
Q_EMIT lrcInstance_->accountListChanged();
|
||||
Q_EMIT accountAdded(accountId,
|
||||
showBackup,
|
||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
||||
accountId));
|
||||
QObject::disconnect(registeredNameSavedConnection_);
|
||||
}
|
||||
});
|
||||
registeredNameSavedConnection_
|
||||
= connect(&lrcInstance_->accountModel(),
|
||||
&lrc::api::NewAccountModel::profileUpdated,
|
||||
[this, showBackup, addedAccountId = accountId](
|
||||
const QString& accountId) {
|
||||
if (addedAccountId == accountId) {
|
||||
Q_EMIT lrcInstance_->accountListChanged();
|
||||
Q_EMIT accountAdded(accountId,
|
||||
showBackup,
|
||||
lrcInstance_->accountModel()
|
||||
.getAccountList()
|
||||
.indexOf(accountId));
|
||||
QObject::disconnect(registeredNameSavedConnection_);
|
||||
}
|
||||
});
|
||||
|
||||
lrcInstance_->accountModel().registerName(accountId,
|
||||
settings["password"].toString(),
|
||||
|
@ -128,8 +132,9 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
|||
} else {
|
||||
Q_EMIT lrcInstance_->accountListChanged();
|
||||
Q_EMIT accountAdded(accountId,
|
||||
showBackup,
|
||||
lrcInstance_->accountModel().getAccountList().indexOf(accountId));
|
||||
showBackup,
|
||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
||||
accountId));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -158,14 +163,17 @@ AccountAdapter::createSIPAccount(const QVariantMap& settings)
|
|||
confProps.username = settings["username"].toString();
|
||||
confProps.password = settings["password"].toString();
|
||||
confProps.routeset = settings["proxy"].toString();
|
||||
#ifdef Q_OS_WIN
|
||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||
#endif
|
||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||
|
||||
Q_EMIT lrcInstance_->accountListChanged();
|
||||
Q_EMIT accountAdded(accountId,
|
||||
false,
|
||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
||||
accountId));
|
||||
false,
|
||||
lrcInstance_->accountModel()
|
||||
.getAccountList()
|
||||
.indexOf(accountId));
|
||||
});
|
||||
|
||||
connectFailure();
|
||||
|
@ -192,13 +200,16 @@ AccountAdapter::createJAMSAccount(const QVariantMap& settings)
|
|||
|
||||
auto confProps = lrcInstance_->accountModel().getAccountConfig(
|
||||
accountId);
|
||||
#ifdef Q_OS_WIN
|
||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||
#endif
|
||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||
|
||||
Q_EMIT accountAdded(accountId,
|
||||
false,
|
||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
||||
accountId));
|
||||
false,
|
||||
lrcInstance_->accountModel()
|
||||
.getAccountList()
|
||||
.indexOf(accountId));
|
||||
Q_EMIT lrcInstance_->accountListChanged();
|
||||
});
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ Utils::GetRingtonePath()
|
|||
#ifdef Q_OS_WIN
|
||||
return QCoreApplication::applicationDirPath() + "\\ringtones\\default.opus";
|
||||
#else
|
||||
return QString("/usr/local");
|
||||
return QString("/usr/share/ring/ringtones/default.opus");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue