mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
include the extension in upload confirmation
This commit is contained in:
parent
229015a5da
commit
f238c1b167
3 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue