Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Feb 3, 2020
1 parent 6309d4a commit 18c008e
Show file tree
Hide file tree
Showing 52 changed files with 136 additions and 139 deletions.
4 changes: 2 additions & 2 deletions src/checkforupdatesdialog.cpp
Expand Up @@ -267,7 +267,7 @@ void CheckForUpdatesDialog::updateGui()
// OpenCOR, so first look for a snapshot and go for an official
// version, if no snapshot is available

QString version = QString();
QString version;

for (const auto &newerVersion : mEngine->newerVersions()) {
if (newerVersion.contains('-')) {
Expand Down Expand Up @@ -296,7 +296,7 @@ void CheckForUpdatesDialog::updateGui()
// The user is only after an official version of OpenCOR, so look
// for the first one available

QString version = QString();
QString version;

for (const auto &newerVersion : mEngine->newerVersions()) {
if (!newerVersion.contains('-')) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Expand Up @@ -201,7 +201,7 @@ int main(int pArgC, char *pArgV[])

// Initialise the GUI version of OpenCOR

QString appDate = QString();
QString appDate;

OpenCOR::initApplication(&appDate);

Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Expand Up @@ -591,7 +591,7 @@ void MainWindow::initializeGuiPlugin(Plugin *pPlugin)

// Add some actions to our File|New menu and keep track of them

static QString pluginForFileNewMenu = QString();
static QString pluginForFileNewMenu = {};

for (const auto &guiMenuAction : guiMenuActions) {
if (guiMenuAction.type() == Gui::MenuAction::Type::FileNew) {
Expand Down
5 changes: 2 additions & 3 deletions src/mainwindow.h
Expand Up @@ -119,16 +119,15 @@ class MainWindow : public QMainWindow
void loadSettings();
void saveSettings() const;

void setLocale(const QString &pRawLocale = QString(),
bool pForceSetting = false);
void setLocale(const QString &pRawLocale = {}, bool pForceSetting = false);

void reorderViewWindowsMenu();

void updateViewWindowsMenu(QAction *pAction);

void restart(bool pSaveSettings) const;

void showPreferencesDialog(const QString &pPluginName = QString());
void showPreferencesDialog(const QString &pPluginName = {});

void showDockedWindows(bool pShow, bool pInitialisation);

Expand Down
2 changes: 1 addition & 1 deletion src/misc/cliutils.cpp
Expand Up @@ -123,7 +123,7 @@ void initPluginsPath(int pArgC, char *pArgV[]) // NOLINT(hicpp-avoid-c-arrays, m

appDir = canonicalDirName(appFileInfo.canonicalPath());

QString pluginsDir = QString();
QString pluginsDir;

#if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
pluginsDir = appDir+"/../plugins";
Expand Down
6 changes: 3 additions & 3 deletions src/misc/cliutils.cpp.inl
Expand Up @@ -60,7 +60,7 @@ void setRawLocale(const QString &pRawLocale)

QString shortVersion()
{
QString res = QString();
QString res;
QString appVersion = qApp->applicationVersion();

if (!appVersion.contains('-')) {
Expand Down Expand Up @@ -659,7 +659,7 @@ QString nonDiacriticString(const QString &pString)
static QString diacriticLetters = QString::fromUtf8("ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ");
static QStringList nonDiacriticLetters = QStringList() << "S" << "OE" << "Z" << "s" << "oe" << "z" << "Y" << "Y" << "u" << "A" << "A" << "A" << "A" << "A" << "A" << "AE" << "C" << "E" << "E" << "E" << "E" << "I" << "I" << "I" << "I" << "D" << "N" << "O" << "O" << "O" << "O" << "O" << "O" << "U" << "U" << "U" << "U" << "Y" << "s" << "a" << "a" << "a" << "a" << "a" << "a" << "ae" << "c" << "e" << "e" << "e" << "e" << "i" << "i" << "i" << "i" << "o" << "n" << "o" << "o" << "o" << "o" << "o" << "o" << "u" << "u" << "u" << "u" << "y" << "y";

QString res = QString();
QString res;

for (auto letter : pString) {
int index = diacriticLetters.indexOf(letter);
Expand All @@ -680,7 +680,7 @@ QString plainString(const QString &pString)
// stripping out can proceed without any problem...

QXmlStreamReader string("<html>"+pString+"</html>");
QString res = QString();
QString res;

while (!string.atEnd()) {
if (string.readNext() == QXmlStreamReader::Characters) {
Expand Down
2 changes: 1 addition & 1 deletion src/misc/furtherinitialize.cpp.inl
Expand Up @@ -63,7 +63,7 @@ QString Simulation::furtherInitialize() const
bool mustHaveNlaSolver = false;
#endif
bool hasNlaSolver = false;
QString nlaSolverName = QString();
QString nlaSolverName;

for (uint i = 0, iMax = annotation->getNumChildren(); i < iMax; ++i) {
libsbml::XMLNode &nlaSolverNode = annotation->getChild(i);
Expand Down
Expand Up @@ -68,7 +68,7 @@ void BiosignalmlDataStoreExporterWorker::run()
// Export our data store to a BioSignalML file

bsml::HDF5::Recording *recording = nullptr;
QString errorMessage = QString();
QString errorMessage;

try {
// Create and populate a recording
Expand Down
Expand Up @@ -47,7 +47,7 @@ void BiosignalmlDataStoreImporterWorker::run()
{
// Import our BioSignalML file in our data store

QString errorMessage = QString();
QString errorMessage;

try {
// Retrieve our clock and determine our number of data points
Expand Down
Expand Up @@ -55,7 +55,7 @@ void CsvDataStoreExporterWorker::run()
// first write our header and then our data, one row at a time...

QFile file(Core::temporaryFileName());
QString errorMessage = QString();
QString errorMessage;

if (file.open(QIODevice::WriteOnly)) {
// Determine whether we need to export the VOI and, if so, remove it
Expand Down Expand Up @@ -122,7 +122,7 @@ void CsvDataStoreExporterWorker::run()
static const QString RunNb = " | Run #%1";
static const QString CrLf = "\r\n";

QString header = QString();
QString header;

if (voi != nullptr) {
header += Header.arg(voi->uri().replace("/prime", "'").replace('/', " | "),
Expand Down Expand Up @@ -155,7 +155,7 @@ void CsvDataStoreExporterWorker::run()
emit progress(mDataStoreData, ++stepNb*oneOverNbOfSteps);

for (int i = 0, iMax = voiValues.count(); i < iMax; ++i) {
QString rowData = QString();
QString rowData;
double voiValue = voiValues[i];

if (voi != nullptr) {
Expand Down
Expand Up @@ -49,7 +49,7 @@ void CsvDataStoreImporterWorker::run()
// Note: we rely on our CSV file to be well-formed...

QFile file(mImportData->fileName());
QString errorMessage = QString();
QString errorMessage;

if (file.open(QIODevice::ReadOnly|QIODevice::Text)) {
QTextStream in(&file);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dataStore/DataStore/src/datastoredialog.cpp
Expand Up @@ -118,7 +118,7 @@ DataStoreDialog::DataStoreDialog(const QString &pDataStoreName,
mGui->treeView->setModel(mModel);
mGui->treeView->setItemDelegate(new DataItemDelegate(this));

QString dataHierarchy = QString();
QString dataHierarchy;
QStandardItem *hierarchyItem = nullptr;

for (auto variable : pIncludeVoi?pDataStore->voiAndVariables():pDataStore->variables()) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/datastoreinterface.h
Expand Up @@ -286,7 +286,7 @@ class DataStore : public QObject
Q_OBJECT

public:
explicit DataStore(const QString &pUri = QString());
explicit DataStore(const QString &pUri = {});
~DataStore() override;

bool addRun(quint64 pCapacity);
Expand Down
Expand Up @@ -550,7 +550,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::updateItemsGui(const CellmlA

// Add the items

QString ontologicalTerms = QString();
QString ontologicalTerms;

for (const auto &item : pItems) {
// Keep track of some information
Expand Down Expand Up @@ -857,7 +857,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::linkHovered()
// link
// Note: this follows the approach used in linkClicked()...

QString linkToolTip = QString();
QString linkToolTip;

if (!link.isEmpty()) {
if (textContent.isEmpty()) {
Expand Down Expand Up @@ -951,7 +951,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::termLookedUp(QNetworkReply *

// Retrieve the list of terms, should there be a network reply

QString errorMessage = QString();
QString errorMessage;
bool hasInternetConnection = true;

if (pNetworkReply != nullptr) {
Expand Down
Expand Up @@ -72,9 +72,9 @@ class CellmlAnnotationViewWidget;
class CellmlAnnotationViewMetadataEditDetailsItem
{
public:
explicit CellmlAnnotationViewMetadataEditDetailsItem(const QString &pName = QString(),
const QString &pResource = QString(),
const QString &pId = QString());
explicit CellmlAnnotationViewMetadataEditDetailsItem(const QString &pName = {},
const QString &pResource = {},
const QString &pId = {});

static bool compare(const CellmlAnnotationViewMetadataEditDetailsItem &pItem1,
const CellmlAnnotationViewMetadataEditDetailsItem &pItem2);
Expand Down Expand Up @@ -176,11 +176,10 @@ class CellmlAnnotationViewMetadataEditDetailsWidget : public Core::Widget
void updateOutputHeaders();

void updateItemsGui(const CellmlAnnotationViewMetadataEditDetailsItems &pItems,
bool pLookUpTerm,
const QString &pErrorMessage = QString(),
bool pLookUpTerm, const QString &pErrorMessage = {},
bool pHasInternetConnection = true);

void genericLookUp(const QString &pItemInformation = QString(),
void genericLookUp(const QString &pItemInformation = {},
InformationType pInformationType = InformationType::None);

bool isDirectTerm(const QString &pTerm) const;
Expand Down
Expand Up @@ -583,7 +583,7 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::linkHovered()
// link
// Note: this follows the approach used in linkClicked()...

QString linkToolTip = QString();
QString linkToolTip;

if (!link.isEmpty()) {
if (textContent.isEmpty()) {
Expand Down
Expand Up @@ -85,7 +85,7 @@ class CellmlAnnotationViewMetadataNormalViewDetailsWidget : public Core::Widget
void retranslateUi() override;

void updateGui(iface::cellml_api::CellMLElement *pElement,
const QString &pRdfTripleInformation = QString(),
const QString &pRdfTripleInformation = {},
InformationType pInformationType = InformationType::None,
Information pLookUpRdfTripleInformation = Information::First);

Expand Down Expand Up @@ -134,7 +134,7 @@ class CellmlAnnotationViewMetadataNormalViewDetailsWidget : public Core::Widget

void updateOutputHeaders();

void genericLookUp(const QString &pRdfTripleInformation = QString(),
void genericLookUp(const QString &pRdfTripleInformation = {},
InformationType pInformationType = InformationType::None);

signals:
Expand Down
Expand Up @@ -345,7 +345,7 @@ void CellMLEditingViewPlugin::cellmlValidation()
// Validate the current CellML file

if (mCellmlEditingViewInterface != nullptr) {
QString extra = QString();
QString extra;

if (mCellmlEditingViewInterface->validCellml(mFileName, extra)) {
// There are no CellML issues, so the CellML file is valid
Expand Down

0 comments on commit 18c008e

Please sign in to comment.