Commit c03ed36e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use some nullptr, add parent

parent a13e4399
......@@ -74,8 +74,8 @@ BackendSelection::BackendSelection(QWidget *parent)
"To apply the backend change you will have "
"to log out and back in again."));
m_down->setIcon(QIcon::fromTheme("go-down"));
m_up->setIcon(QIcon::fromTheme("go-up"));
m_down->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
m_up->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
m_comment->setWordWrap(true);
m_emptyPage = stackedWidget->addWidget(new QWidget());
......@@ -97,7 +97,7 @@ void BackendSelection::load()
qCDebug(KCM_PHONON_LOG) << settings.fileName();
for (int i = 0; i < size; ++i) {
settings.setArrayIndex(i);
iidPreference.append(settings.value("iid").toString());
iidPreference.append(settings.value(QLatin1String("iid")).toString());
}
settings.endArray();
......@@ -115,9 +115,9 @@ void BackendSelection::load()
continue;
}
QStringList plugins(dir.entryList(QDir::Files));
const QStringList plugins(dir.entryList(QDir::Files));
foreach (const QString &plugin, plugins) {
for (const QString &plugin : plugins) {
BackendDescriptor bd = BackendDescriptor(libPath + plugin);
if (bd.isValid) {
int preference = iidPreference.indexOf(bd.iid);
......
......@@ -142,20 +142,20 @@ void DevicePreference::changeEvent(QEvent *e)
DevicePreference::DevicePreference(QWidget *parent)
: QWidget(parent),
m_headerModel(0, 1, 0),
m_media(NULL), m_audioOutput(NULL), m_videoWidget(NULL)
m_media(nullptr), m_audioOutput(nullptr), m_videoWidget(nullptr)
{
setupUi(this);
// Setup the buttons
testPlaybackButton->setIcon(QIcon::fromTheme("media-playback-start"));
testPlaybackButton->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
testPlaybackButton->setEnabled(false);
testPlaybackButton->setToolTip(i18n("Test the selected device"));
deferButton->setIcon(QIcon::fromTheme("go-down"));
preferButton->setIcon(QIcon::fromTheme("go-up"));
deferButton->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
preferButton->setIcon(QIcon::fromTheme(QStringLiteral("go-up")));
// Configure the device list
deviceList->setDragDropMode(QAbstractItemView::InternalMove);
deviceList->setStyleSheet(QString("QTreeView {"
deviceList->setStyleSheet(QStringLiteral("QTreeView {"
"background-color: palette(base);"
"background-image: url(%1);"
"background-position: bottom left;"
......@@ -333,7 +333,7 @@ void DevicePreference::updateDeviceList()
} else {
// No valid category selected
m_headerModel.setHeaderData(0, Qt::Horizontal, QString(), Qt::DisplayRole);
deviceList->setModel(0);
deviceList->setModel(nullptr);
}
// Update the header, the buttons enabled state
......@@ -759,7 +759,7 @@ void DevicePreference::on_applyPreferencesButton_clicked()
Category cat = cap ? NoCategory : categoryList[catIndex];
CaptureCategory capcat = cap ? capCategoryList[catIndex] : NoCaptureCategory;
QListWidgetItem *item = NULL;
QListWidgetItem *item = nullptr;
if (cap) {
if (capcat == NoCaptureCategory) {
item = new QListWidgetItem(i18n("Default/Unspecified Category"), list, capcat);
......@@ -781,7 +781,7 @@ void DevicePreference::on_applyPreferencesButton_clicked()
}
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
| QDialogButtonBox::Cancel, dialog);
connect(buttonBox, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject);
......@@ -849,11 +849,11 @@ void DevicePreference::on_testPlaybackButton_toggled(bool down)
// Shouldn't happen, but better to be on the safe side
if (m_testingType != dtInvalidDevice) {
delete m_media;
m_media = NULL;
m_media = nullptr;
delete m_audioOutput;
m_audioOutput = NULL;
m_audioOutput = nullptr;
delete m_videoWidget;
m_videoWidget = NULL;
m_videoWidget = nullptr;
}
// Setup the Phonon objects according to the testing type
......
......@@ -59,7 +59,7 @@ void TestSpeakerWidget::onToggle(bool state)
if (s_CurrentWidget) {
if (this != s_CurrentWidget && state)
s_CurrentWidget->setChecked(false);
s_CurrentWidget = NULL;
s_CurrentWidget = nullptr;
}
if (!state)
return;
......@@ -95,7 +95,7 @@ void TestSpeakerWidget::onToggle(bool state)
}
}
ca_context_change_device(m_Canberra, NULL);
ca_context_change_device(m_Canberra, nullptr);
ca_proplist_destroy(proplist);
}
......@@ -104,7 +104,7 @@ void TestSpeakerWidget::onFinish()
if (s_CurrentWidget && s_CurrentWidget->isChecked()) {
s_CurrentIndex = PA_INVALID_INDEX;
s_CurrentWidget->setChecked(false);
s_CurrentWidget = NULL;
s_CurrentWidget = nullptr;
}
}
......@@ -198,6 +198,6 @@ const char* TestSpeakerWidget::_positionSoundName()
default:
break;
}
return NULL;
return nullptr;
}
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