mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-30 20:27:02 +00:00
Revert all the disaster
This commit is contained in:
@@ -72,7 +72,7 @@ int Technic::ListModel::rowCount(const QModelIndex&) const
|
||||
|
||||
void Technic::ListModel::searchWithTerm(const QString& term)
|
||||
{
|
||||
if(currentSearchTerm == term) {
|
||||
if(currentSearchTerm == term && currentSearchTerm.isNull() == term.isNull()) {
|
||||
return;
|
||||
}
|
||||
currentSearchTerm = term;
|
||||
@@ -93,9 +93,18 @@ void Technic::ListModel::searchWithTerm(const QString& term)
|
||||
void Technic::ListModel::performSearch()
|
||||
{
|
||||
NetJob *netJob = new NetJob("Technic::Search");
|
||||
auto searchUrl = QString(
|
||||
"https://api.technicpack.net/search?build=multimc&q=%1"
|
||||
).arg(currentSearchTerm);
|
||||
QString searchUrl = "";
|
||||
if (currentSearchTerm.isEmpty()) {
|
||||
searchUrl = QString(
|
||||
"https://api.technicpack.net/trending?build=multimc"
|
||||
).arg(currentSearchTerm);
|
||||
}
|
||||
else
|
||||
{
|
||||
searchUrl = QString(
|
||||
"https://api.technicpack.net/search?build=multimc&q=%1"
|
||||
).arg(currentSearchTerm);
|
||||
}
|
||||
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
|
||||
jobPtr = netJob;
|
||||
jobPtr->start();
|
||||
|
||||
Reference in New Issue
Block a user