changed technic icon name retrival
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
bb4b89470d
commit
f897b14e3e
@ -76,7 +76,7 @@ void ImportFTBPage::suggestCurrent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
dialog->setSuggestedPack(selected.name, new PackInstallTask(selected));
|
dialog->setSuggestedPack(selected.name, new PackInstallTask(selected));
|
||||||
QString editedLogoName = QString("ftb_%1.jpg").arg(selected.id);
|
QString editedLogoName = QString("ftb_%1_%2,jpg").arg(selected.name, selected.id);
|
||||||
dialog->setSuggestedIconFromFile(FS::PathCombine(selected.path, "folder.jpg"), editedLogoName);
|
dialog->setSuggestedIconFromFile(FS::PathCombine(selected.path, "folder.jpg"), editedLogoName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,11 +173,9 @@ void Page::suggestCurrent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
dialog->setSuggestedPack(selected.name, selectedVersion, new PackInstallTask(APPLICATION->network(), selected, selectedVersion));
|
dialog->setSuggestedPack(selected.name, selectedVersion, new PackInstallTask(APPLICATION->network(), selected, selectedVersion));
|
||||||
QString editedLogoName;
|
QString editedLogoName = selected.logo;
|
||||||
if (selected.logo.toLower().startsWith("ftb")) {
|
if (!selected.logo.toLower().startsWith("ftb")) {
|
||||||
editedLogoName = selected.logo;
|
editedLogoName = "ftb_" + editedLogoName;
|
||||||
} else {
|
|
||||||
editedLogoName = "ftb_" + selected.logo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected.type == PackType::Public) {
|
if (selected.type == PackType::Public) {
|
||||||
|
@ -34,14 +34,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "TechnicModel.h"
|
#include "TechnicModel.h"
|
||||||
#include <QUrl>
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "BuildConfig.h"
|
#include "BuildConfig.h"
|
||||||
#include "Json.h"
|
#include "Json.h"
|
||||||
|
|
||||||
#include "net/ApiDownload.h"
|
#include "net/ApiDownload.h"
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
Technic::ListModel::ListModel(QObject* parent) : QAbstractListModel(parent) {}
|
Technic::ListModel::ListModel(QObject* parent) : QAbstractListModel(parent) {}
|
||||||
|
|
||||||
@ -160,7 +161,7 @@ void Technic::ListModel::searchRequestFinished()
|
|||||||
pack.logoName = "null";
|
pack.logoName = "null";
|
||||||
} else {
|
} else {
|
||||||
pack.logoUrl = rawURL;
|
pack.logoUrl = rawURL;
|
||||||
pack.logoName = QUrl(rawURL).fileName();
|
pack.logoName = pack.slug + "." + QFileInfo(QUrl(rawURL).fileName()).suffix();
|
||||||
}
|
}
|
||||||
pack.broken = false;
|
pack.broken = false;
|
||||||
newList.append(pack);
|
newList.append(pack);
|
||||||
@ -182,7 +183,7 @@ void Technic::ListModel::searchRequestFinished()
|
|||||||
auto iconUrl = Json::requireString(iconObj, "url");
|
auto iconUrl = Json::requireString(iconObj, "url");
|
||||||
|
|
||||||
pack.logoUrl = iconUrl;
|
pack.logoUrl = iconUrl;
|
||||||
pack.logoName = QUrl(iconUrl).fileName();
|
pack.logoName = pack.slug + "." + QFileInfo(QUrl(iconUrl).fileName()).suffix();
|
||||||
} else {
|
} else {
|
||||||
pack.logoUrl = "null";
|
pack.logoUrl = "null";
|
||||||
pack.logoName = "null";
|
pack.logoName = "null";
|
||||||
|
Loading…
Reference in New Issue
Block a user