Modernize

master
Unknown 2019-03-25 05:18:21 +01:00
parent fd180c9590
commit 0a927fec52
5 changed files with 20 additions and 19 deletions

View File

@ -19,7 +19,7 @@ void ColorLineEdit::selectColor()
if (!current.isValid()) {
current = Qt::white;
}
const QColor color = QColorDialog::getColor(current, this, NULL, options);
const QColor color = QColorDialog::getColor(current, this, nullptr, options);
if (color.isValid()) {
this->setText(color.name());

View File

@ -119,8 +119,9 @@ void ConfigDialog::on_browseMapper_clicked()
QString ConfigSettings::getDefaultMapperExecutable()
{
QStringList locations = getMapperExecutables();
if (locations.empty()) return "";
else return locations.at(0);
if (locations.empty())
return QString();
return locations.at(0);
}
void ConfigSettings::addMapperExecutablesToList(QStringList &existingList, QStringList &pathList)

View File

@ -431,7 +431,7 @@ void MainWindow::on_button_generate_clicked()
tr("MinetestMapper will be executed using this arguments. \n"
"The arguments can be removed, modified, or new arguments can be added."),//label
arguments.join("\n"),//text
&ok,0);
&ok);
if (ok) arguments = parameters.split("\n");
else {
ui->button_generate->setDisabled(false);
@ -560,7 +560,7 @@ void MainWindow::createProfilesMenu(){
// Called every time, when a menu entry of the profile menu is called
void MainWindow::slotProfileChanged(QAction* action)
{
if(action != 0) {
if(action) {
writeProfile();
currentProfile = action->data().toString();
readProfile();
@ -889,7 +889,7 @@ void MainWindow::on_actionNew_Profile_triggered()
tr("Name of the new Profile:"),//label
QLineEdit::Normal,
"",//text
&ok,0);
&ok);
if(ok && !profile.isEmpty()) {
currentProfile = profile;
QAction *action = new QAction(profile, this);