include the extension in upload confirmation

This commit is contained in:
Stephen Birarda 2015-08-27 14:29:42 -07:00
parent 229015a5da
commit f238c1b167
3 changed files with 5 additions and 3 deletions

View file

@ -78,7 +78,7 @@ void AssetUploadDialogFactory::handleUploadFinished(AssetUpload* upload, const Q
// setup the line edit to hold the copiable text
QLineEdit* lineEdit = new QLineEdit;
QString atpURL = QString("%1://%2").arg(ATP_SCHEME).arg(hash);
QString atpURL = QString("%1://%2.%3").arg(ATP_SCHEME).arg(hash).arg(upload->getExtension);
// set the ATP URL as the text value so it's copiable
lineEdit->insert(atpURL);

View file

@ -34,14 +34,14 @@ void AssetUpload::start() {
if (file.open(QIODevice::ReadOnly)) {
// file opened, read the data and grab the extension
auto extension = QFileInfo(_filename).suffix();
_extension = QFileInfo(_filename).suffix();
auto data = file.readAll();
// ask the AssetClient to upload the asset and emit the proper signals from the passed callback
auto assetClient = DependencyManager::get<AssetClient>();
assetClient->uploadAsset(data, extension, [this](bool success, QString hash){
assetClient->uploadAsset(data, _extension, [this](bool success, QString hash){
if (success) {
// successful upload - emit finished with a point to ourselves and the resulting hash
_result = Success;

View file

@ -36,6 +36,7 @@ public:
Q_INVOKABLE void start();
const QString& getFilename() const { return _filename; }
const QString& getExtension() const { return _extension; }
const Result& getResult() const { return _result; }
signals:
@ -44,6 +45,7 @@ signals:
private:
QString _filename;
QString _extension;
Result _result;
};