diff --git a/cockatrice/src/tab_deck_storage.cpp b/cockatrice/src/tab_deck_storage.cpp index be0f39bd..0629df11 100644 --- a/cockatrice/src/tab_deck_storage.cpp +++ b/cockatrice/src/tab_deck_storage.cpp @@ -271,6 +271,10 @@ void TabDeckStorage::actNewFolder() if (folderName.isEmpty()) return; + // '/' isn't a valid filename character on *nix so we're choosing to replace it with a different arbitrary character. + std::string folder = folderName.toStdString(); + std::replace(folder.begin(), folder.end(), '/', '-'); + QString targetPath; RemoteDeckList_TreeModel::Node *curRight = serverDirView->getCurrentItem(); if (!curRight) @@ -282,8 +286,8 @@ void TabDeckStorage::actNewFolder() Command_DeckNewDir cmd; cmd.set_path(targetPath.toStdString()); - cmd.set_dir_name(folderName.toStdString()); - + cmd.set_dir_name(folder); + PendingCommand *pend = client->prepareSessionCommand(cmd); connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(newFolderFinished(Response, CommandContainer))); client->sendCommand(pend);