Commit 5efa465c authored by Andreas Traczyk's avatar Andreas Traczyk

accounts: eliminate the notion of a default profile name

- Removes the use of the system current username as the default
  profile name in the account creation wizard, and also removes
  the insertion of "Jami account" as a profile name if the user
  clears the profile name text field.

- For accounts lacking profile name and registered name:
  - fixes the best name display in the account selection combobox
  - fixes the fallback avatar choice

Change-Id: If38d575274542bd59b11dac8a17d983edcbd266c
parent a2aa7e42
......@@ -143,7 +143,6 @@ AccountItemDelegate::paint(QPainter* painter,
}
// Display the secondary ID under the name
QString idStr = index.data(static_cast<int>(AccountListModel::Role::Username)).value<QString>();
if (idStr != name.toString()) {
fontSecondary.setItalic(false);
......
......@@ -60,7 +60,7 @@ QVariant AccountListModel::data(const QModelIndex &index, int role) const
switch (role) {
case Role::Alias:
case Qt::DisplayRole:
return QVariant(QString::fromStdString(accountInfo.profileInfo.alias));
return QVariant(QString::fromStdString(Utils::bestNameForAccount(accountInfo)));
case Role::Username:
return QVariant(QString::fromStdString(Utils::secondBestNameForAccount(accountInfo)));
case Role::Type:
......
......@@ -32,8 +32,6 @@
#include "utils.h"
#include "ringthemeutils.h"
const QString DEFAULT_RING_ACCT_ALIAS = QObject::tr("Jami account", "Default alias for new Jami account");
NewWizardWidget::NewWizardWidget(QWidget* parent) :
NavWidget(parent),
ui(new Ui::NewWizardWidget),
......@@ -188,7 +186,7 @@ void NewWizardWidget::changePage(QWidget* toPage)
ui->confirmPasswordEdit->clear();
ui->signUpCheckbox->setChecked(true);
ui->usernameEdit->setEnabled(true);
ui->fullNameEdit->setText(Utils::GetCurrentUserName());
ui->fullNameEdit->setText(QString());
setNavBarVisibility(true);
updateCustomUI();
registeredNameFoundConnection_ = connect(
......
......@@ -353,9 +353,10 @@ PixbufManipulator::accountPhoto(const lrc::api::account::Info& accountInfo)
else {
auto bestId = Utils::bestIdForAccount(accountInfo);
auto bestName = Utils::bestNameForAccount(accountInfo);
QString letterStr = bestId == bestName ? QString() : QString::fromStdString(bestName);
photo = fallbackAvatar( IMAGE_SIZE,
QString::fromStdString("ring:" + bestId),
QString::fromStdString(bestName));
letterStr);
}
return QVariant::fromValue(scaleAndFrame(photo, IMAGE_SIZE));
}
......@@ -166,18 +166,6 @@ Utils::GetISODate() {
#endif
}
QString
Utils::GetCurrentUserName() {
#ifdef Q_OS_WIN
wchar_t username[UNLEN+1];
DWORD username_len = UNLEN+1;
GetUserName(username, &username_len);
return QString::fromWCharArray(username, username_len-1);
#else
return QString();
#endif
}
void
Utils::InvokeMailto(const QString& subject,
const QString& body,
......
......@@ -56,7 +56,6 @@ namespace Utils
QString GetRingtonePath();
QString GenGUID();
QString GetISODate();
QString GetCurrentUserName();
void InvokeMailto(const QString& subject, const QString& body, const QString& attachement = QString());
QImage getCirclePhoto(const QImage original, int sizePhoto);
void setStackWidget(QStackedWidget *stack, QWidget *widget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment