void TabDeckStorage::actNewFolder() { QString folderName = QInputDialog::getText(this, tr("New folder"), tr("Name of new folder:")); if (folderName.isEmpty()) return; QString targetPath; RemoteDeckList_TreeModel::Node *curRight = serverDirView->getCurrentItem(); if (!curRight) return; if (!dynamic_cast<RemoteDeckList_TreeModel::DirectoryNode *>(curRight)) curRight = curRight->getParent(); RemoteDeckList_TreeModel::DirectoryNode *dir = dynamic_cast<RemoteDeckList_TreeModel::DirectoryNode *>(curRight); targetPath = dir->getPath(); Command_DeckNewDir cmd; cmd.set_path(targetPath.toStdString()); cmd.set_dir_name(folderName.toStdString()); PendingCommand *pend = client->prepareSessionCommand(cmd); connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(newFolderFinished(Response, CommandContainer))); client->sendCommand(pend); }
void OnlineDataManager::newFolderFinished() { OnlineDataNode *dataNode = qobject_cast<OnlineDataNode *>(sender()); emit newFolderFinished(dataNode->id()); }