/* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2020 Adriaan de Groot * SPDX-License-Identifier: GPL-3.0-or-later * License-Filename: LICENSE * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Calamares is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Calamares. If not, see . */ #include "Config.h" #include "GlobalStorage.h" #include "JobQueue.h" #include "utils/Logger.h" #include "utils/Variant.h" Config::Config( QObject* parent ) : QObject( parent ) { } Config::~Config() {} void Config::setUserShell( const QString& shell ) { if ( !shell.isEmpty() && !shell.startsWith( '/' ) ) { cWarning() << "User shell" << shell << "is not an absolute path."; return; } // The shell is put into GS because the CreateUser job expects it there Calamares::JobQueue::instance()->globalStorage()->insert( "userShell", shell ); } void Config::setConfigurationMap( const QVariantMap& configurationMap ) { QString shell( QLatin1String( "/bin/bash" ) ); // as if it's not set at all if ( configurationMap.contains( "userShell" ) ) { shell = CalamaresUtils::getString( configurationMap, "userShell" ); } // Now it might be explicitly set to empty, which is ok setUserShell( shell ); }