mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-07-07 09:05:25 +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,
|
&lrc::api::NewAccountModel::accountAdded,
|
||||||
[this, registeredName, settings, isCreating](const QString& accountId) {
|
[this, registeredName, settings, isCreating](const QString& accountId) {
|
||||||
auto confProps = lrcInstance_->accountModel().getAccountConfig(accountId);
|
auto confProps = lrcInstance_->accountModel().getAccountConfig(accountId);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||||
|
#endif
|
||||||
confProps.isRendezVous = settings["isRendezVous"].toBool();
|
confProps.isRendezVous = settings["isRendezVous"].toBool();
|
||||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||||
|
|
||||||
|
@ -108,16 +110,18 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
||||||
.toBool();
|
.toBool();
|
||||||
if (!registeredName.isEmpty()) {
|
if (!registeredName.isEmpty()) {
|
||||||
QObject::disconnect(registeredNameSavedConnection_);
|
QObject::disconnect(registeredNameSavedConnection_);
|
||||||
registeredNameSavedConnection_ = connect(
|
registeredNameSavedConnection_
|
||||||
&lrcInstance_->accountModel(),
|
= connect(&lrcInstance_->accountModel(),
|
||||||
&lrc::api::NewAccountModel::profileUpdated,
|
&lrc::api::NewAccountModel::profileUpdated,
|
||||||
[this, showBackup, addedAccountId = accountId](const QString& accountId) {
|
[this, showBackup, addedAccountId = accountId](
|
||||||
|
const QString& accountId) {
|
||||||
if (addedAccountId == accountId) {
|
if (addedAccountId == accountId) {
|
||||||
Q_EMIT lrcInstance_->accountListChanged();
|
Q_EMIT lrcInstance_->accountListChanged();
|
||||||
Q_EMIT accountAdded(accountId,
|
Q_EMIT accountAdded(accountId,
|
||||||
showBackup,
|
showBackup,
|
||||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
lrcInstance_->accountModel()
|
||||||
accountId));
|
.getAccountList()
|
||||||
|
.indexOf(accountId));
|
||||||
QObject::disconnect(registeredNameSavedConnection_);
|
QObject::disconnect(registeredNameSavedConnection_);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -129,7 +133,8 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
||||||
Q_EMIT lrcInstance_->accountListChanged();
|
Q_EMIT lrcInstance_->accountListChanged();
|
||||||
Q_EMIT accountAdded(accountId,
|
Q_EMIT accountAdded(accountId,
|
||||||
showBackup,
|
showBackup,
|
||||||
lrcInstance_->accountModel().getAccountList().indexOf(accountId));
|
lrcInstance_->accountModel().getAccountList().indexOf(
|
||||||
|
accountId));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -158,14 +163,17 @@ AccountAdapter::createSIPAccount(const QVariantMap& settings)
|
||||||
confProps.username = settings["username"].toString();
|
confProps.username = settings["username"].toString();
|
||||||
confProps.password = settings["password"].toString();
|
confProps.password = settings["password"].toString();
|
||||||
confProps.routeset = settings["proxy"].toString();
|
confProps.routeset = settings["proxy"].toString();
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||||
|
#endif
|
||||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||||
|
|
||||||
Q_EMIT lrcInstance_->accountListChanged();
|
Q_EMIT lrcInstance_->accountListChanged();
|
||||||
Q_EMIT accountAdded(accountId,
|
Q_EMIT accountAdded(accountId,
|
||||||
false,
|
false,
|
||||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
lrcInstance_->accountModel()
|
||||||
accountId));
|
.getAccountList()
|
||||||
|
.indexOf(accountId));
|
||||||
});
|
});
|
||||||
|
|
||||||
connectFailure();
|
connectFailure();
|
||||||
|
@ -192,13 +200,16 @@ AccountAdapter::createJAMSAccount(const QVariantMap& settings)
|
||||||
|
|
||||||
auto confProps = lrcInstance_->accountModel().getAccountConfig(
|
auto confProps = lrcInstance_->accountModel().getAccountConfig(
|
||||||
accountId);
|
accountId);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
|
||||||
|
#endif
|
||||||
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
|
||||||
|
|
||||||
Q_EMIT accountAdded(accountId,
|
Q_EMIT accountAdded(accountId,
|
||||||
false,
|
false,
|
||||||
lrcInstance_->accountModel().getAccountList().indexOf(
|
lrcInstance_->accountModel()
|
||||||
accountId));
|
.getAccountList()
|
||||||
|
.indexOf(accountId));
|
||||||
Q_EMIT lrcInstance_->accountListChanged();
|
Q_EMIT lrcInstance_->accountListChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ Utils::GetRingtonePath()
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
return QCoreApplication::applicationDirPath() + "\\ringtones\\default.opus";
|
return QCoreApplication::applicationDirPath() + "\\ringtones\\default.opus";
|
||||||
#else
|
#else
|
||||||
return QString("/usr/local");
|
return QString("/usr/share/ring/ringtones/default.opus");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue