Skip to content

Commit

Permalink
Merge b8bbf9d into 134632d
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Aug 4, 2018
2 parents 134632d + b8bbf9d commit 97e96cf
Show file tree
Hide file tree
Showing 149 changed files with 995 additions and 866 deletions.
4 changes: 2 additions & 2 deletions src/checkforupdatesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ CheckForUpdatesDialog::CheckForUpdatesDialog(QSettings *pSettings,
CheckForUpdatesDialog::CheckForUpdatesDialog(QSettings *pSettings,
const QString &pApplicationDate,
QWidget *pParent) :
CheckForUpdatesDialog(pSettings, pApplicationDate, 0, pParent)
CheckForUpdatesDialog(pSettings, pApplicationDate, nullptr, pParent)
{
}

//==============================================================================

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

Expand Down
13 changes: 8 additions & 5 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ MainWindow::MainWindow(const QString &pApplicationDate) :
mLoadedGuiPlugins(Plugins()),
mLoadedPreferencesPlugins(Plugins()),
mLoadedWindowPlugins(Plugins()),
mCoreInterface(0),
mCoreInterface(nullptr),
mRawLocale(QString()),
mMenus(QMap<QString, QMenu *>()),
mFileNewMenu(0),
mViewWindowsMenu(0),
mViewSeparator(0),
mFileNewMenu(nullptr),
mViewWindowsMenu(nullptr),
mViewSeparator(nullptr),
mDockedWindowsVisible(true),
mDockedWindowsState(QByteArray())
{
Expand Down Expand Up @@ -492,8 +492,11 @@ void MainWindow::registerOpencorUrlScheme()
exec("xdg-mime", QStringList() << "default" << "opencor.desktop" << "x-scheme-handler/opencor");
}
#elif defined(Q_OS_MAC)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
LSSetDefaultHandlerForURLScheme(CFSTR("opencor"),
CFBundleGetIdentifier(CFBundleGetMainBundle()));
#pragma clang diagnostic pop
#else
#error Unsupported platform
#endif
Expand Down Expand Up @@ -556,7 +559,7 @@ void MainWindow::initializeGuiPlugin(Plugin *pPlugin)
for (int i = guiMenuActions.count()-1; i >= 0; --i) {
// Insert the action/separator to the right menu, if any

QMenu *menu = 0;
QMenu *menu = nullptr;

if (guiMenuActions[i].type() == Gui::MenuAction::File)
menu = mGui->menuFile;
Expand Down
2 changes: 1 addition & 1 deletion src/misc/cliapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace OpenCOR {
//==============================================================================

CliApplication::CliApplication(int &pArgC, char **pArgV) :
mPluginManager(0),
mPluginManager(nullptr),
mLoadedPluginPlugins(Plugins()),
mLoadedCliPlugins(Plugins())
{
Expand Down
10 changes: 7 additions & 3 deletions src/misc/cliutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ namespace OpenCOR {

//==============================================================================

QtMessageHandler defaultMessageHandler;
#ifdef QT_DEBUG
static QtMessageHandler gDefaultMessageHandler;
#endif

//==============================================================================

#ifdef QT_DEBUG
void messageHandler(QtMsgType pType, const QMessageLogContext &pContext,
const QString &pMessage)
{
Expand All @@ -63,8 +66,9 @@ void messageHandler(QtMsgType pType, const QMessageLogContext &pContext,
// hence our filtering it out...

if (pMessage.compare("libpng warning: iCCP: known incorrect sRGB profile"))
defaultMessageHandler(pType, pContext, pMessage);
gDefaultMessageHandler(pType, pContext, pMessage);
}
#endif

//==============================================================================

Expand All @@ -75,7 +79,7 @@ void initQtMessagePattern()
// we want to filter out

#ifdef QT_DEBUG
defaultMessageHandler = qInstallMessageHandler(messageHandler);
gDefaultMessageHandler = qInstallMessageHandler(messageHandler);
#else
qSetMessagePattern("%{if-debug}%{endif}"
"%{if-warning}%{endif}"
Expand Down
2 changes: 1 addition & 1 deletion src/misc/cliutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void initQtMessagePattern();

void initPluginsPath(int pArgC, char *pArgV[]);

void initApplication(QString *pAppDate = 0);
void initApplication(QString *pAppDate = nullptr);

QString applicationDescription(bool pGuiMode = true);

Expand Down
6 changes: 6 additions & 0 deletions src/plugins/cliinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ extern "C" Q_DECL_EXPORT int cliInterfaceVersion()

//==============================================================================

CliInterface::~CliInterface()
{
}

//==============================================================================

} // namespace OpenCOR

//==============================================================================
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/cliinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ extern "C" Q_DECL_EXPORT int cliInterfaceVersion();
class CliInterface
{
public:
virtual ~CliInterface();

#define INTERFACE_DEFINITION
#include "cliinterface.inl"
#undef INTERFACE_DEFINITION
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/coreinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ extern "C" Q_DECL_EXPORT int coreInterfaceVersion()

//==============================================================================

CoreInterface::~CoreInterface()
{
}

//==============================================================================

} // namespace OpenCOR

//==============================================================================
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/coreinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ extern "C" Q_DECL_EXPORT int coreInterfaceVersion();
class CoreInterface
{
public:
virtual ~CoreInterface();

#define INTERFACE_DEFINITION
#include "coreinterface.inl"
#undef INTERFACE_DEFINITION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void BiosignalmlDataStoreExporter::execute(QString &pErrorMessage) const

// Export the given data store to a BioSignalML file

bsml::HDF5::Recording *recording = 0;
bsml::HDF5::Recording *recording = nullptr;

try {
// Create and populate a recording
Expand Down Expand Up @@ -124,10 +124,13 @@ void BiosignalmlDataStoreExporter::execute(QString &pErrorMessage) const
};

bsml::HDF5::SignalArray::Ptr signalArray = recording->new_signalarray(uris, units, clock);
int j = -1;
bsml::HDF5::SignalArray::size_type j = 0;

foreach (DataStore::DataStoreVariable *variable, variables)
(*signalArray)[++j]->set_label(variable->label().toStdString());
foreach (DataStore::DataStoreVariable *variable, variables) {
(*signalArray)[j]->set_label(variable->label().toStdString());

++j;
}

double *data = new double[variables.count()*BufferRows] {};
double *dataPointer = data;
Expand All @@ -140,7 +143,7 @@ void BiosignalmlDataStoreExporter::execute(QString &pErrorMessage) const
++rowCount;

if (rowCount >= BufferRows) {
signalArray->extend(data, variables.count()*BufferRows);
signalArray->extend(data, size_t(variables.count()*BufferRows));

dataPointer = data;

Expand All @@ -150,7 +153,7 @@ void BiosignalmlDataStoreExporter::execute(QString &pErrorMessage) const
emit progress(++stepNb*oneOverNbOfSteps);
}

signalArray->extend(data, variables.count()*rowCount);
signalArray->extend(data, size_t(variables.count()*rowCount));

delete[] data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ DataStore::DataStoreData * BioSignalMLDataStorePlugin::getData(const QString &pF
}
}

return 0;
return nullptr;
}

//==============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CsvDataStoreExporter::execute(QString &pErrorMessage) const

DataStore::DataStore *dataStore = mDataStoreData->dataStore();
DataStore::DataStoreVariables variables = mDataStoreData->variables();
DataStore::DataStoreVariable *voi = variables.contains(dataStore->voi())?dataStore->voi():0;
DataStore::DataStoreVariable *voi = variables.contains(dataStore->voi())?dataStore->voi():nullptr;

variables.removeOne(voi);

Expand Down Expand Up @@ -157,7 +157,7 @@ void CsvDataStoreExporter::execute(QString &pErrorMessage) const
if (res) {
emit progress(++stepNb*oneOverNbOfSteps);

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

Expand All @@ -180,7 +180,7 @@ void CsvDataStoreExporter::execute(QString &pErrorMessage) const
rowData += ',';

if ( (runsIndex[j] < dataStore->size(j))
&& (dataStore->voi()->value(runsIndex[j], j) == voiValue)) {
&& qIsNull(dataStore->voi()->value(runsIndex[j], j)-voiValue)) {
rowData += QString::number(variableRun->value(runsIndex[j], j));

updateRunsIndex[j] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DataStore::DataStoreData * CSVDataStorePlugin::getData(const QString &pFileName,
return new DataStore::DataStoreData(fileName, pDataStore, dataStoreDialog.selectedData());
}

return 0;
return nullptr;
}

//==============================================================================
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dataStore/DataStore/src/datastoredialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ DataStoreDialog::DataStoreDialog(DataStore *pDataStore, bool pIncludeVoi,
mGui->treeView->setItemDelegate(new DataItemDelegate(this));

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

foreach (DataStoreVariable *variable,
pIncludeVoi?pDataStore->voiAndVariables():pDataStore->variables()) {
Expand All @@ -131,7 +131,7 @@ DataStoreDialog::DataStoreDialog(DataStore *pDataStore, bool pIncludeVoi,
QStandardItem *parentHierarchyItem = mModel->invisibleRootItem();

foreach (const QString &hierarchyPart, crtDataHierarchy.split('/')) {
hierarchyItem = 0;
hierarchyItem = nullptr;

for (int i = 0, iMax = parentHierarchyItem->rowCount(); i < iMax; ++i) {
QStandardItem *childHierarchyItem = parentHierarchyItem->child(i);
Expand Down Expand Up @@ -181,7 +181,7 @@ DataStoreDialog::DataStoreDialog(DataStore *pDataStore, bool pIncludeVoi,

mGui->treeView->expandAll();

updateDataSelectedState(0);
updateDataSelectedState(nullptr);

// Set our minimum size

Expand Down
15 changes: 12 additions & 3 deletions src/plugins/datastoreinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@ double * DataStoreVariable::values(int pRun) const
// Return the values for the given run, if any

if (mRuns.isEmpty()) {
return 0;
return nullptr;
} else {
if (pRun == -1)
return mRuns.last()->values();
else
return ((pRun >= 0) && (pRun < mRuns.count()))?mRuns[pRun]->values():0;
return ((pRun >= 0) && (pRun < mRuns.count()))?mRuns[pRun]->values():nullptr;
}
}

Expand Down Expand Up @@ -501,7 +501,7 @@ DataStoreVariable * DataStore::addVariable(double *pValue)
// some runs

if (mVoi->runsCount())
return 0;
return nullptr;

DataStoreVariable *variable = new DataStoreVariable(pValue);

Expand Down Expand Up @@ -611,6 +611,15 @@ void DataStoreExporter::started()
//==============================================================================

} // namespace DataStore

//==============================================================================

DataStoreInterface::~DataStoreInterface()
{
}

//==============================================================================

} // namespace OpenCOR

//==============================================================================
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/datastoreinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef QList<DataStoreVariableRun *> DataStoreVariableRuns;
class DataStoreVariable
{
public:
explicit DataStoreVariable(double *pValue = 0);
explicit DataStoreVariable(double *pValue = nullptr);
~DataStoreVariable();

static bool compare(DataStoreVariable *pVariable1,
Expand Down Expand Up @@ -155,7 +155,7 @@ class DataStore
DataStoreVariables variables();
DataStoreVariables voiAndVariables();

DataStoreVariable * addVariable(double *pValue = 0);
DataStoreVariable * addVariable(double *pValue = nullptr);
DataStoreVariables addVariables(double *pValues, int pCount);

void addValues(double pVoiValue);
Expand Down Expand Up @@ -208,6 +208,8 @@ extern "C" Q_DECL_EXPORT int dataStoreInterfaceVersion();
class DataStoreInterface
{
public:
virtual ~DataStoreInterface();

#define INTERFACE_DEFINITION
#include "datastoreinterface.inl"
#undef INTERFACE_DEFINITION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(boo

CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(bool pError,
const QString &pText) :
CellmlAnnotationViewCellmlElementItem(false, pError?Error:Warning, pText, 0, -1)
CellmlAnnotationViewCellmlElementItem(false, pError?Error:Warning, pText, nullptr, -1)
{
// Disable the item and use its text as a tooltip (in case it's too long and
// doesn't fit within the allocated space we have)
Expand All @@ -121,7 +121,7 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(boo

CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(Type pType,
const QString &pText) :
CellmlAnnotationViewCellmlElementItem(true, pType, pText, 0, -1)
CellmlAnnotationViewCellmlElementItem(true, pType, pText, nullptr, -1)
{
// Use its text as a tooltip (in case it's too long and doesn't fit within
// the allocated space we have)
Expand Down Expand Up @@ -283,10 +283,6 @@ void CellmlAnnotationViewCellmlElementItem::setIcon(Type pType)
QStandardItem::setIcon(ConnectionIcon);

break;
default:
// A type that doesn't require an icon

;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CellmlAnnotationViewMetadataDetailsWidget::CellmlAnnotationViewMetadataDetailsWi
Widget(pParent),
mPlugin(pPlugin),
mCellmlFile(pParent->cellmlFile()),
mElement(0)
mElement(nullptr)
{
// Create and set our vertical layout

Expand Down

0 comments on commit 97e96cf

Please sign in to comment.