Clazy and style

This commit is contained in:
Hannah von Reth 2015-11-28 13:31:26 +01:00
parent 10a18f8239
commit d0682ecf93
17 changed files with 84 additions and 83 deletions

View File

@ -37,7 +37,6 @@ Q_LOGGING_CATEGORY(SNORE, "libsnorenotify", QtWarningMsg)
Q_LOGGING_CATEGORY(SNORE, "libsnorenotify")
#endif
SnoreCorePrivate::SnoreCorePrivate():
m_localSettingsPrefix(qApp->applicationName().isEmpty() ? QStringLiteral("SnoreNotify") : qApp->applicationName())
{

View File

@ -41,7 +41,7 @@ PluginSettingsWidget *Sound::settingsWidget()
void Sound::setDefaultSettings()
{
setDefaultSettingsValue(QLatin1String("Volume"), 50);
setDefaultSettingsValue(QStringLiteral("Volume"), 50);
SnoreSecondaryBackend::setDefaultSettings();
}
@ -50,11 +50,11 @@ void Sound::slotNotificationDisplayed(Snore::Notification notification)
if (notification.hints().value("silent").toBool()) {
return;
}
m_player->setVolume(settingsValue(QLatin1String("Volume")).toInt());
m_player->setVolume(settingsValue(QStringLiteral("Volume")).toInt());
QString sound = notification.hints().value("sound").toString();
if (sound.isEmpty()) {
sound = settingsValue(QLatin1String("Sound")).toString();
sound = settingsValue(QStringLiteral("Sound")).toString();
}
qCDebug(SNORE) << "SoundFile:" << sound;
if (!sound.isEmpty()) {

View File

@ -40,8 +40,10 @@ SoundSettings::SoundSettings(SnorePlugin *snorePlugin, QWidget *parent) :
dialog.setNameFilter(tr("All Audio files").append(QLatin1String("(*.mp3 *.wav *.ogg)")));
dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setDirectory(m_lineEditFileName->text());
dialog.set
if (dialog.exec()) {
m_lineEditFileName->setText(dialog.selectedFiles().first());
QStringList files = dialog.selectedFiles();
m_lineEditFileName->setText(files.first());
}
});
addRow(QString(), button);
@ -53,13 +55,13 @@ SoundSettings::~SoundSettings()
void SoundSettings::load()
{
m_lineEditFileName->setText(settingsValue(QLatin1String("Sound")).toString());
m_spinBoxVolume->setValue(settingsValue(QLatin1String("Volume")).toInt());
m_lineEditFileName->setText(settingsValue(QStringLiteral("Sound")).toString());
m_spinBoxVolume->setValue(settingsValue(QStringLiteral("Volume")).toInt());
}
void SoundSettings::save()
{
setSettingsValue(QLatin1String("Sound"), m_lineEditFileName->text());
setSettingsValue(QLatin1String("Volume"), m_spinBoxVolume->value());
setSettingsValue(QStringLiteral("Sound"), m_lineEditFileName->text());
setSettingsValue(QStringLiteral("Volume"), m_spinBoxVolume->value());
}