コード例 #1
0
void WebDavInventoryDataModel::DownloadFile(const QString &store_folder, AbstractInventoryItem *selected_item)
{
    InventoryAsset *item = dynamic_cast<InventoryAsset *>(selected_item);
    if (!item)
        return;

    QString storePath = store_folder;
    QString parentPath = ValidateFolderPath(item->GetParent()->GetID());
    QString filename = item->GetName();
    //emit DownloadStarted(id);
    QStringList result = webdavclient_.call("downloadFile", QVariantList() << storePath << parentPath << filename).toStringList();
    if (result.count() >= 1)
    {
        if (result[0] == "True")
        {
            InventoryModule::LogInfo(QString("Webdav | Downloaded file %1%2 to path %3\n").arg(parentPath, filename, storePath).toStdString());
            //emit DownloadCompleted(id);
        }
        else
            InventoryModule::LogInfo(QString("Webdav | Downloaded of file %1%2 to path %3 failed\n").arg(parentPath, filename, storePath).toStdString());
    }
}
コード例 #2
0
ファイル: InventoryModule.cpp プロジェクト: Manaluusua/naali
void InventoryModule::CloseItemPropertiesWindow(const QString &inventory_id, bool save_changes)
{
    // Note: We only remove the pointer from the map here. The window deletes itself.
    ItemPropertiesWindow *wnd = itemPropertiesWindows_.take(inventory_id);
    if (!wnd)
        return;

    boost::shared_ptr<UiServices::UiModule> ui_module =
        GetFramework()->GetModuleManager()->GetModule<UiServices::UiModule>(Foundation::Module::MT_UiServices).lock();
    if (ui_module)
        ui_module->GetInworldSceneController()->RemoveProxyWidgetFromScene(wnd);

    // If inventory item is modified notify server.
    if (save_changes)
    {
        InventoryAsset *asset = dynamic_cast<InventoryAsset *>(inventory_->GetChildById(inventory_id));
        if (asset)
            ///\todo WebDAV needs the old name and we don't have it here.
            inventory_->NotifyServerAboutItemUpdate(asset, asset->GetName());
    }

    wnd->deleteLater();
}