[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
@ -24,8 +24,8 @@
|
|||||||
#include "PackageModel.h"
|
#include "PackageModel.h"
|
||||||
|
|
||||||
#include "ui_page_netinst.h"
|
#include "ui_page_netinst.h"
|
||||||
#include "GlobalStorage.h"
|
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Retranslator.h"
|
#include "utils/Retranslator.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
@ -128,12 +128,8 @@ NetInstallPage::selectedPackages() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NetInstallPage::loadGroupList()
|
NetInstallPage::loadGroupList( const QString& confUrl )
|
||||||
{
|
{
|
||||||
QString confUrl(
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->value(
|
|
||||||
"groupsUrl" ).toString() );
|
|
||||||
|
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
request.setUrl( QUrl( confUrl ) );
|
request.setUrl( QUrl( confUrl ) );
|
||||||
// Follows all redirects except unsafe ones (https to http).
|
// Follows all redirects except unsafe ones (https to http).
|
||||||
|
@ -25,13 +25,14 @@
|
|||||||
#include "PackageTreeItem.h"
|
#include "PackageTreeItem.h"
|
||||||
#include "Typedefs.h"
|
#include "Typedefs.h"
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
// required forward declarations
|
// required forward declarations
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
|
class QString;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
@ -46,10 +47,12 @@ public:
|
|||||||
|
|
||||||
void onActivate();
|
void onActivate();
|
||||||
|
|
||||||
// Retrieves the groups, with name, description and packages, from
|
/** @brief Retrieves the groups, with name, description and packages
|
||||||
// the remote URL configured in the settings. Assumes the URL is already
|
*
|
||||||
// in the global storage. This should be called before displaying the page.
|
* Loads data from the given URL. This should be called before
|
||||||
void loadGroupList();
|
* displaying the page.
|
||||||
|
*/
|
||||||
|
void loadGroupList( const QString& url );
|
||||||
|
|
||||||
// Sets the "required" state of netinstall data. Influences whether
|
// Sets the "required" state of netinstall data. Influences whether
|
||||||
// corrupt or unavailable data causes checkReady() to be emitted
|
// corrupt or unavailable data causes checkReady() to be emitted
|
||||||
|
@ -186,8 +186,10 @@ NetInstallViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" );
|
QString groupsUrl = CalamaresUtils::getString( configurationMap, "groupsUrl" );
|
||||||
if ( !groupsUrl.isEmpty() )
|
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 );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "groupsUrl", groupsUrl );
|
||||||
m_widget->loadGroupList();
|
m_widget->loadGroupList( groupsUrl );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user