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 4, 2020
1 parent 23d4c2f commit 31a7df4
Show file tree
Hide file tree
Showing 76 changed files with 143 additions and 153 deletions.
2 changes: 1 addition & 1 deletion src/checkforupdatesdialog.cpp
Expand Up @@ -232,7 +232,7 @@ CheckForUpdatesDialog::CheckForUpdatesDialog(const QString &pApplicationDate,
//==============================================================================

CheckForUpdatesDialog::CheckForUpdatesDialog(CheckForUpdatesEngine *pEngine) :
CheckForUpdatesDialog(QString(), pEngine, nullptr)
CheckForUpdatesDialog({}, pEngine, nullptr)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Expand Up @@ -742,7 +742,7 @@ void MainWindow::loadSettings()

// Retrieve the state of the docked windows

mDockedWindowsState = settings.value(SettingsDockedWindowsState, QByteArray()).toByteArray();
mDockedWindowsState = settings.value(SettingsDockedWindowsState, {}).toByteArray();

// Remove the File menu when on macOS, should no plugins be loaded
// Note: our File menu should only contain the Exit menu item, but on macOS
Expand Down
2 changes: 1 addition & 1 deletion src/misc/openfile.cpp.inl
Expand Up @@ -79,7 +79,7 @@ QString cliOpenFile(const QString &pFileName, File::Type pType,
int fileTabIndex = mFileTabs->currentIndex()+1;

mFileNames.insert(fileTabIndex, fileName);
mFileTabs->insertTab(fileTabIndex, QString());
mFileTabs->insertTab(fileTabIndex, {});

updateFileTab(fileTabIndex);

Expand Down
2 changes: 1 addition & 1 deletion src/misc/openremotefile.cpp.inl
Expand Up @@ -19,7 +19,7 @@ QString cliOpenRemoteFile(const QString &pUrl)
// so open the file as a local file and leave

#ifdef GUI_SUPPORT
return openFile(fileNameOrUrl, File::Type::Local, QString(), pShowWarning);
return openFile(fileNameOrUrl, File::Type::Local, {}, pShowWarning);
#else
return cliOpenFile(fileNameOrUrl);
#endif
Expand Down
3 changes: 1 addition & 2 deletions src/misc/opensimulation.cpp.inl
Expand Up @@ -31,8 +31,7 @@ static PyObject * openSimulation(PyObject *pSelf, PyObject *pArgs)
QString error = isLocalFile?
#ifdef GUI_SUPPORT
Core::guiOpenFile(fileNameOrUrl,
Core::File::Type::Local,
QString(), false):
Core::File::Type::Local, {}, false):
Core::guiOpenRemoteFile(fileNameOrUrl, false);
#else
Core::cliOpenFile(fileNameOrUrl):
Expand Down
Expand Up @@ -138,7 +138,7 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(Typ
CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(Type pType,
iface::cellml_api::CellMLElement *pElement,
int pNumber) :
CellmlAnnotationViewCellmlElementItem(false, pType, QString(), pElement, pNumber)
CellmlAnnotationViewCellmlElementItem(false, pType, {}, pElement, pNumber)
{
// Set the text for some types

Expand Down Expand Up @@ -930,7 +930,7 @@ void CellmlAnnotationViewCellmlListWidget::removeCurrentMetadata()
// Re-update the metadata details view now that the current node doesn't
// have any metadata associated with it

updateMetadataDetails(mTreeViewWidget->currentIndex(), QModelIndex());
updateMetadataDetails(mTreeViewWidget->currentIndex(), {});
}

//==============================================================================
Expand All @@ -944,7 +944,7 @@ void CellmlAnnotationViewCellmlListWidget::removeAllMetadata()
// Re-update the metadata details view now that the CellML file doesn't have
// any metadata associated with it

updateMetadataDetails(mTreeViewWidget->currentIndex(), QModelIndex());
updateMetadataDetails(mTreeViewWidget->currentIndex(), {});
}

//==============================================================================
Expand Down
Expand Up @@ -56,7 +56,7 @@ CellmlAnnotationViewMetadataDetailsWidget::CellmlAnnotationViewMetadataDetailsWi

auto layout = new QVBoxLayout(this);

layout->setContentsMargins(QMargins());
layout->setContentsMargins({});
layout->setSpacing(0);

setLayout(layout);
Expand Down
Expand Up @@ -174,7 +174,7 @@ CellmlAnnotationViewMetadataEditDetailsWidget::CellmlAnnotationViewMetadataEditD
auto qualifierWidget = new QWidget(formWidget);
auto qualifierWidgetLayout = new QHBoxLayout(qualifierWidget);

qualifierWidgetLayout->setContentsMargins(QMargins());
qualifierWidgetLayout->setContentsMargins({});

qualifierWidget->setLayout(qualifierWidgetLayout);

Expand Down Expand Up @@ -215,7 +215,7 @@ CellmlAnnotationViewMetadataEditDetailsWidget::CellmlAnnotationViewMetadataEditD
auto termWidget = new QWidget(formWidget);
auto termWidgetLayout = new QHBoxLayout(termWidget);

termWidgetLayout->setContentsMargins(QMargins());
termWidgetLayout->setContentsMargins({});

termWidget->setLayout(termWidgetLayout);

Expand Down Expand Up @@ -405,8 +405,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::updateGui(iface::cellml_api:

if ( (pResetItemsGui && !mAnnotationWidget->isBusyWidgetVisible())
|| termIsDirect) {
updateItemsGui(CellmlAnnotationViewMetadataEditDetailsItems(),
!termIsDirect && !pFilePermissionsChanged);
updateItemsGui({}, !termIsDirect && !pFilePermissionsChanged);
}

// Enable or disable the add buttons for our retrieved terms, depending on
Expand Down Expand Up @@ -460,7 +459,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::upudateOutputMessage(bool pL
mOutputMessage->setIconMessage(":/oxygen/actions/help-hint.png",
tr("Enter a term above..."));
} else if (pLookUpTerm) {
mOutputMessage->setIconMessage(QString(), QString());
mOutputMessage->setIconMessage({}, {});

if (pShowBusyWidget != nullptr) {
*pShowBusyWidget = true;
Expand Down Expand Up @@ -534,7 +533,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::updateItemsGui(const CellmlA
mItemsMapping.clear();
mEnabledItems.clear();

mOutputOntologicalTerms->webView()->setHtml(QString());
mOutputOntologicalTerms->webView()->setHtml({});

// Populate our Web view, but only if there is at least one item

Expand Down Expand Up @@ -1061,8 +1060,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::addTerm()

// Update our items' GUI

updateItemsGui(CellmlAnnotationViewMetadataEditDetailsItems(),
!isDirectTerm(mTermValue->text()));
updateItemsGui({}, !isDirectTerm(mTermValue->text()));

// Ask our parent to update its GUI with the added RDF triple

Expand Down
Expand Up @@ -239,7 +239,7 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::updateGui(iface::cellm
addRdfTriple(rdfTriple, false);
}
} else {
mOutputOntologicalTerms->webView()->setHtml(QString());
mOutputOntologicalTerms->webView()->setHtml({});
}

// Do additional GUI updates
Expand Down Expand Up @@ -323,7 +323,7 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::addRdfTriple(CellMLSup
if (pNeedAdditionalGuiUpdates) {
mLookUpRdfTripleInformation = Information::Last;

additionalGuiUpdates(QString(), InformationType::None, mLookUpRdfTripleInformation);
additionalGuiUpdates({}, InformationType::None, mLookUpRdfTripleInformation);
}
}

Expand Down
Expand Up @@ -1892,7 +1892,7 @@ QString CellMLTextViewConverter::processPowerNode(const QDomNode &pDomNode,

static const QRegularExpression UnitRegEx = QRegularExpression("{[^}]*}$");

double n = QString(b).replace(UnitRegEx, QString()).toDouble();
double n = QString(b).replace(UnitRegEx, {}).toDouble();

if (n == 2.0) {
res = "sqr("+a+")";
Expand Down Expand Up @@ -1977,7 +1977,7 @@ QString CellMLTextViewConverter::processRootNode(const QDomNode &pDomNode,

static const QRegularExpression UnitRegEx = QRegularExpression("{[^}]*}$");

double n = QString(b).replace(UnitRegEx, QString()).toDouble();
double n = QString(b).replace(UnitRegEx, {}).toDouble();

if (n == 2.0) {
res = "sqrt("+a+")";
Expand Down
Expand Up @@ -1220,7 +1220,7 @@ void CellmlTextViewWidget::updateViewer()

mContentMathmlEquation = QString();

mEditingWidget->mathmlViewer()->setContents(QString());
mEditingWidget->mathmlViewer()->setContents({});
} else {
// There is a statement, so try to parse it

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/editing/CellMLTextView/tests/parsingtests.cpp
Expand Up @@ -47,7 +47,7 @@ void ParsingTests::basicTests()

// Various tests on a minimal model definition

QVERIFY(!parser.execute(QString(),
QVERIFY(!parser.execute({},
OpenCOR::CellMLSupport::CellmlFile::Version::Cellml_1_0));
QCOMPARE(parser.messages().first().type(), OpenCOR::CellMLTextView::CellmlTextViewParserMessage::Type::Error);
QCOMPARE(parser.messages().first().message(), QString("'def' is expected, but the end of the file was found instead."));
Expand Down
Expand Up @@ -579,7 +579,7 @@ void RawCellmlViewWidget::updateViewer()
if (!foundMathmlBlock || !hasContentMathmlEquation) {
mContentMathmlEquation = QString();

mEditingWidget->mathmlViewer()->setContents(QString());
mEditingWidget->mathmlViewer()->setContents({});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/borderedwidget.cpp
Expand Up @@ -50,7 +50,7 @@ BorderedWidget::BorderedWidget(QWidget *pWidget, bool pTop, bool pLeft,

auto gridLayout = new QGridLayout(this);

gridLayout->setContentsMargins(QMargins());
gridLayout->setContentsMargins({});
gridLayout->setSpacing(0);

setLayout(gridLayout);
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/miscellaneous/Core/src/centralwidget.cpp
Expand Up @@ -137,7 +137,7 @@ CentralWidget::CentralWidget(QWidget *pParent) :

auto layout = new QHBoxLayout(this);

layout->setContentsMargins(QMargins());
layout->setContentsMargins({});
layout->setSpacing(0);

setLayout(layout);
Expand Down Expand Up @@ -198,7 +198,7 @@ CentralWidget::CentralWidget(QWidget *pParent) :
auto centralWidget = new QWidget(this);
auto centralWidgetVBoxLayout = new QVBoxLayout(centralWidget);

centralWidgetVBoxLayout->setContentsMargins(QMargins());
centralWidgetVBoxLayout->setContentsMargins({});
centralWidgetVBoxLayout->setSpacing(0);

centralWidget->setLayout(centralWidgetVBoxLayout);
Expand Down Expand Up @@ -409,7 +409,7 @@ void CentralWidget::loadSettings(QSettings &pSettings)
fileMode = mModeTabIndexModes.value(i);

CentralWidgetMode *mode = mModes.value(fileMode);
QString viewPluginName = pSettings.value(QString(SettingsFileModeView).arg(QString(),
QString viewPluginName = pSettings.value(QString(SettingsFileModeView).arg({},
ViewInterface::modeAsString(fileMode))).toString();
Plugins viewPlugins = mode->viewPlugins();

Expand Down Expand Up @@ -514,7 +514,7 @@ void CentralWidget::saveSettings(QSettings &pSettings) const
ViewInterface::Mode fileMode = mModeTabIndexModes.value(i);
CentralWidgetMode *mode = mModes.value(fileMode);

pSettings.setValue(QString(SettingsFileModeView).arg(QString(),
pSettings.setValue(QString(SettingsFileModeView).arg({},
ViewInterface::modeAsString(fileMode)),
mode->viewPlugins()[mode->viewTabs()->currentIndex()]->name());
}
Expand Down Expand Up @@ -1381,7 +1381,7 @@ void CentralWidget::addView(Plugin *pPlugin)
if (!mModes.value(viewMode)->isEnabled()) {
// There is no tab for the mode, so add one and enable it

int tabIndex = mModeTabs->addTab(QString());
int tabIndex = mModeTabs->addTab({});

mModes.value(viewMode)->setEnabled(true);

Expand All @@ -1396,7 +1396,7 @@ void CentralWidget::addView(Plugin *pPlugin)
CentralWidgetMode *mode = mModes.value(viewMode);

mode->addViewPlugin(pPlugin);
mode->viewTabs()->addTab(QString());
mode->viewTabs()->addTab({});
}

//==============================================================================
Expand Down Expand Up @@ -1989,13 +1989,13 @@ void CentralWidget::updateModifiedSettings()
// tabs

mModeTabs->setEnabled(true);
mModeTabs->setToolTip(QString());
mModeTabs->setToolTip({});

for (auto mode : mModes) {
TabBarWidget *viewTabs = mode->viewTabs();

viewTabs->setEnabled(true);
viewTabs->setToolTip(QString());
viewTabs->setToolTip({});
}

// Enable/disable the Mode tabs and the current mode's View tabs, in case
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/miscellaneous/Core/src/collapsiblewidget.cpp
Expand Up @@ -67,7 +67,7 @@ CollapsibleHeaderWidget::CollapsibleHeaderWidget(bool pCollapsible,

auto layout = new QVBoxLayout(this);

layout->setContentsMargins(QMargins());
layout->setContentsMargins({});
layout->setSpacing(0);

setLayout(layout);
Expand All @@ -77,7 +77,7 @@ CollapsibleHeaderWidget::CollapsibleHeaderWidget(bool pCollapsible,
auto subWidget = new QWidget(this);
auto subLayout = new QHBoxLayout(subWidget);

subLayout->setContentsMargins(QMargins());
subLayout->setContentsMargins({});
subLayout->setSpacing(0);

subWidget->setLayout(subLayout);
Expand Down Expand Up @@ -292,13 +292,13 @@ void CollapsibleHeaderWidget::showMenu()
//==============================================================================

CollapsibleWidget::CollapsibleWidget(QWidget *pParent) :
Widget(QSize(), pParent)
Widget({}, pParent)
{
// Create a vertical layout that will contain our headers and widgets

mLayout = new QVBoxLayout(this);

mLayout->setContentsMargins(QMargins());
mLayout->setContentsMargins({});
mLayout->setSpacing(0);

setLayout(mLayout);
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/miscellaneous/Core/src/corecliutils.cpp
Expand Up @@ -821,7 +821,7 @@ QString newFileName(const QString &pFileName, const QString &pExtra,
{
// Return the name of a 'new' file

return newFileName(pFileName, pExtra, pBefore, QString());
return newFileName(pFileName, pExtra, pBefore, {});
}

//==============================================================================
Expand All @@ -830,7 +830,7 @@ QString newFileName(const QString &pFileName, const QString &pFileExtension)
{
// Return the name of a 'new' file

return newFileName(pFileName, QString(), true, pFileExtension);
return newFileName(pFileName, {}, true, pFileExtension);
}

//==============================================================================
Expand Down Expand Up @@ -1037,7 +1037,7 @@ QStringList filters(const FileTypeInterfaces &pFileTypeInterfaces)
// Convert and return as a list of strings the filters corresponding to the
// given file type interfaces

return filters(pFileTypeInterfaces, false, QString());
return filters(pFileTypeInterfaces, false, {});
}

//==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/coreguiutils.cpp
Expand Up @@ -366,7 +366,7 @@ QString getSaveFileName(const QString &pCaption, const QStringList &pFilters,
{
// Retrieve and return a save file name

return getSaveFileName(pCaption, QString(), pFilters, pSelectedFilter);
return getSaveFileName(pCaption, {}, pFilters, pSelectedFilter);
}

//==============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/coreplugin.cpp
Expand Up @@ -58,7 +58,7 @@ PLUGININFO_FUNC CorePluginInfo()
descriptions.insert("fr", QString::fromUtf8("l'extension de base."));

return new PluginInfo(PluginInfo::Category::Miscellaneous, false, false,
QStringList(),
{},
descriptions);
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/miscellaneous/Core/src/progressbarwidget.cpp
Expand Up @@ -37,7 +37,7 @@ namespace Core {
//==============================================================================

ProgressBarWidget::ProgressBarWidget(QWidget *pParent) :
Widget(QSize(), pParent)
Widget({}, pParent)
{
}

Expand Down

0 comments on commit 31a7df4

Please sign in to comment.