Skip to content

Commit

Permalink
Clean up some compiler warnings
Browse files Browse the repository at this point in the history
C vs C++ coding style
  • Loading branch information
marcusbirkin committed Aug 15, 2018
1 parent f821fbc commit 98330cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
// The base color to generate pastel shades for sources
static const QColor mixColor = QColor("coral");

Preferences *Preferences::m_instance = NULL;
Preferences *Preferences::m_instance = Q_NULLPTR;

Preferences::Preferences()
{
RESTART_APP = false;
for(int i=0; i<PRESET_COUNT; i++)
m_presets[i] = QByteArray(MAX_DMX_ADDRESS, (char) 0);
m_presets[i] = QByteArray(MAX_DMX_ADDRESS, char(0));
loadPreferences();
}

Expand Down
12 changes: 5 additions & 7 deletions src/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :

ui->cbTheme->clear();
ui->cbTheme->addItems(Preferences::ThemeDescriptions());
ui->cbTheme->setCurrentIndex((int)Preferences::getInstance()->GetTheme());
ui->cbTheme->setCurrentIndex(static_cast<int>(Preferences::getInstance()->GetTheme()));
}

PreferencesDialog::~PreferencesDialog()
Expand All @@ -109,14 +109,12 @@ void PreferencesDialog::on_buttonBox_accepted()
Preferences *p = Preferences::getInstance();

// Display Format
int displayFormat=0;
if(ui->DecimalDisplayFormat->isChecked())
displayFormat = Preferences::DECIMAL;
p->SetDisplayFormat(Preferences::DECIMAL);
if(ui->HexDisplayFormat->isChecked())
displayFormat = Preferences::HEXADECIMAL;
p->SetDisplayFormat(Preferences::HEXADECIMAL);
if(ui->PercentDisplayFormat->isChecked())
displayFormat = Preferences::PERCENT;
p->SetDisplayFormat(displayFormat);
p->SetDisplayFormat(Preferences::PERCENT);

// Display Blind
p->SetBlindVisualizer(ui->cbDisplayBlind->isChecked());
Expand Down Expand Up @@ -161,7 +159,7 @@ void PreferencesDialog::on_buttonBox_accepted()
p->SetNetworkListenAll(ui->cbListenAll->isChecked());

// Theme
Preferences::Theme theme = (Preferences::Theme)ui->cbTheme->currentIndex();
Preferences::Theme theme = static_cast<Preferences::Theme>(ui->cbTheme->currentIndex());
if(p->GetTheme()!=theme)
{
p->SetTheme(theme);
Expand Down

0 comments on commit 98330cf

Please sign in to comment.