Fixes for new image hosting format
This commit is contained in:
parent
3d2cbfb552
commit
9ab54d0b9e
3 changed files with 6 additions and 14 deletions
|
@ -68,9 +68,10 @@ ArtDetailWindow::ArtDetailWindow(const QString &filename, const QUrl &imagePath,
|
|||
|
||||
auto imageView = new ImageLabel();
|
||||
imageView->setQPixmap(QPixmap::fromImage(image));
|
||||
previewLayout->addWidget(imageView);
|
||||
previewLayout->addWidget(imageView, 1, Qt::AlignCenter);
|
||||
|
||||
m_titleEdit = new QLineEdit();
|
||||
m_titleEdit->setPlaceholderText(i18n("Untitled Artwork"));
|
||||
formLayout->addRow(i18nc("@label:textbox", "Title"), m_titleEdit);
|
||||
|
||||
m_knowExactDateBox = new QCheckBox();
|
||||
|
|
|
@ -184,20 +184,12 @@ ArtPiece::ArtPiece(const QString &filename, const QString &assetFilename)
|
|||
|
||||
QUrl ArtPiece::getImagePath() const
|
||||
{
|
||||
if (date.year() > 2022) {
|
||||
QFileInfo info(filename);
|
||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/art/%1.jpg").arg(info.fileName()));
|
||||
} else {
|
||||
return QUrl::fromLocalFile(QStringLiteral("%1.webp").arg(filename));
|
||||
}
|
||||
const QFileInfo info(filename);
|
||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/art/%1.jpg").arg(info.fileName()));
|
||||
}
|
||||
|
||||
QUrl ArtPiece::getThumbnailPath() const
|
||||
{
|
||||
if (date.year() > 2022) {
|
||||
QFileInfo info(filename);
|
||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/thumb/%1.jpg").arg(info.fileName()));
|
||||
} else {
|
||||
return QUrl::fromLocalFile(QStringLiteral("%1.webp").arg(filename));
|
||||
}
|
||||
const QFileInfo info(filename);
|
||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/thumb/%1.jpg").arg(info.fileName()));
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <KLocalizedString>
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDir>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue