fix folder names (#2432)

This commit is contained in:
Zach H 2017-03-04 00:49:09 -05:00 committed by GitHub
parent ab19a89cd2
commit 18b8a0ef5c

View file

@ -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);