refactor code below , if(type == OPTIONPSPRT){ if(printerJ.contains("scpVerboseMode")){…
Private research annotation
Sign in to add a private research label or note.
- User
refactor code below , if(type == OPTION_PSPRT){ if(printerJ.contains("scpVerboseMode")){ if(printerJ.value("scpVerboseMode").toBool()){ args.append("--verbose"); } } }else if(type == OPTION_PRSCU){ if(printerJ.contains("scuVerboseMode")){ if(printerJ.value("scuVerboseMode").toBool()){ args.append("--verbose"); } } }
- Assistant
//Refactored code if(printerJ.contains(type == OPTION_PSPRT ? "scpVerboseMode" : "scuVerboseMode")){ if(printerJ.value(type == OPTION_PSPRT ? "scpVerboseMode" : "scuVerboseMode").toBool()){ args.append("--verbose"); } }
- User
refactor code below , QJsonObject printerJ = jobJ; if(jobJ.contains("printerJson")){ printerJ = jobJ.value("printerJson").toObject(); }else{ printerJ = getPrinterJ(); }
- Assistant
//Refactored code QJsonObject printerJ = jobJ.contains("printerJson") ? jobJ.value("printerJson").toObject() : getPrinterJ();