[shellprocess] Make CommandList chroot-aware

This is prep-work for moving commandlist to libcalamares, where
it can be re-used by more modules.
This commit is contained in:
Adriaan de Groot 2018-01-15 04:57:41 -05:00
parent 8bd40fdcd5
commit e48767eaa6
2 changed files with 11 additions and 5 deletions

View File

@ -37,12 +37,13 @@ static QStringList get_variant_stringlist(const QVariantList& l)
return retl; return retl;
} }
CommandList::CommandList() CommandList::CommandList( bool doChroot )
: m_doChroot( doChroot )
{ {
} }
CommandList::CommandList::CommandList(const QVariant& v) CommandList::CommandList::CommandList( const QVariant& v, bool doChroot )
: CommandList() : CommandList( doChroot )
{ {
if ( v.type() == QVariant::List ) if ( v.type() == QVariant::List )
{ {

View File

@ -25,15 +25,20 @@
class CommandList : protected QStringList class CommandList : protected QStringList
{ {
public: public:
CommandList(); CommandList( bool doChroot = true );
CommandList(const QVariant& v); CommandList( const QVariant& v, bool doChroot = true );
~CommandList(); ~CommandList();
bool doChroot() const { return m_doChroot; }
using QStringList::isEmpty; using QStringList::isEmpty;
using QStringList::count; using QStringList::count;
using QStringList::cbegin; using QStringList::cbegin;
using QStringList::cend; using QStringList::cend;
using QStringList::const_iterator; using QStringList::const_iterator;
private:
bool m_doChroot;
} ; } ;
#endif // COMMANDLIST_H #endif // COMMANDLIST_H