From f727b74739e5393cfbf9226eb88fd97442ef62b9 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Thu, 5 May 2011 17:42:33 +0200 Subject: [PATCH] uploaded decks use filename by default --- cockatrice/src/tab_deck_storage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/tab_deck_storage.cpp b/cockatrice/src/tab_deck_storage.cpp index c4940ed8..fc427266 100644 --- a/cockatrice/src/tab_deck_storage.cpp +++ b/cockatrice/src/tab_deck_storage.cpp @@ -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())