Make functions more generic
This commit is contained in:
parent
b2d10e578a
commit
b338f017c9
@ -144,7 +144,7 @@ void Fetcher::processEnclosure(Syndication::EnclosurePtr enclosure, Syndication:
|
||||
|
||||
QString Fetcher::image(QString url)
|
||||
{
|
||||
QString path = imagePath(url);
|
||||
QString path = filePath(url);
|
||||
if (QFileInfo::exists(path)) {
|
||||
return path;
|
||||
}
|
||||
@ -167,11 +167,11 @@ QString Fetcher::image(QString url)
|
||||
|
||||
void Fetcher::removeImage(QString url)
|
||||
{
|
||||
qDebug() << imagePath(url);
|
||||
QFile(imagePath(url)).remove();
|
||||
qDebug() << filePath(url);
|
||||
QFile(filePath(url)).remove();
|
||||
}
|
||||
|
||||
QString Fetcher::imagePath(QString url)
|
||||
QString Fetcher::filePath(QString url)
|
||||
{
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/") + QString::fromStdString(QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md5).toHex().toStdString());
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ private:
|
||||
Fetcher();
|
||||
Fetcher(const Fetcher &);
|
||||
|
||||
QString imagePath(QString);
|
||||
QString filePath(QString);
|
||||
void processFeed(Syndication::FeedPtr feed, QUrl url);
|
||||
void processEntry(Syndication::ItemPtr entry, QUrl url);
|
||||
void processAuthor(Syndication::PersonPtr author, Syndication::ItemPtr entry, QUrl url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user