Commit 2b586e6f authored by Kurt Hindenburg's avatar Kurt Hindenburg

use auto

parent 5e28796d
...@@ -141,7 +141,7 @@ MainWindow* Application::newMainWindow() ...@@ -141,7 +141,7 @@ MainWindow* Application::newMainWindow()
{ {
WindowSystemInfo::HAVE_TRANSPARENCY = !m_parser->isSet(QStringLiteral("notransparency")); WindowSystemInfo::HAVE_TRANSPARENCY = !m_parser->isSet(QStringLiteral("notransparency"));
MainWindow* window = new MainWindow(); auto window = new MainWindow();
connect(window, &Konsole::MainWindow::newWindowRequest, this, &Konsole::Application::createWindow); connect(window, &Konsole::MainWindow::newWindowRequest, this, &Konsole::Application::createWindow);
connect(window, &Konsole::MainWindow::viewDetached, this, &Konsole::Application::detachView); connect(window, &Konsole::MainWindow::viewDetached, this, &Konsole::Application::detachView);
...@@ -565,7 +565,7 @@ void Application::slotActivateRequested (QStringList args, const QString & /*wor ...@@ -565,7 +565,7 @@ void Application::slotActivateRequested (QStringList args, const QString & /*wor
m_customCommand = getCustomCommand(args); m_customCommand = getCustomCommand(args);
// We can't re-use QCommandLineParser instances, it preserves earlier parsed values // We can't re-use QCommandLineParser instances, it preserves earlier parsed values
QCommandLineParser *parser = new QCommandLineParser; auto parser = new QCommandLineParser;
populateCommandLineParser(parser); populateCommandLineParser(parser);
parser->parse(args); parser->parse(args);
m_parser.reset(parser); m_parser.reset(parser);
......
...@@ -60,9 +60,9 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) ...@@ -60,9 +60,9 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
, _isNewScheme(false) , _isNewScheme(false)
, _colors(0) , _colors(0)
{ {
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply);
QWidget *mainWidget = new QWidget(this); auto mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);
mainLayout->addWidget(mainWidget); mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
...@@ -92,10 +92,10 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) ...@@ -92,10 +92,10 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this , &Konsole::ColorSchemeEditor::setRandomizedBackgroundColor); connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this , &Konsole::ColorSchemeEditor::setRandomizedBackgroundColor);
// wallpaper stuff // wallpaper stuff
QFileSystemModel *dirModel = new QFileSystemModel(this); auto dirModel = new QFileSystemModel(this);
dirModel->setFilter(QDir::AllEntries); dirModel->setFilter(QDir::AllEntries);
dirModel->setRootPath(QString('/')); dirModel->setRootPath(QString('/'));
QCompleter *completer = new QCompleter(this); auto completer = new QCompleter(this);
completer->setModel(dirModel); completer->setModel(dirModel);
_ui->wallpaperPath->setCompleter(completer); _ui->wallpaperPath->setCompleter(completer);
...@@ -267,17 +267,17 @@ void ColorSchemeEditor::setupColorTable(const ColorScheme* colors) ...@@ -267,17 +267,17 @@ void ColorSchemeEditor::setupColorTable(const ColorScheme* colors)
QTableWidgetItem* nameItem = new QTableWidgetItem(ColorScheme::translatedColorNameForIndex(row)); QTableWidgetItem* nameItem = new QTableWidgetItem(ColorScheme::translatedColorNameForIndex(row));
nameItem->setFlags(nameItem->flags() & ~Qt::ItemIsEditable); nameItem->setFlags(nameItem->flags() & ~Qt::ItemIsEditable);
QTableWidgetItem* colorItem = new QTableWidgetItem(); auto colorItem = new QTableWidgetItem();
colorItem->setBackground(table[row].color); colorItem->setBackground(table[row].color);
colorItem->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable); colorItem->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable);
colorItem->setToolTip(i18nc("@info:tooltip", "Click to choose color")); colorItem->setToolTip(i18nc("@info:tooltip", "Click to choose color"));
QTableWidgetItem* colorItemIntense = new QTableWidgetItem(); auto colorItemIntense = new QTableWidgetItem();
colorItemIntense->setBackground(table[COLOR_TABLE_ROW_LENGTH + row].color); colorItemIntense->setBackground(table[COLOR_TABLE_ROW_LENGTH + row].color);
colorItemIntense->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable); colorItemIntense->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable);
colorItemIntense->setToolTip(i18nc("@info:tooltip", "Click to choose intense color")); colorItemIntense->setToolTip(i18nc("@info:tooltip", "Click to choose intense color"));
QTableWidgetItem* colorItemFaint = new QTableWidgetItem(); auto colorItemFaint = new QTableWidgetItem();
colorItemFaint->setBackground(table[2*COLOR_TABLE_ROW_LENGTH + row].color); colorItemFaint->setBackground(table[2*COLOR_TABLE_ROW_LENGTH + row].color);
colorItemFaint->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable); colorItemFaint->setFlags(colorItem->flags() & ~Qt::ItemIsEditable & ~Qt::ItemIsSelectable);
colorItemFaint->setToolTip(i18nc("@info:tooltip", "Click to choose Faint color")); colorItemFaint->setToolTip(i18nc("@info:tooltip", "Click to choose Faint color"));
......
...@@ -87,7 +87,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) ...@@ -87,7 +87,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
QFileInfo info(filePath); QFileInfo info(filePath);
KConfig config(filePath , KConfig::NoGlobals); KConfig config(filePath , KConfig::NoGlobals);
ColorScheme* scheme = new ColorScheme(); auto scheme = new ColorScheme();
scheme->setName(info.baseName()); scheme->setName(info.baseName());
scheme->read(config); scheme->read(config);
......
...@@ -37,9 +37,9 @@ CopyInputDialog::CopyInputDialog(QWidget* parent) ...@@ -37,9 +37,9 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
: QDialog(parent) : QDialog(parent)
{ {
setWindowTitle(i18n("Copy Input")); setWindowTitle(i18n("Copy Input"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this); auto mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);
mainLayout->addWidget(mainWidget); mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
...@@ -64,7 +64,7 @@ CopyInputDialog::CopyInputDialog(QWidget* parent) ...@@ -64,7 +64,7 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
_model->setCheckColumn(1); _model->setCheckColumn(1);
_model->setSessions(SessionManager::instance()->sessions()); _model->setSessions(SessionManager::instance()->sessions());
QSortFilterProxyModel* filterProxyModel = new QSortFilterProxyModel(this); auto filterProxyModel = new QSortFilterProxyModel(this);
filterProxyModel->setDynamicSortFilter(true); filterProxyModel->setDynamicSortFilter(true);
filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
filterProxyModel->setSourceModel(_model); filterProxyModel->setSourceModel(_model);
......
...@@ -68,8 +68,8 @@ EditProfileDialog::EditProfileDialog(QWidget* aParent) ...@@ -68,8 +68,8 @@ EditProfileDialog::EditProfileDialog(QWidget* aParent)
{ {
setWindowTitle(i18n("Edit Profile")); setWindowTitle(i18n("Edit Profile"));
mButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply); mButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Apply);
QWidget *mainWidget = new QWidget(this); auto mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);
mainLayout->addWidget(mainWidget); mainLayout->addWidget(mainWidget);
QPushButton *okButton = mButtonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = mButtonBox->button(QDialogButtonBox::Ok);
...@@ -398,7 +398,7 @@ void EditProfileDialog::selectInitialDir() ...@@ -398,7 +398,7 @@ void EditProfileDialog::selectInitialDir()
} }
void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile) void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
{ {
ColorSchemeViewDelegate* delegate = new ColorSchemeViewDelegate(this); auto delegate = new ColorSchemeViewDelegate(this);
_ui->colorSchemeList->setItemDelegate(delegate); _ui->colorSchemeList->setItemDelegate(delegate);
_ui->transparencyWarningWidget->setVisible(false); _ui->transparencyWarningWidget->setVisible(false);
...@@ -716,7 +716,7 @@ void EditProfileDialog::editColorScheme() ...@@ -716,7 +716,7 @@ void EditProfileDialog::editColorScheme()
} }
void EditProfileDialog::saveColorScheme(const ColorScheme& scheme, bool isNewScheme) void EditProfileDialog::saveColorScheme(const ColorScheme& scheme, bool isNewScheme)
{ {
ColorScheme* newScheme = new ColorScheme(scheme); auto newScheme = new ColorScheme(scheme);
// if this is a new color scheme, pick a name based on the description // if this is a new color scheme, pick a name based on the description
if (isNewScheme) { if (isNewScheme) {
...@@ -873,7 +873,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator) ...@@ -873,7 +873,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
Q_ASSERT(translator); Q_ASSERT(translator);
QPointer<QDialog> dialog = new QDialog(this); QPointer<QDialog> dialog = new QDialog(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); auto buttonBox = new QDialogButtonBox(dialog);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept); connect(buttonBox, &QDialogButtonBox::accepted, dialog.data(), &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, dialog.data(), &QDialog::reject);
...@@ -883,7 +883,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator) ...@@ -883,7 +883,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
else else
dialog->setWindowTitle(i18n("Edit Key Binding List")); dialog->setWindowTitle(i18n("Edit Key Binding List"));
KeyBindingEditor* editor = new KeyBindingEditor; auto editor = new KeyBindingEditor;
if (translator) if (translator)
editor->setup(translator); editor->setup(translator);
...@@ -891,13 +891,13 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator) ...@@ -891,13 +891,13 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
if (isNewTranslator) if (isNewTranslator)
editor->setDescription(i18n("New Key Binding List")); editor->setDescription(i18n("New Key Binding List"));
QVBoxLayout *layout = new QVBoxLayout; auto layout = new QVBoxLayout;
layout->addWidget(editor); layout->addWidget(editor);
layout->addWidget(buttonBox); layout->addWidget(buttonBox);
dialog->setLayout(layout); dialog->setLayout(layout);
if (dialog->exec() == QDialog::Accepted) { if (dialog->exec() == QDialog::Accepted) {
KeyboardTranslator* newTranslator = new KeyboardTranslator(*editor->translator()); auto newTranslator = new KeyboardTranslator(*editor->translator());
if (isNewTranslator) if (isNewTranslator)
newTranslator->setName(newTranslator->description()); newTranslator->setName(newTranslator->description());
...@@ -1129,7 +1129,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile) ...@@ -1129,7 +1129,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
connect(_ui->cursorShapeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this, &Konsole::EditProfileDialog::setCursorShape); connect(_ui->cursorShapeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this, &Konsole::EditProfileDialog::setCursorShape);
// encoding options // encoding options
KCodecAction* codecAction = new KCodecAction(this); auto codecAction = new KCodecAction(this);
_ui->selectEncodingButton->setMenu(codecAction->menu()); _ui->selectEncodingButton->setMenu(codecAction->menu());
connect(codecAction, static_cast<void(KCodecAction::*)(QTextCodec*)>(&KCodecAction::triggered), this, &Konsole::EditProfileDialog::setDefaultCodec); connect(codecAction, static_cast<void(KCodecAction::*)(QTextCodec*)>(&KCodecAction::triggered), this, &Konsole::EditProfileDialog::setDefaultCodec);
......
...@@ -77,7 +77,7 @@ void Emulation::bracketedPasteModeChanged(bool bracketedPasteMode) ...@@ -77,7 +77,7 @@ void Emulation::bracketedPasteModeChanged(bool bracketedPasteMode)
ScreenWindow* Emulation::createWindow() ScreenWindow* Emulation::createWindow()
{ {
ScreenWindow* window = new ScreenWindow(_currentScreen); auto window = new ScreenWindow(_currentScreen);
_windows << window; _windows << window;
connect(window , &Konsole::ScreenWindow::selectionChanged, this , &Konsole::Emulation::bufferedUpdate); connect(window , &Konsole::ScreenWindow::selectionChanged, this , &Konsole::Emulation::bufferedUpdate);
......
...@@ -100,7 +100,7 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor ...@@ -100,7 +100,7 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor
// add the new sequence to the table and // add the new sequence to the table and
// return that index // return that index
ushort* buffer = new ushort[length + 1]; auto buffer = new ushort[length + 1];
buffer[0] = length; buffer[0] = length;
for (int i = 0 ; i < length ; i++) for (int i = 0 ; i < length ; i++)
buffer[i + 1] = unicodePoints[i]; buffer[i + 1] = unicodePoints[i];
......
...@@ -133,8 +133,8 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines ...@@ -133,8 +133,8 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines
decoder.setTrailingWhitespace(false); decoder.setTrailingWhitespace(false);
// setup new shared buffers for the filters to process on // setup new shared buffers for the filters to process on
QString* newBuffer = new QString(); auto newBuffer = new QString();
QList<int>* newLinePositions = new QList<int>(); auto newLinePositions = new QList<int>();
setBuffer(newBuffer , newLinePositions); setBuffer(newBuffer , newLinePositions);
// free the old buffers // free the old buffers
...@@ -458,8 +458,8 @@ void FilterObject::activated() ...@@ -458,8 +458,8 @@ void FilterObject::activated()
} }
QList<QAction*> UrlFilter::HotSpot::actions() QList<QAction*> UrlFilter::HotSpot::actions()
{ {
QAction* openAction = new QAction(_urlObject); auto openAction = new QAction(_urlObject);
QAction* copyAction = new QAction(_urlObject); auto copyAction = new QAction(_urlObject);
const UrlType kind = urlType(); const UrlType kind = urlType();
Q_ASSERT(kind == StandardUrl || kind == Email); Q_ASSERT(kind == StandardUrl || kind == Email);
...@@ -553,7 +553,7 @@ FileFilter::HotSpot::~HotSpot() ...@@ -553,7 +553,7 @@ FileFilter::HotSpot::~HotSpot()
QList<QAction*> FileFilter::HotSpot::actions() QList<QAction*> FileFilter::HotSpot::actions()
{ {
QAction* openAction = new QAction(_fileObject); auto openAction = new QAction(_fileObject);
openAction->setText(i18n("Open File")); openAction->setText(i18n("Open File"));
QObject::connect(openAction , SIGNAL(triggered()) , _fileObject , SLOT(activated())); QObject::connect(openAction , SIGNAL(triggered()) , _fileObject , SLOT(activated()));
QList<QAction*> actions; QList<QAction*> actions;
......
...@@ -626,7 +626,7 @@ HistoryScroll* HistoryTypeFile::scroll(HistoryScroll* old) const ...@@ -626,7 +626,7 @@ HistoryScroll* HistoryTypeFile::scroll(HistoryScroll* old) const
for (int i = 0; i < lines; i++) { for (int i = 0; i < lines; i++) {
int size = old->getLineLen(i); int size = old->getLineLen(i);
if (size > LINE_SIZE) { if (size > LINE_SIZE) {
Character* tmp_line = new Character[size]; auto tmp_line = new Character[size];
old->getCells(i, 0, size, tmp_line); old->getCells(i, 0, size, tmp_line);
newScroll->addCells(tmp_line, size); newScroll->addCells(tmp_line, size);
newScroll->addLine(old->isWrappedLine(i)); newScroll->addLine(old->isWrappedLine(i));
......
...@@ -36,9 +36,9 @@ HistorySizeDialog::HistorySizeDialog(QWidget* parent) ...@@ -36,9 +36,9 @@ HistorySizeDialog::HistorySizeDialog(QWidget* parent)
: QDialog(parent) : QDialog(parent)
{ {
setWindowTitle(i18nc("@title:window", "Adjust Scrollback")); setWindowTitle(i18nc("@title:window", "Adjust Scrollback"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this); auto mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);
mainLayout->addWidget(mainWidget); mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......
...@@ -62,7 +62,7 @@ HistorySizeWidget::HistorySizeWidget(QWidget* parent) ...@@ -62,7 +62,7 @@ HistorySizeWidget::HistorySizeWidget(QWidget* parent)
_ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner); _ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KPluralHandlingSpinBox::selectAll); connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KPluralHandlingSpinBox::selectAll);
QButtonGroup* modeGroup = new QButtonGroup(this); auto modeGroup = new QButtonGroup(this);
modeGroup->addButton(_ui->noHistoryButton); modeGroup->addButton(_ui->noHistoryButton);
modeGroup->addButton(_ui->fixedSizeHistoryButton); modeGroup->addButton(_ui->fixedSizeHistoryButton);
modeGroup->addButton(_ui->unlimitedHistoryButton); modeGroup->addButton(_ui->unlimitedHistoryButton);
......
...@@ -47,9 +47,9 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent) ...@@ -47,9 +47,9 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
, _findPreviousButton(0) , _findPreviousButton(0)
, _searchFromButton(0) , _searchFromButton(0)
{ {
QHBoxLayout* barLayout = new QHBoxLayout(this); auto barLayout = new QHBoxLayout(this);
QToolButton* closeButton = new QToolButton(this); auto closeButton = new QToolButton(this);
closeButton->setObjectName(QStringLiteral("close-button")); closeButton->setObjectName(QStringLiteral("close-button"));
closeButton->setToolTip(i18nc("@info:tooltip", "Close the search bar")); closeButton->setToolTip(i18nc("@info:tooltip", "Close the search bar"));
closeButton->setAutoRaise(true); closeButton->setAutoRaise(true);
...@@ -96,7 +96,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent) ...@@ -96,7 +96,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
_searchFromButton->setObjectName(QStringLiteral("search-from-button")); _searchFromButton->setObjectName(QStringLiteral("search-from-button"));
connect(_searchFromButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::searchFromClicked); connect(_searchFromButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::searchFromClicked);
QToolButton* optionsButton = new QToolButton(this); auto optionsButton = new QToolButton(this);
optionsButton->setObjectName(QStringLiteral("find-options-button")); optionsButton->setObjectName(QStringLiteral("find-options-button"));
optionsButton->setText(i18nc("@action:button Display options menu", "Options")); optionsButton->setText(i18nc("@action:button Display options menu", "Options"));
optionsButton->setCheckable(false); optionsButton->setCheckable(false);
...@@ -114,7 +114,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent) ...@@ -114,7 +114,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
barLayout->addWidget(optionsButton); barLayout->addWidget(optionsButton);
// Fill the options menu // Fill the options menu
QMenu* optionsMenu = new QMenu(this); auto optionsMenu = new QMenu(this);
optionsButton->setMenu(optionsMenu); optionsButton->setMenu(optionsMenu);
_caseSensitive = optionsMenu->addAction(i18nc("@item:inmenu", "Case sensitive")); _caseSensitive = optionsMenu->addAction(i18nc("@item:inmenu", "Case sensitive"));
......
...@@ -168,7 +168,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam ...@@ -168,7 +168,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam
KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(QIODevice* source, const QString& name) KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(QIODevice* source, const QString& name)
{ {
KeyboardTranslator* translator = new KeyboardTranslator(name); auto translator = new KeyboardTranslator(name);
KeyboardTranslatorReader reader(source); KeyboardTranslatorReader reader(source);
translator->setDescription(reader.description()); translator->setDescription(reader.description());
while (reader.hasNextEntry()) while (reader.hasNextEntry())
......
...@@ -686,22 +686,22 @@ void MainWindow::showSettingsDialog(const bool showProfilePage) ...@@ -686,22 +686,22 @@ void MainWindow::showSettingsDialog(const bool showProfilePage)
KConfigDialog* settingsDialog = new KConfigDialog(this, QStringLiteral("settings"), KonsoleSettings::self()); KConfigDialog* settingsDialog = new KConfigDialog(this, QStringLiteral("settings"), KonsoleSettings::self());
settingsDialog->setFaceType(KPageDialog::Tabbed); settingsDialog->setFaceType(KPageDialog::Tabbed);
GeneralSettings* generalSettings = new GeneralSettings(settingsDialog); auto generalSettings = new GeneralSettings(settingsDialog);
settingsDialog->addPage(generalSettings, settingsDialog->addPage(generalSettings,
i18nc("@title Preferences page name", "General"), i18nc("@title Preferences page name", "General"),
QStringLiteral("utilities-terminal")); QStringLiteral("utilities-terminal"));
ProfileSettings* profileSettings = new ProfileSettings(settingsDialog); auto profileSettings = new ProfileSettings(settingsDialog);
KPageWidgetItem* profilePage = settingsDialog->addPage(profileSettings, KPageWidgetItem* profilePage = settingsDialog->addPage(profileSettings,
i18nc("@title Preferences page name", "Profiles"), i18nc("@title Preferences page name", "Profiles"),
QStringLiteral("configure")); QStringLiteral("configure"));
TabBarSettings* tabBarSettings = new TabBarSettings(settingsDialog); auto tabBarSettings = new TabBarSettings(settingsDialog);
settingsDialog->addPage(tabBarSettings, settingsDialog->addPage(tabBarSettings,
i18nc("@title Preferences page name", "TabBar"), i18nc("@title Preferences page name", "TabBar"),
QStringLiteral("system-run")); QStringLiteral("system-run"));
FileLocationSettings* fileLocationSettings = new FileLocationSettings(settingsDialog); auto fileLocationSettings = new FileLocationSettings(settingsDialog);
settingsDialog->addPage(fileLocationSettings, settingsDialog->addPage(fileLocationSettings,
i18nc("@title Preferences page name", "File Location"), i18nc("@title Preferences page name", "File Location"),
QStringLiteral("configure")); QStringLiteral("configure"));
...@@ -808,8 +808,8 @@ void MainWindow::activateMenuBar() ...@@ -808,8 +808,8 @@ void MainWindow::activateMenuBar()
void MainWindow::setupMainWidget() void MainWindow::setupMainWidget()
{ {
QWidget* mainWindowWidget = new QWidget(this); auto mainWindowWidget = new QWidget(this);
QVBoxLayout* mainWindowLayout = new QVBoxLayout(); auto mainWindowLayout = new QVBoxLayout();
mainWindowLayout->addWidget(_viewManager->widget()); mainWindowLayout->addWidget(_viewManager->widget());
mainWindowLayout->setContentsMargins(0, 0, 0, 0); mainWindowLayout->setContentsMargins(0, 0, 0, 0);
......
...@@ -268,7 +268,7 @@ void Part::showEditCurrentProfileDialog(QWidget* parent) ...@@ -268,7 +268,7 @@ void Part::showEditCurrentProfileDialog(QWidget* parent)
{ {
Q_ASSERT(activeSession()); Q_ASSERT(activeSession());
EditProfileDialog* dialog = new EditProfileDialog(parent); auto dialog = new EditProfileDialog(parent);
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->setProfile(SessionManager::instance()->sessionProfile(activeSession())); dialog->setProfile(SessionManager::instance()->sessionProfile(activeSession()));
dialog->show(); dialog->show();
......
...@@ -127,7 +127,7 @@ void ProfileList::favoriteChanged(Profile::Ptr profile, bool isFavorite) ...@@ -127,7 +127,7 @@ void ProfileList::favoriteChanged(Profile::Ptr profile, bool isFavorite)
ProfileManager* manager = ProfileManager::instance(); ProfileManager* manager = ProfileManager::instance();
if (isFavorite) { if (isFavorite) {
QAction* action = new QAction(_group); auto action = new QAction(_group);
action->setData(QVariant::fromValue(profile)); action->setData(QVariant::fromValue(profile));
if (_addShortcuts) { if (_addShortcuts) {
......
...@@ -35,9 +35,9 @@ RenameTabDialog::RenameTabDialog(QWidget* parent) ...@@ -35,9 +35,9 @@ RenameTabDialog::RenameTabDialog(QWidget* parent)
: QDialog(parent) : QDialog(parent)
{ {
setWindowTitle(i18n("Rename Tab")); setWindowTitle(i18n("Rename Tab"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this); auto mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout; auto mainLayout = new QVBoxLayout;
setLayout(mainLayout); setLayout(mainLayout);
mainLayout->addWidget(mainWidget); mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......
...@@ -306,7 +306,7 @@ void Screen::resizeImage(int new_lines, int new_columns) ...@@ -306,7 +306,7 @@ void Screen::resizeImage(int new_lines, int new_columns)
// create new screen _lines and copy from old to new // create new screen _lines and copy from old to new
ImageLine* newScreenLines = new ImageLine[new_lines + 1]; auto newScreenLines = new ImageLine[new_lines + 1];
for (int i = 0; i < qMin(_lines, new_lines + 1) ; i++) for (int i = 0; i < qMin(_lines, new_lines + 1) ; i++)
newScreenLines[i] = _screenLines[i]; newScreenLines[i] = _screenLines[i];
for (int i = _lines; (i > 0) && (i < new_lines + 1); i++) for (int i = _lines; (i > 0) && (i < new_lines + 1); i++)
...@@ -662,7 +662,7 @@ void Screen::displayCharacter(unsigned short c) ...@@ -662,7 +662,7 @@ void Screen::displayCharacter(unsigned short c)
if (oldChars && extendedCharLength < 3) { if (oldChars && extendedCharLength < 3) {
Q_ASSERT(extendedCharLength > 1); Q_ASSERT(extendedCharLength > 1);
Q_ASSERT(extendedCharLength < 65535); Q_ASSERT(extendedCharLength < 65535);
ushort* chars = new ushort[extendedCharLength + 1]; auto chars = new ushort[extendedCharLength + 1];
memcpy(chars, oldChars, sizeof(ushort) * extendedCharLength); memcpy(chars, oldChars, sizeof(ushort) * extendedCharLength);
chars[extendedCharLength] = c; chars[extendedCharLength] = c;
currentChar.character = ExtendedCharTable::instance.createExtendedChar(chars, extendedCharLength + 1); currentChar.character = ExtendedCharTable::instance.createExtendedChar(chars, extendedCharLength + 1);
......
...@@ -194,7 +194,7 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q ...@@ -194,7 +194,7 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q
connect(_view.data(), &Konsole::TerminalDisplay::keyPressedSignal, this, &Konsole::SessionController::interactionHandler); connect(_view.data(), &Konsole::TerminalDisplay::keyPressedSignal, this, &Konsole::SessionController::interactionHandler);
// take a snapshot of the session state periodically in the background // take a snapshot of the session state periodically in the background
QTimer* backgroundTimer = new QTimer(_session); auto backgroundTimer = new QTimer(_session);
backgroundTimer->setSingleShot(false); backgroundTimer->setSingleShot(false);
backgroundTimer->setInterval(2000); backgroundTimer->setInterval(2000);
connect(backgroundTimer, &QTimer::timeout, this, &Konsole::SessionController::snapshot); connect(backgroundTimer, &QTimer::timeout, this, &Konsole::SessionController::snapshot);
...@@ -1296,7 +1296,7 @@ void SessionController::beginSearch(const QString& text , int direction) ...@@ -1296,7 +1296,7 @@ void SessionController::beginSearch(const QString& text , int direction)
if (!regExp.pattern().isEmpty()) { if (!regExp.pattern().isEmpty()) {
_view->screenWindow()->setCurrentResultLine(-1); _view->screenWindow()->setCurrentResultLine(-1);
SearchHistoryTask* task = new SearchHistoryTask(this); auto task = new SearchHistoryTask(this);
connect(task, &Konsole::SearchHistoryTask::completed, this, &Konsole::SessionController::searchCompleted); connect(task, &Konsole::SearchHistoryTask::completed, this, &Konsole::SessionController::searchCompleted);
...@@ -1415,7 +1415,7 @@ void SessionController::print_screen() ...@@ -1415,7 +1415,7 @@ void SessionController::print_screen()
QPrinter printer; QPrinter printer;
QPointer<QPrintDialog> dialog = new QPrintDialog(&printer, _view); QPointer<QPrintDialog> dialog = new QPrintDialog(&printer, _view);
PrintOptions* options = new PrintOptions(); auto options = new PrintOptions();
dialog->setOptionTabs(QList<QWidget*>() << options);