Skip to content

Commit

Permalink
Fixing Recalbox
Browse files Browse the repository at this point in the history
  • Loading branch information
procount committed Feb 22, 2022
1 parent c488f66 commit 72800cf
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion recovery/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CONFIG_H

/* Version number displayed in the title bar */
#define VERSION_NUMBER "3.8"
#define VERSION_NUMBER "3.8.1"

/* Color of the background */
// #define BACKGROUND_COLOR Qt::white
Expand Down
28 changes: 23 additions & 5 deletions recovery/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,8 @@ QMap<QString, QVariantMap> MainWindow::listImages(const QString &folder)
continue;
QVariantMap osv = Json::loadFromFile(imagefolder+"/os.json").toMap();

OverrideJson(osv); //Allow overriding of supported_models by putting this here.

if (folder == "/mnt/os")
osv["source"] = SOURCE_SDCARD;
else
Expand Down Expand Up @@ -1334,20 +1336,34 @@ void MainWindow::on_actionDownload_triggered()
f.remove();
}

//Is this the same as fi.path()?
QString urlpath = entry.value("os_info").toString().left(entry.value("os_info").toString().lastIndexOf('/'));

//Required fields
downloadMetaFile(entry.value("os_info").toString(), folder+"/os.json");
downloadMetaFile(entry.value("partitions_info").toString(), folder+"/partitions.json");

//Try and download flavours, but not an error if they don't exist
downloadMetaFile( fi.path() +"/flavours.json", "-"+folder+"/flavours.json");
downloadMetaFile( fi.path() +"/flavours.tar.xz", "-"+folder+"/flavours.tar.xz");

downloadMetaFile(entry.value("os_info").toString(), folder+"/os.json");
downloadMetaFile(entry.value("partitions_info").toString(), folder+"/partitions.json");
QString urlpath = entry.value("os_info").toString().left(entry.value("os_info").toString().lastIndexOf('/'));
downloadMetaFile(urlpath+"/release_notes.txt", "-" + folder+"/release_notes.txt"); //'-' indicates optional
downloadMetaFile(urlpath+"/terms", "-" + folder+"/terms"); //'-' indicates optional
if (entry.contains("marketing_info"))
{
downloadMetaFile(entry.value("marketing_info").toString(), folder+"/marketing.tar");
}
else {
downloadMetaFile(urlpath+"/marketing.tar", "-" + folder+"/marketing.tar"); //'-' indicates optional
}

if (entry.contains("partition_setup"))
{
downloadMetaFile(entry.value("partition_setup").toString(), folder+"/partition_setup.sh");
}
else {
downloadMetaFile(urlpath+"/partition_setup.sh", "-" + folder+"/partition_setup.sh"); //'-' indicates optional
}

if (entry.contains("icon"))
{
Expand Down Expand Up @@ -2382,6 +2398,8 @@ void MainWindow::processJson(QVariant json)
{
QVariantMap os = osv.toMap();

OverrideJson(os);

QString basename = os.value("os_name").toString();
if (canInstallOs(basename, os))
{
Expand Down Expand Up @@ -4829,7 +4847,7 @@ void MainWindow::on_actionBackup_triggered()
unsupportedOses += "\n" + name;
item->setCheckState(Qt::Unchecked); //Deselect the unsupported OSes
}
if (entry.value("supports_backup","false").toString()=="update")
if (entry.value("supports_backup",false).toString()=="update")
{
QString name = CORE(entry.value("name").toString());
QListWidgetItem *witem = findItemByName(name);
Expand All @@ -4842,7 +4860,7 @@ void MainWindow::on_actionBackup_triggered()
}
}

if (entry.value("supports_backup","false").toBool()==false)
if (entry.value("supports_backup",false).toBool()==false)
{
allSupported = false;
unsupportedOses += "\n" + name;
Expand Down
9 changes: 7 additions & 2 deletions recovery/multiimagedownloadthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ bool MultiImageDownloadThread::processImage(const QString &folder, const QString
QVariantList partitions = Json::loadFromFile(folder+"/partitions.json").toMap().value("partitions").toList();
foreach (QVariant pv, partitions)
{
QString tarball;
QVariantMap partition = pv.toMap();
QString tarball = partition.value("download").toString();

tarball = partition.value("tarball").toString();
if (tarball.isEmpty())
tarball = partition.value("download").toString();

bool emptyfs = partition.value("empty_fs", false).toBool();
QString csumType = getCsumType(partition);
QString csum = getCsum(partition,csumType);
Expand All @@ -87,7 +92,7 @@ bool MultiImageDownloadThread::processImage(const QString &folder, const QString
/* If no tarball URL is specified, What are we doing here? */

emit error(tr("File '%1' does not need downloading").arg(tarball));
return (false);
continue; //return true;
}

// Get the full pathname of the destination file
Expand Down
3 changes: 3 additions & 0 deletions recovery/multiimagedownloadthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class MultiImageDownloadThread : public QThread
void consolidate();
void newDrive(const QString& drive, eProgressMode mode);
void imageWritten(QString Imagefile);
void finish();
void idle();
void cont();

public slots:

Expand Down

0 comments on commit 72800cf

Please sign in to comment.