Changeset View
Changeset View
Standalone View
Standalone View
src/accountinfo.cpp
Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Line(s) | |||||
400 | 400 | | |||
401 | void AccountInfo::openGallery() | 401 | void AccountInfo::openGallery() | ||
402 | { | 402 | { | ||
403 | QScopedPointer<AvatarGallery> gallery(new AvatarGallery()); | 403 | QScopedPointer<AvatarGallery> gallery(new AvatarGallery()); | ||
404 | if (gallery->exec() != QDialog::Accepted) { | 404 | if (gallery->exec() != QDialog::Accepted) { | ||
405 | return; | 405 | return; | ||
406 | } | 406 | } | ||
407 | 407 | | |||
408 | CreateAvatarJob *job = new CreateAvatarJob(this); | 408 | QString path = gallery->url().toLocalFile(); | ||
409 | connect(job, &KJob::finished, this, &AccountInfo::avatarCreated); | 409 | m_info->face->setIcon(QIcon(path)); | ||
410 | job->setUrl(gallery->url()); | 410 | m_infoToSave.insert(AccountModel::Face, path); | ||
411 | job->start(); | 411 | Q_EMIT changed(true); | ||
412 | } | 412 | } | ||
413 | 413 | | |||
414 | QStringList AccountInfo::imageFormats() const | 414 | QStringList AccountInfo::imageFormats() const | ||
415 | { | 415 | { | ||
416 | QStringList result; | 416 | QStringList result; | ||
417 | for(const QByteArray b: QImageReader::supportedMimeTypes()) { | 417 | for(const QByteArray b: QImageReader::supportedMimeTypes()) { | ||
418 | if (! b.isEmpty()) | 418 | if (! b.isEmpty()) | ||
419 | result.append(QString(b)); | 419 | result.append(QString(b)); | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |