Skip to content

Commit

Permalink
Cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Oct 25, 2019
2 parents 7875883 + 5f14660 commit cb12482
Show file tree
Hide file tree
Showing 57 changed files with 510 additions and 485 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Expand Up @@ -23,6 +23,8 @@ Checks: >-
-cppcoreguidelines-special-member-functions,
fuchsia-*,
-fuchsia-default-arguments,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator,
-fuchsia-statically-constructed-objects,
Expand All @@ -41,6 +43,7 @@ Checks: >-
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-pass-by-value,
-modernize-use-trailing-return-type,
performance-*,
readability-*,
-readability-isolate-declaration,
Expand Down
24 changes: 14 additions & 10 deletions src/checkforupdatesdialog.cpp
Expand Up @@ -70,8 +70,12 @@ void CheckForUpdatesEngine::check()

if (jsonParseError.error == QJsonParseError::NoError) {
QVariantMap versionMap;
int versionMajor, versionMinor, versionPatch;
int versionDay, versionMonth, versionYear;
int versionMajor;
int versionMinor;
int versionPatch;
int versionDay;
int versionMonth;
int versionYear;
QString versionVersion;
QString versionDate;

Expand Down Expand Up @@ -278,12 +282,12 @@ void CheckForUpdatesDialog::updateGui()
}

if (version.contains('-')) {
mGui->statusLabel->setText(snapshotInformation.arg(WhatIsNewUrl+"latest")
.arg(version));
mGui->statusLabel->setText(snapshotInformation.arg(WhatIsNewUrl+"latest",
version));
} else {
mGui->statusLabel->setText(versionInformation.arg(WhatIsNewUrl+version)
.arg(qAppName())
.arg(version));
mGui->statusLabel->setText(versionInformation.arg(WhatIsNewUrl+version,
qAppName(),
version));
}
} else {
mGui->statusLabel->setText(tr("No newer version or snapshot of %1 is available.").arg(qAppName()));
Expand All @@ -302,9 +306,9 @@ void CheckForUpdatesDialog::updateGui()
}
}

mGui->statusLabel->setText(versionInformation.arg(WhatIsNewUrl+version)
.arg(qAppName())
.arg(version));
mGui->statusLabel->setText(versionInformation.arg(WhatIsNewUrl+version,
qAppName(),
version));
} else {
mGui->statusLabel->setText(tr("No newer version of %1 is available.").arg(qAppName()));
}
Expand Down
16 changes: 8 additions & 8 deletions src/mainwindow.cpp
Expand Up @@ -471,9 +471,9 @@ void MainWindow::registerOpencorUrlScheme()
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr);
#elif defined(Q_OS_LINUX)
if (exec("which", QStringList() << "xdg-mime") == 0) {
QString iconPath = canonicalFileName(QString("%1/.local/share/%2/%3/%3.png").arg(QDir::homePath())
.arg(qApp->organizationName())
.arg(qApp->applicationName()));
QString iconPath = canonicalFileName(QString("%1/.local/share/%2/%3/%3.png").arg(QDir::homePath(),
qApp->organizationName(),
qApp->applicationName()));

writeResourceToFile(iconPath, ":/app_icon");

Expand All @@ -484,9 +484,9 @@ void MainWindow::registerOpencorUrlScheme()
"Exec=%2 %u\n"
"Icon=%3\n"
"Terminal=false\n"
"MimeType=x-scheme-handler/opencor\n").arg(qApp->applicationName())
.arg(canonicalFileName(qApp->applicationFilePath()))
.arg(iconPath));
"MimeType=x-scheme-handler/opencor\n").arg(qApp->applicationName(),
canonicalFileName(qApp->applicationFilePath()),
iconPath));

exec("xdg-mime", QStringList() << "default" << "opencor.desktop" << "x-scheme-handler/opencor");
}
Expand Down Expand Up @@ -852,8 +852,8 @@ void MainWindow::setLocale(const QString &pRawLocale, bool pForceSetting)
// plugin to work properly...

for (auto plugin : mLoadedI18nPlugins) {
qobject_cast<I18nInterface *>(plugin->instance())->updateTranslator(QString(":/%1_%2").arg(plugin->name())
.arg(newLocale));
qobject_cast<I18nInterface *>(plugin->instance())->updateTranslator(QString(":/%1_%2").arg(plugin->name(),
newLocale));
}

// Retranslate our various plugins
Expand Down
Expand Up @@ -138,9 +138,9 @@ DataStore::DataStoreExportData * BioSignalMLDataStorePlugin::getExportData(const
biosignalmlDataStoreDialog.name(),
biosignalmlDataStoreDialog.author(),
biosignalmlDataStoreDialog.description(),
tr("Generated by %1 at %2 from %3.").arg(Core::version())
.arg(QDateTime::currentDateTimeUtc().toString(Qt::ISODate))
.arg(pDataStore->uri()),
tr("Generated by %1 at %2 from %3.").arg(Core::version(),
QDateTime::currentDateTimeUtc().toString(Qt::ISODate),
pDataStore->uri()),
pDataStore,
biosignalmlDataStoreDialog.selectedData());
}
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/dataStore/CSVDataStore/src/csvdatastoreexporter.cpp
Expand Up @@ -125,9 +125,9 @@ void CsvDataStoreExporterWorker::run()
QString header = QString();

if (voi != nullptr) {
header += Header.arg(voi->uri().replace("/prime", "'").replace('/', " | "))
.arg(voi->unit())
.arg(QString());
header += Header.arg(voi->uri().replace("/prime", "'").replace('/', " | "),
voi->unit(),
QString());
}

for (auto variable : variables) {
Expand All @@ -136,9 +136,9 @@ void CsvDataStoreExporterWorker::run()
header += ',';
}

header += Header.arg(variable->uri().replace("/prime", "'").replace('/', " | "))
.arg(variable->unit())
.arg((nbOfRuns == 1)?
header += Header.arg(variable->uri().replace("/prime", "'").replace('/', " | "),
variable->unit(),
(nbOfRuns == 1)?
QString():
RunNb.arg(i+1));
}
Expand Down
Expand Up @@ -166,15 +166,15 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(Typ
} else if (pType == Type::ComponentMapping) {
ObjRef<iface::cellml_api::MapComponents> mapComponents = dynamic_cast<iface::cellml_api::MapComponents *>(pElement);

setText(QString("%1 %2 %3").arg(QString::fromStdWString(mapComponents->firstComponentName()))
.arg(QChar(RightArrow))
.arg(QString::fromStdWString(mapComponents->secondComponentName())));
setText(QString("%1 %2 %3").arg(QString::fromStdWString(mapComponents->firstComponentName()),
QChar(RightArrow),
QString::fromStdWString(mapComponents->secondComponentName())));
} else if (pType == Type::VariableMapping) {
ObjRef<iface::cellml_api::MapVariables> mapVariables = dynamic_cast<iface::cellml_api::MapVariables *>(pElement);

setText(QString("%1 %2 %3").arg(QString::fromStdWString(mapVariables->firstVariableName()))
.arg(QChar(RightArrow))
.arg(QString::fromStdWString(mapVariables->secondVariableName())));
setText(QString("%1 %2 %3").arg(QString::fromStdWString(mapVariables->firstVariableName()),
QChar(RightArrow),
QString::fromStdWString(mapVariables->secondVariableName())));
} else {
// Another type of element that has a name

Expand Down
Expand Up @@ -268,10 +268,10 @@ void CellmlAnnotationViewEditingWidget::updateWebViewerWithQualifierDetails(WebV

// Show the information

pWebViewer->webView()->setHtml(mQualifierInformationTemplate.arg(pQualifier)
.arg(qualifierSvg)
.arg(shortDescription)
.arg(longDescription));
pWebViewer->webView()->setHtml(mQualifierInformationTemplate.arg(pQualifier,
qualifierSvg,
shortDescription,
longDescription));
}

//==============================================================================
Expand Down
Expand Up @@ -545,8 +545,8 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::updateItemsGui(const CellmlA

int iconSize = int(16/qApp->devicePixelRatio());

mOutputOntologicalTerms->webView()->setHtml(mOutputOntologicalTermsTemplate.arg(Core::iconDataUri(":/oxygen/actions/list-add.png", iconSize, iconSize))
.arg(Core::iconDataUri(":/oxygen/actions/list-add.png", iconSize, iconSize, QIcon::Disabled)));
mOutputOntologicalTerms->webView()->setHtml(mOutputOntologicalTermsTemplate.arg(Core::iconDataUri(":/oxygen/actions/list-add.png", iconSize, iconSize),
Core::iconDataUri(":/oxygen/actions/list-add.png", iconSize, iconSize, QIcon::Disabled)));

// Add the items

Expand Down
Expand Up @@ -262,8 +262,8 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::addRdfTriple(CellMLSup
if (mItemsCount == 0) {
int iconSize = int(16/qApp->devicePixelRatio());

mOutputOntologicalTerms->webView()->setHtml(mOutputOntologicalTermsTemplate.arg(Core::iconDataUri(":/oxygen/actions/list-remove.png", iconSize, iconSize))
.arg(Core::iconDataUri(":/oxygen/actions/list-remove.png", iconSize, iconSize, QIcon::Disabled)));
mOutputOntologicalTerms->webView()->setHtml(mOutputOntologicalTermsTemplate.arg(Core::iconDataUri(":/oxygen/actions/list-remove.png", iconSize, iconSize),
Core::iconDataUri(":/oxygen/actions/list-remove.png", iconSize, iconSize, QIcon::Disabled)));
}

// Add the item
Expand Down
Expand Up @@ -67,7 +67,7 @@ class CellMLAnnotationViewPlugin : public QObject,
#include "viewinterface.inl"

private:
CellmlAnnotationViewWidget *mViewWidget;
CellmlAnnotationViewWidget *mViewWidget = nullptr;
};

//==============================================================================
Expand Down
Expand Up @@ -92,7 +92,7 @@ void CellmlAnnotationViewWidget::retranslateUi()
{
// Retranslate our editing widgets

for (auto editingWidget : mEditingWidgets.values()) {
for (auto editingWidget : mEditingWidgets) {
editingWidget->retranslateUi();
}
}
Expand Down

0 comments on commit cb12482

Please sign in to comment.