Merge pull request #1221 from Fizztastic/fix_818
Load .cod files from clipboard in deck editor
This commit is contained in:
commit
2b484aa9ee
1 changed files with 14 additions and 1 deletions
|
@ -48,7 +48,20 @@ void DlgLoadDeckFromClipboard::actOK()
|
|||
QTextStream stream(&buffer);
|
||||
|
||||
DeckLoader *l = new DeckLoader;
|
||||
if (l->loadFromStream_Plain(stream)) {
|
||||
if (buffer.contains("<cockatrice_deck version=\"1\">"))
|
||||
{
|
||||
if (l->loadFromString_Native(buffer))
|
||||
{
|
||||
deckList = l;
|
||||
accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Invalid deck list."));
|
||||
delete l;
|
||||
}
|
||||
}
|
||||
else if (l->loadFromStream_Plain(stream)) {
|
||||
deckList = l;
|
||||
accept();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue