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();
|
auto imageView = new ImageLabel();
|
||||||
imageView->setQPixmap(QPixmap::fromImage(image));
|
imageView->setQPixmap(QPixmap::fromImage(image));
|
||||||
previewLayout->addWidget(imageView);
|
previewLayout->addWidget(imageView, 1, Qt::AlignCenter);
|
||||||
|
|
||||||
m_titleEdit = new QLineEdit();
|
m_titleEdit = new QLineEdit();
|
||||||
|
m_titleEdit->setPlaceholderText(i18n("Untitled Artwork"));
|
||||||
formLayout->addRow(i18nc("@label:textbox", "Title"), m_titleEdit);
|
formLayout->addRow(i18nc("@label:textbox", "Title"), m_titleEdit);
|
||||||
|
|
||||||
m_knowExactDateBox = new QCheckBox();
|
m_knowExactDateBox = new QCheckBox();
|
||||||
|
|
|
@ -184,20 +184,12 @@ ArtPiece::ArtPiece(const QString &filename, const QString &assetFilename)
|
||||||
|
|
||||||
QUrl ArtPiece::getImagePath() const
|
QUrl ArtPiece::getImagePath() const
|
||||||
{
|
{
|
||||||
if (date.year() > 2022) {
|
const QFileInfo info(filename);
|
||||||
QFileInfo info(filename);
|
|
||||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/art/%1.jpg").arg(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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl ArtPiece::getThumbnailPath() const
|
QUrl ArtPiece::getThumbnailPath() const
|
||||||
{
|
{
|
||||||
if (date.year() > 2022) {
|
const QFileInfo info(filename);
|
||||||
QFileInfo info(filename);
|
|
||||||
return QUrl::fromUserInput(QStringLiteral("https://images.redstrate.com/thumb/%1.jpg").arg(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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue