Skip to content

Commit

Permalink
[ssuks] Make use of Sandbox::addWorldFiles()
Browse files Browse the repository at this point in the history
  • Loading branch information
martyone committed May 24, 2013
1 parent cf5fdde commit 7ad0e01
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions ssuks/ssuks.cpp
Expand Up @@ -49,38 +49,23 @@ void SsuKs::run(){
sandbox = repoParameters.value("sandbox");
repoParameters.remove("sandbox");

sb = new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);

// copy files into sandbox
QDirIterator it(SSU_DATA_DIR, QDir::AllEntries|QDir::NoDot|QDir::NoDotDot, QDirIterator::Subdirectories);
while (it.hasNext()){
it.next();

if (it.fileName() == "board-mappings.ini")
continue;

QDir dir;
QFileInfo info = it.fileInfo();

dir.mkpath(sandbox + info.absoluteDir().path());
QFile::copy(it.filePath(), sandbox + it.filePath());
if (!sb->addWorldFiles(SSU_DATA_DIR)){
qout << "Failed to copy files into sandbox" << endl;
return;
}

QFile::remove(sandbox + "/" + SSU_BOARD_MAPPING_CONFIGURATION);
SsuSettings boardMappings(QString("%1/%2")
.arg(sandbox)
.arg(SSU_BOARD_MAPPING_CONFIGURATION),
QString("%1/%2")
.arg(sandbox)
.arg(SSU_BOARD_MAPPING_CONFIGURATION_DIR));

sb = new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);

if (sb->activate())
qout << "Using sandbox at " << sandbox << endl;
else {
qout << "Failed to activate sandbox" << endl;
return;
}

// force re-merge of settings
QFile::remove(Sandbox::map(SSU_BOARD_MAPPING_CONFIGURATION));
SsuSettings(SSU_BOARD_MAPPING_CONFIGURATION, SSU_BOARD_MAPPING_CONFIGURATION_DIR);
}

SsuKickstarter kickstarter;
Expand Down

0 comments on commit 7ad0e01

Please sign in to comment.