Commit baa73639 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

fix compile warnings

parent 3fa50b24
......@@ -50,7 +50,7 @@ void AutomaticDataLoader1D::previewOfGraph(QCustomPlot* plotWidget) const
QVector<double> rVec;
auto& axis = outputData->axis(0);
for (auto i = 0; i < size; i++) {
for (size_t i = 0; i < size; i++) {
qVec << axis.binCenter(i); // axis.bincenter is same as operator[] for pointwise.
// getAxisValue() calls opertor[]
rVec << dataValues[i];
......
......@@ -73,20 +73,6 @@ QVector<QPair<int, int>> expandLineNumberPattern(const QString& pattern, bool* o
return result;
}
struct Palette {
static QColor backgroundColorFileContent;
static QColor backgroundColorRawContent;
static QColor backgroundColorProcessedContent;
static QColor backgroundColorErrors;
static QColor skippedLineTextColor;
};
QColor Palette::backgroundColorFileContent(239, 237, 248);
QColor Palette::backgroundColorRawContent(247, 240, 210);
QColor Palette::backgroundColorProcessedContent(191, 232, 242);
QColor Palette::backgroundColorErrors(247, 140, 146);
QColor Palette::skippedLineTextColor(Qt::lightGray);
} // namespace
QREDataLoader::QREDataLoader() : m_propertiesWidget(nullptr)
......@@ -287,7 +273,6 @@ QString QREDataLoader::processContents()
m_item->specularDataItem()->setOutputData(nullptr);
};
const bool settingsChanged = m_importResult.importSettings != m_importSettings;
const bool parsingSettingsChanged =
m_importResult.importSettings.headerPrefix != m_importSettings.headerPrefix
|| m_importResult.importSettings.linesToSkip != m_importSettings.linesToSkip
......@@ -421,7 +406,7 @@ void QREDataLoader::parseFileContent() const
: m_importSettings.headerPrefix.split(",");
const auto lineIsHeader = [headerPrefixes](const QString& line) {
for (const auto prefix : headerPrefixes) {
for (const auto& prefix : headerPrefixes) {
if (line.startsWith(prefix.trimmed()))
return true;
}
......@@ -525,9 +510,6 @@ void QREDataLoader::calculateFromParseResult() const
const double e =
eColIsValid ? rawValues[eCol] * eFactor : std::numeric_limits<double>::quiet_NaN();
const bool lineContainsNaN =
(std::isnan(q) || std::isnan(r) || (std::isnan(e) && errorColumnIsEnabled));
if (std::isnan(q)) {
m_importResult.addError(lineNr, ErrorDefinition::columnDoesNotContainValidNumber,
qCol + 1);
......
......@@ -73,7 +73,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item)
return;
m_currentDataItem->mapper()->setOnPropertyChange(
[this](const QString& name) { onRealDataPropertyChanged(); }, this);
[this](const QString&) { onRealDataPropertyChanged(); }, this);
m_currentDataItem->mapper()->setOnItemDestroy(
[this](SessionItem*) { m_currentDataItem = nullptr; }, this);
......@@ -85,7 +85,7 @@ void RealDataPropertiesWidget::setItem(RealDataItem* item)
//! Processes user interaction with instrument selector combo. If there is realDataItem,
//! it will be linked with selected instrument.
void RealDataPropertiesWidget::onInstrumentComboIndexChanged(int index)
void RealDataPropertiesWidget::onInstrumentComboIndexChanged(int /*index*/)
{
if (!m_currentDataItem)
return;
......
......@@ -39,13 +39,13 @@
RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent)
: QWidget(parent)
, m_itemTree(new QTreeView)
, m_itemTreeModel(new RealDataTreeModel)
, m_propertiesWidget(new RealDataPropertiesWidget)
, m_import2dDataAction(new QAction(this))
, m_import1dDataAction(new QAction(this))
, m_renameDataAction(new QAction(this))
, m_removeDataAction(new QAction(this))
, m_rotateDataAction(new QAction(this))
, m_itemTreeModel(new RealDataTreeModel)
{
setMinimumSize(128, 600);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
......
......@@ -64,14 +64,14 @@ private:
QModelIndex currentIndex();
private:
QTreeView* m_itemTree;
RealDataTreeModel* m_itemTreeModel;
RealDataPropertiesWidget* m_propertiesWidget;
QAction* m_import2dDataAction;
QAction* m_import1dDataAction;
QAction* m_renameDataAction;
QAction* m_removeDataAction;
QAction* m_rotateDataAction;
QTreeView* m_itemTree;
RealDataTreeModel* m_itemTreeModel;
RealDataPropertiesWidget* m_propertiesWidget;
};
#endif // BORNAGAIN_GUI_COREGUI_VIEWS_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H
......@@ -176,7 +176,7 @@ QModelIndex RealDataTreeModel::parent(const QModelIndex& index) const
return create2DHeadlineIndex();
}
int RealDataTreeModel::columnCount(const QModelIndex& parent) const
int RealDataTreeModel::columnCount(const QModelIndex& /*parent*/) const
{
return 1;
}
......@@ -209,7 +209,6 @@ int RealDataTreeModel::rowCount(const QModelIndex& parent) const
QVariant RealDataTreeModel::data(const QModelIndex& index, int role) const
{
const bool has1D = !m_items1D.isEmpty();
const bool has2D = !m_items2D.isEmpty();
if (isHeadline(index)) {
const QString title = (index.row() == 0 && has1D) ? "1D Data" : "2D Data";
......@@ -313,7 +312,6 @@ QModelIndex RealDataTreeModel::indexForItem(RealDataItem* item) const
return QModelIndex();
if (item->isSpecularData()) {
auto index = m_items1D.indexOf(item);
if (auto index = m_items1D.indexOf(item); index >= 0)
return createIndex(index, 0, item);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment