mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 02:45:44 -05:00
[netinstall] Remove data-indirection
- There is no need to move data around between two parts of the same module via global storage.
This commit is contained in:
parent
3160bd7a54
commit
ba85fc760a
3 changed files with 13 additions and 12 deletions
|
@ -24,8 +24,8 @@
|
|||
#include "PackageModel.h"
|
||||
|
||||
#include "ui_page_netinst.h"
|
||||
#include "GlobalStorage.h"
|
||||
#include "JobQueue.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Retranslator.h"
|
||||
#include "utils/YamlUtils.h"
|
||||
|
@ -128,12 +128,8 @@ NetInstallPage::selectedPackages() const
|
|||
}
|
||||
|
||||
void
|
||||
NetInstallPage::loadGroupList()
|
||||
NetInstallPage::loadGroupList( const QString& confUrl )
|
||||
{
|
||||
QString confUrl(
|
||||
Calamares::JobQueue::instance()->globalStorage()->value(
|
||||
"groupsUrl" ).toString() );
|
||||
|
||||
QNetworkRequest request;
|
||||
request.setUrl( QUrl( confUrl ) );
|
||||
// Follows all redirects except unsafe ones (https to http).
|
||||
|
|
|
@ -25,13 +25,14 @@
|
|||
#include "PackageTreeItem.h"
|
||||
#include "Typedefs.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QAbstractButton>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QWidget>
|
||||
|
||||
// required forward declarations
|
||||
class QByteArray;
|
||||
class QNetworkReply;
|
||||
class QString;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
@ -46,10 +47,12 @@ public:
|
|||
|
||||
void onActivate();
|
||||
|
||||
// Retrieves the groups, with name, description and packages, from
|
||||
// the remote URL configured in the settings. Assumes the URL is already
|
||||
// in the global storage. This should be called before displaying the page.
|
||||
void loadGroupList();
|
||||
/** @brief Retrieves the groups, with name, description and packages
|
||||
*
|
||||
* Loads data from the given URL. This should be called before
|
||||
* displaying the page.
|
||||
*/
|
||||
void loadGroupList( const QString& url );
|
||||
|
||||
// Sets the "required" state of netinstall data. Influences whether
|
||||
// corrupt or unavailable data causes checkReady() to be emitted
|
||||
|
|
|
@ -186,8 +186,10 @@ NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" );
|
||||
if ( !groupsUrl.isEmpty() )
|
||||
{
|
||||
// Keep putting groupsUrl into the global storage,
|
||||
// even though it's no longer used for in-module data-passing.
|
||||
Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl );
|
||||
m_widget->loadGroupList();
|
||||
m_widget->loadGroupList( groupsUrl );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue