diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/mod_uploader | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/mod_uploader')
-rw-r--r-- | source/mod_uploader/StarModUploader.cpp | 12 | ||||
-rw-r--r-- | source/mod_uploader/main.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/mod_uploader/StarModUploader.cpp b/source/mod_uploader/StarModUploader.cpp index c8c86e6..a2d0d20 100644 --- a/source/mod_uploader/StarModUploader.cpp +++ b/source/mod_uploader/StarModUploader.cpp @@ -183,7 +183,7 @@ void ModUploader::loadDirectory() { } String modId = metadata.value("steamContentId", "").toString(); - m_modIdLabel->setText(toQString(strf("<a href=\"steam://url/CommunityFilePage/%s\">%s</a>", modId, modId))); + m_modIdLabel->setText(toQString(strf("<a href=\"steam://url/CommunityFilePage/{}\">{}</a>", modId, modId))); String previewFile = File::relativeTo(*m_modDirectory, "_previewimage"); if (File::isFile(previewFile)) { @@ -303,23 +303,23 @@ void ModUploader::uploadToSteam() { } if (m_steamItemCreateResult->first.m_eResult != k_EResultOK) { - QMessageBox::critical(this, "Error", strf("Error creating new Steam UGC Item (%s)", m_steamItemCreateResult->first.m_eResult).c_str()); + QMessageBox::critical(this, "Error", strf("Error creating new Steam UGC Item ({})", m_steamItemCreateResult->first.m_eResult).c_str()); return; } modIdString = toString(m_steamItemCreateResult->first.m_nPublishedFileId); - String modUrl = strf("steam://url/CommunityFilePage/%s", modIdString); + String modUrl = strf("steam://url/CommunityFilePage/{}", modIdString); metadata.set("steamContentId", modIdString); metadata.set("link", modUrl); m_assetSource->setMetadata(metadata); - m_modIdLabel->setText(toQString(strf("<a href=\"%s\">%s</a>", modUrl, modIdString))); + m_modIdLabel->setText(toQString(strf("<a href=\"{}\">{}</a>", modUrl, modIdString))); } String steamUploadDir = File::temporaryDirectory(); auto progressCallback = [&progress](size_t i, size_t total, String, String assetPath) { - progress.setLabelText(toQString(strf("Packing '%s'", assetPath))); + progress.setLabelText(toQString(strf("Packing '{}'", assetPath))); progress.setMaximum(total); progress.setValue(i); QApplication::processEvents(); @@ -378,7 +378,7 @@ void ModUploader::uploadToSteam() { } if (m_steamItemSubmitResult->first.m_eResult != k_EResultOK) { - QMessageBox::critical(this, "Error", strf("Error submitting changes to the Steam UGC item (%s)", m_steamItemSubmitResult->first.m_eResult).c_str()); + QMessageBox::critical(this, "Error", strf("Error submitting changes to the Steam UGC item ({})", m_steamItemSubmitResult->first.m_eResult).c_str()); return; } } diff --git a/source/mod_uploader/main.cpp b/source/mod_uploader/main.cpp index 978039a..ce75698 100644 --- a/source/mod_uploader/main.cpp +++ b/source/mod_uploader/main.cpp @@ -22,8 +22,8 @@ int main(int argc, char** argv) { try { return app.exec(); } catch (std::exception const& e) { - QMessageBox::critical(nullptr, "Error", toQString(strf("Exception caught: %s\n", outputException(e, true)))); - coutf("Exception caught: %s\n", outputException(e, true)); + QMessageBox::critical(nullptr, "Error", toQString(strf("Exception caught: {}\n", outputException(e, true)))); + coutf("Exception caught: {}\n", outputException(e, true)); return 1; } } |