mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Choose cyclist default to no avatar (#4814)
Minor change, but it does make selecting an athlete with no avatar easier.
This commit is contained in:
@@ -110,11 +110,14 @@ ChooseCyclistDialog::getList()
|
|||||||
|
|
||||||
QListWidgetItem *newone = new QListWidgetItem(name, listWidget);
|
QListWidgetItem *newone = new QListWidgetItem(name, listWidget);
|
||||||
|
|
||||||
// get avatar image if it exists
|
// get avatar image if it exists, otherwise default to noavatar.png
|
||||||
QString iconpath = home.absolutePath() + "/" + name + "/config/avatar.png";
|
QString iconpath = home.absolutePath() + "/" + name + "/config/avatar.png";
|
||||||
if (QFile(iconpath).exists()) {
|
if (QFile(iconpath).exists()) {
|
||||||
QPixmap px(iconpath);
|
QPixmap px(iconpath);
|
||||||
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
||||||
|
} else {
|
||||||
|
QPixmap px(":images/noavatar.png");
|
||||||
|
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// taller less spacing
|
// taller less spacing
|
||||||
@@ -220,6 +223,9 @@ ChooseCyclistDialog::newClicked()
|
|||||||
if (QFile(iconpath).exists()) {
|
if (QFile(iconpath).exists()) {
|
||||||
QPixmap px(iconpath);
|
QPixmap px(iconpath);
|
||||||
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
||||||
|
} else {
|
||||||
|
QPixmap px(":images/noavatar.png");
|
||||||
|
newone->setIcon(QIcon(px.scaled(64 *dpiXFactor,64 *dpiYFactor)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// taller less spacing
|
// taller less spacing
|
||||||
|
|||||||
Reference in New Issue
Block a user