PreferencesChanged -> settingsChanged.

We used both preferencesChanged and settingsChanged in different
methods and classes to mean the same thing, this adds consistency.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-05-21 13:50:26 -03:00 committed by Dirk Hohndel
parent 3c7a6ab750
commit 6aab69b298
5 changed files with 24 additions and 24 deletions

View file

@ -411,17 +411,17 @@ QString TemperatureAxis::textForValue(double value)
PartialGasPressureAxis::PartialGasPressureAxis()
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(preferencesChanged()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
}
void PartialGasPressureAxis::setModel(DivePlotDataModel *m)
{
model = m;
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(preferencesChanged()));
preferencesChanged();
connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(settingsChanged()));
settingsChanged();
}
void PartialGasPressureAxis::preferencesChanged()
void PartialGasPressureAxis::settingsChanged()
{
bool showPhe = prefs.pp_graphs.phe;
bool showPn2 = prefs.pp_graphs.pn2;

View file

@ -110,7 +110,7 @@ public:
void setModel(DivePlotDataModel *model);
public
slots:
void preferencesChanged();
void settingsChanged();
private:
DivePlotDataModel *model;

View file

@ -18,10 +18,10 @@
AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1)
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(preferencesChanged()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
}
void AbstractProfilePolygonItem::preferencesChanged()
void AbstractProfilePolygonItem::settingsChanged()
{
}
@ -192,7 +192,7 @@ void DiveProfileItem::modelDataChanged(const QModelIndex &topLeft, const QModelI
}
}
void DiveProfileItem::preferencesChanged()
void DiveProfileItem::settingsChanged()
{
//TODO: Only modelDataChanged() here if we need to rebuild the graph ( for instance,
// if the prefs.dcceiling are enabled, but prefs.redceiling is disabled
@ -296,7 +296,7 @@ void DiveHeartrateItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
painter->drawPolyline(polygon());
}
void DiveHeartrateItem::preferencesChanged()
void DiveHeartrateItem::settingsChanged()
{
QSettings s;
s.beginGroup("TecDetails");
@ -503,7 +503,7 @@ DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientF
gradientFactor->setY(0);
gradientFactor->setBrush(getColor(PRESSURE_TEXT));
gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
preferencesChanged();
settingsChanged();
}
void DiveCalculatedCeiling::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@ -542,10 +542,10 @@ void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsI
DiveCalculatedTissue::DiveCalculatedTissue()
{
preferencesChanged();
settingsChanged();
}
void DiveCalculatedTissue::preferencesChanged()
void DiveCalculatedTissue::settingsChanged()
{
setVisible(prefs.calcalltissues && prefs.calcceiling);
}
@ -579,7 +579,7 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
setBrush(pat);
}
void DiveCalculatedCeiling::preferencesChanged()
void DiveCalculatedCeiling::settingsChanged()
{
if (dataModel && is3mIncrement != prefs.calcceiling3m) {
// recalculate that part.
@ -589,7 +589,7 @@ void DiveCalculatedCeiling::preferencesChanged()
setVisible(prefs.calcceiling);
}
void DiveReportedCeiling::preferencesChanged()
void DiveReportedCeiling::settingsChanged()
{
setVisible(prefs.dcceiling);
}
@ -696,7 +696,7 @@ PartialPressureGasItem::PartialPressureGasItem()
{
}
void PartialPressureGasItem::preferencesChanged()
void PartialPressureGasItem::settingsChanged()
{
QSettings s;
s.beginGroup("TecDetails");

View file

@ -46,7 +46,7 @@ public:
}
public
slots:
virtual void preferencesChanged();
virtual void settingsChanged();
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void modelDataRemoved(const QModelIndex &parent, int from, int to);
@ -75,7 +75,7 @@ public:
DiveProfileItem();
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void preferencesChanged();
virtual void settingsChanged();
void plot_depth_sample(struct plot_data *entry, QFlags<Qt::AlignmentFlag> flags, const QColor &color);
private:
@ -100,7 +100,7 @@ public:
DiveHeartrateItem();
virtual void modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual void preferencesChanged();
virtual void settingsChanged();
void setVisibilitySettingsKey(const QString &setVisibilitySettingsKey);
bool isVisible();
@ -130,7 +130,7 @@ public:
DiveCalculatedCeiling();
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual void preferencesChanged();
virtual void settingsChanged();
private:
bool is3mIncrement;
@ -143,14 +143,14 @@ class DiveReportedCeiling : public AbstractProfilePolygonItem {
public:
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual void preferencesChanged();
virtual void settingsChanged();
};
class DiveCalculatedTissue : public DiveCalculatedCeiling {
Q_OBJECT
public:
DiveCalculatedTissue();
virtual void preferencesChanged();
virtual void settingsChanged();
};
class MeanDepthLine : public DiveLineItem {
@ -176,7 +176,7 @@ public:
PartialPressureGasItem();
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
virtual void preferencesChanged();
virtual void settingsChanged();
void setThreshouldSettingsKey(const QString &threshouldSettingsKey);
void setVisibilitySettingsKey(const QString &setVisibilitySettingsKey);
void setColors(const QColor &normalColor, const QColor &alertColor);

View file

@ -203,7 +203,7 @@ void ProfileWidget2::setupItemOnScene()
setupItem(temperatureItem, timeAxis, temperatureAxis, dataModel, DivePlotDataModel::TEMPERATURE, DivePlotDataModel::TIME, 1);
setupItem(heartBeatItem, timeAxis, heartBeatAxis, dataModel, DivePlotDataModel::HEARTBEAT, DivePlotDataModel::TIME, 1);
heartBeatItem->setVisibilitySettingsKey("hrgraph");
heartBeatItem->preferencesChanged();
heartBeatItem->settingsChanged();
setupItem(diveProfileItem, timeAxis, profileYAxis, dataModel, DivePlotDataModel::DEPTH, DivePlotDataModel::TIME, 0);
#define CREATE_PP_GAS(ITEM, VERTICAL_COLUMN, COLOR, COLOR_ALERT, THRESHOULD_SETTINGS, VISIBILITY_SETTINGS) \
@ -211,7 +211,7 @@ void ProfileWidget2::setupItemOnScene()
ITEM->setThreshouldSettingsKey(THRESHOULD_SETTINGS); \
ITEM->setVisibilitySettingsKey(VISIBILITY_SETTINGS); \
ITEM->setColors(getColor(COLOR, isGrayscale), getColor(COLOR_ALERT, isGrayscale)); \
ITEM->preferencesChanged(); \
ITEM->settingsChanged(); \
ITEM->setZValue(99);
CREATE_PP_GAS(pn2GasItem, PN2, PN2, PN2_ALERT, "pn2threshold", "pn2graph");