Browse Source

Remove .c_str() calls for string::f() arguments.

tags/v2.6.1
Andrew Belt 5 months ago
parent
commit
aaa5c04b9d
5 changed files with 20 additions and 20 deletions
  1. +6
    -6
      src/Quantity.cpp
  2. +9
    -9
      src/app/MenuBar.cpp
  3. +3
    -3
      src/app/ModuleWidget.cpp
  4. +1
    -1
      src/app/RackWidget.cpp
  5. +1
    -1
      src/plugin.cpp

+ 6
- 6
src/Quantity.cpp View File

@@ -60,14 +60,14 @@ static void teVarsInit() {
}; };
for (const Note& note : notes) { for (const Note& note : notes) {
// Example: c, cs (or c#), and cb // Example: c, cs (or c#), and cb
teVariables.push_back({string::f("%s", note.name.c_str()), 440.f * std::pow(2.0, (note.semi - 9) / 12.f)});
teVariables.push_back({string::f("%ss", note.name.c_str()), 440.f * std::pow(2.0, (note.semi - 9 + 1) / 12.f)});
teVariables.push_back({string::f("%sb", note.name.c_str()), 440.f * std::pow(2.0, (note.semi - 9 - 1) / 12.f)});
teVariables.push_back({string::f("%s", note.name), 440.f * std::pow(2.0, (note.semi - 9) / 12.f)});
teVariables.push_back({string::f("%ss", note.name), 440.f * std::pow(2.0, (note.semi - 9 + 1) / 12.f)});
teVariables.push_back({string::f("%sb", note.name), 440.f * std::pow(2.0, (note.semi - 9 - 1) / 12.f)});
for (int oct = 0; oct <= 9; oct++) { for (int oct = 0; oct <= 9; oct++) {
// Example: c4, cs4 (or c#4), and cb4 // Example: c4, cs4 (or c#4), and cb4
teVariables.push_back({string::f("%s%d", note.name.c_str(), oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9) / 12.f)});
teVariables.push_back({string::f("%ss%d", note.name.c_str(), oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9 + 1) / 12.f)});
teVariables.push_back({string::f("%sb%d", note.name.c_str(), oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9 - 1) / 12.f)});
teVariables.push_back({string::f("%s%d", note.name, oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9) / 12.f)});
teVariables.push_back({string::f("%ss%d", note.name, oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9 + 1) / 12.f)});
teVariables.push_back({string::f("%sb%d", note.name, oct), 440.f * std::pow(2.0, oct - 4 + (note.semi - 9 - 1) / 12.f)});
} }
} }




+ 9
- 9
src/app/MenuBar.cpp View File

@@ -139,7 +139,7 @@ struct EditButton : MenuButton {


struct UndoItem : ui::MenuItem { struct UndoItem : ui::MenuItem {
void step() override { void step() override {
text = string::f(string::translate("MenuBar.edit.undo").c_str(), APP->history->getUndoName().c_str());
text = string::f(string::translate("MenuBar.edit.undo"), APP->history->getUndoName());
disabled = !APP->history->canUndo(); disabled = !APP->history->canUndo();
MenuItem::step(); MenuItem::step();
} }
@@ -151,7 +151,7 @@ struct EditButton : MenuButton {


struct RedoItem : ui::MenuItem { struct RedoItem : ui::MenuItem {
void step() override { void step() override {
text = string::f(string::translate("MenuBar.edit.redo").c_str(), APP->history->getRedoName().c_str());
text = string::f(string::translate("MenuBar.edit.redo"), APP->history->getRedoName());
disabled = !APP->history->canRedo(); disabled = !APP->history->canRedo();
MenuItem::step(); MenuItem::step();
} }
@@ -428,9 +428,9 @@ struct ViewButton : MenuButton {
APP->scene->rackScroll->zoomToModules(); APP->scene->rackScroll->zoomToModules();
})); }));


menu->addChild(createIndexPtrSubmenuItem(string::translate("MenuBar.view.mousewheelzoom"), {
string::f(string::translate("MenuBar.view.mouseWheelZoom.scroll").c_str(), RACK_MOD_CTRL_NAME),
string::f(string::translate("MenuBar.view.mouseWheelZoom.zoom").c_str(), RACK_MOD_CTRL_NAME)
menu->addChild(createIndexPtrSubmenuItem(string::translate("MenuBar.view.mouseWheelZoom"), {
string::f(string::translate("MenuBar.view.mouseWheelZoom.scroll"), RACK_MOD_CTRL_NAME),
string::f(string::translate("MenuBar.view.mouseWheelZoom.zoom"), RACK_MOD_CTRL_NAME)
}, &settings::mouseWheelZoom)); }, &settings::mouseWheelZoom));


menu->addChild(new ui::MenuSeparator); menu->addChild(new ui::MenuSeparator);
@@ -788,7 +788,7 @@ struct SyncUpdateItem : ui::MenuItem {
ui::Menu* menu = new ui::Menu; ui::Menu* menu = new ui::Menu;


if (update.minRackVersion != "") { if (update.minRackVersion != "") {
menu->addChild(createMenuLabel(string::f(string::translate("MenuBar.library.requiresRack").c_str(), update.minRackVersion.c_str())));
menu->addChild(createMenuLabel(string::f(string::translate("MenuBar.library.requiresRack"), update.minRackVersion)));
} }


if (update.changelogUrl != "") { if (update.changelogUrl != "") {
@@ -997,7 +997,7 @@ struct HelpButton : MenuButton {
}, [=](size_t i) { }, [=](size_t i) {
settings::language = get(languages, i, "en"); settings::language = get(languages, i, "en");
// Request restart // Request restart
std::string msg = string::f(string::translate("MenuBar.help.language.restart").c_str(), string::translate("language").c_str());
std::string msg = string::f(string::translate("MenuBar.help.language.restart"), string::translate("language"));
if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, msg.c_str())) { if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, msg.c_str())) {
APP->window->close(); APP->window->close();
} }
@@ -1030,12 +1030,12 @@ struct HelpButton : MenuButton {
})); }));


if (library::isAppUpdateAvailable()) { if (library::isAppUpdateAvailable()) {
menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.update").c_str(), APP_NAME.c_str()), APP_VERSION + " → " + library::appVersion, [=]() {
menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.update"), APP_NAME), APP_VERSION + " → " + library::appVersion, [=]() {
system::openBrowser(library::appDownloadUrl); system::openBrowser(library::appDownloadUrl);
})); }));
} }
else if (!settings::autoCheckUpdates && !settings::devMode) { else if (!settings::autoCheckUpdates && !settings::devMode) {
menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.checkUpdate").c_str(), APP_NAME.c_str()), "", [=]() {
menu->addChild(createMenuItem(string::f(string::translate("MenuBar.help.checkUpdate"), APP_NAME), "", [=]() {
std::thread t([&]() { std::thread t([&]() {
library::checkAppUpdate(); library::checkAppUpdate();
}); });


+ 3
- 3
src/app/ModuleWidget.cpp View File

@@ -673,7 +673,7 @@ void ModuleWidget::save(std::string filename) {


FILE* file = std::fopen(filename.c_str(), "w"); FILE* file = std::fopen(filename.c_str(), "w");
if (!file) { if (!file) {
std::string message = string::f("Could not save preset to file %s", filename.c_str());
std::string message = string::f("Could not save preset to file %s", filename);
osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str()); osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str());
return; return;
} }
@@ -691,7 +691,7 @@ void ModuleWidget::saveTemplate() {


void ModuleWidget::saveTemplateDialog() { void ModuleWidget::saveTemplateDialog() {
if (hasTemplate()) { if (hasTemplate()) {
std::string message = string::f("Overwrite default preset for %s?", model->getFullName().c_str());
std::string message = string::f("Overwrite default preset for %s?", model->getFullName());
if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str()))
return; return;
} }
@@ -711,7 +711,7 @@ void ModuleWidget::clearTemplate() {
} }


void ModuleWidget::clearTemplateDialog() { void ModuleWidget::clearTemplateDialog() {
std::string message = string::f("Delete default preset for %s?", model->getFullName().c_str());
std::string message = string::f("Delete default preset for %s?", model->getFullName());
if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str())) if (!osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, message.c_str()))
return; return;
clearTemplate(); clearTemplate();


+ 1
- 1
src/app/RackWidget.cpp View File

@@ -1126,7 +1126,7 @@ void RackWidget::saveSelection(std::string path) {


FILE* file = std::fopen(path.c_str(), "w"); FILE* file = std::fopen(path.c_str(), "w");
if (!file) { if (!file) {
std::string message = string::f("Could not save selection to file %s", path.c_str());
std::string message = string::f("Could not save selection to file %s", path);
osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str()); osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK, message.c_str());
return; return;
} }


+ 1
- 1
src/plugin.cpp View File

@@ -234,7 +234,7 @@ static void extractPackages(std::string path) {
} }
catch (Exception& e) { catch (Exception& e) {
WARN("Plugin package %s failed to extract: %s", packagePath.c_str(), e.what()); WARN("Plugin package %s failed to extract: %s", packagePath.c_str(), e.what());
message += string::f("Could not extract plugin package %s\n", packagePath.c_str());
message += string::f("Could not extract plugin package %s\n", packagePath);
continue; continue;
} }
// Remove package // Remove package


Loading…
Cancel
Save