uploaded decks use filename by default
This commit is contained in:
parent
45c65c59dc
commit
f727b74739
1 changed files with 3 additions and 1 deletions
|
@ -134,12 +134,14 @@ void TabDeckStorage::actUpload()
|
|||
if (localDirModel->isDir(curLeft))
|
||||
return;
|
||||
QString filePath = localDirModel->filePath(curLeft);
|
||||
QFile deckFile(filePath);
|
||||
QFileInfo deckFileInfo(deckFile);
|
||||
DeckList *deck = new DeckList;
|
||||
if (!deck->loadFromFile(filePath, DeckList::CockatriceFormat))
|
||||
return;
|
||||
if (deck->getName().isEmpty()) {
|
||||
bool ok;
|
||||
QString deckName = QInputDialog::getText(this, tr("Enter deck name"), tr("This decklist does not have a name.\nPlease enter a name:"), QLineEdit::Normal, tr("Unnamed deck"), &ok);
|
||||
QString deckName = QInputDialog::getText(this, tr("Enter deck name"), tr("This decklist does not have a name.\nPlease enter a name:"), QLineEdit::Normal, deckFileInfo.completeBaseName(), &ok);
|
||||
if (!ok)
|
||||
return;
|
||||
if (deckName.isEmpty())
|
||||
|
|
Loading…
Reference in a new issue