Commit ff55944f authored by Laurent Montel's avatar Laurent Montel
Browse files

Modernize code

parent c7a20d22
......@@ -42,9 +42,9 @@ AddRemoveDialog::AddRemoveDialog(ActionType action, QWidget *parent)
setWindowTitle((action == Add) ? i18n("CVS Add") : (action == AddBinary) ? i18n("CVS Add Binary") : i18n("CVS Remove"));
setModal(true);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......@@ -58,9 +58,9 @@ AddRemoveDialog::AddRemoveDialog(ActionType action, QWidget *parent)
// and is activated by Key_Return
okButton->setFocus();
QLabel *textlabel = new QLabel((action == Add) ? i18n("Add the following files to the repository:")
: (action == AddBinary) ? i18n("Add the following binary files to the repository:")
: i18n("Remove the following files from the repository:"));
auto textlabel = new QLabel((action == Add) ? i18n("Add the following files to the repository:")
: (action == AddBinary) ? i18n("Add the following binary files to the repository:")
: i18n("Remove the following files from the repository:"));
mainLayout->addWidget(textlabel);
......@@ -71,7 +71,7 @@ AddRemoveDialog::AddRemoveDialog(ActionType action, QWidget *parent)
// Add warning message to dialog when user wants to remove a file
if (action == Remove) {
KMessageWidget *warning =
auto warning =
new KMessageWidget(i18n("This will also remove the files from "
"your local working copy."));
......
......@@ -41,17 +41,17 @@ AddRepositoryDialog::AddRepositoryDialog(KConfig &cfg, const QString &repo, QWid
setWindowTitle(i18n("Add Repository"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QLabel *repo_label = new QLabel(i18n("&Repository:"));
auto repo_label = new QLabel(i18n("&Repository:"));
mainLayout->addWidget(repo_label);
repo_edit = new QLineEdit;
......@@ -65,7 +65,7 @@ AddRepositoryDialog::AddRepositoryDialog(KConfig &cfg, const QString &repo, QWid
}
mainLayout->addWidget(repo_edit);
QLabel *rsh_label = new QLabel(i18n("Use remote &shell (only for :ext: repositories):"));
auto rsh_label = new QLabel(i18n("Use remote &shell (only for :ext: repositories):"));
mainLayout->addWidget(rsh_label);
mainLayout->addWidget(rsh_label);
......@@ -74,7 +74,7 @@ AddRepositoryDialog::AddRepositoryDialog(KConfig &cfg, const QString &repo, QWid
rsh_label->setBuddy(rsh_edit);
mainLayout->addWidget(rsh_edit);
QLabel *server_label = new QLabel(i18n("Invoke this program on the server side:"));
auto server_label = new QLabel(i18n("Invoke this program on the server side:"));
mainLayout->addWidget(server_label);
server_edit = new QLineEdit;
......@@ -82,7 +82,7 @@ AddRepositoryDialog::AddRepositoryDialog(KConfig &cfg, const QString &repo, QWid
server_label->setBuddy(server_edit);
mainLayout->addWidget(server_edit);
QHBoxLayout *compressionBox = new QHBoxLayout;
auto compressionBox = new QHBoxLayout;
mainLayout->addLayout(compressionBox);
m_useDifferentCompression = new QCheckBox(i18n("Use different &compression level:"));
......
......@@ -33,7 +33,7 @@
using namespace Cervisia;
struct AnnotateController::Private {
typedef QMap<QString, QString> RevisionCommentMap;
using RevisionCommentMap = QMap<QString, QString>;
RevisionCommentMap comments; // maps comment to a revision
OrgKdeCervisia5CvsserviceCvsserviceInterface *cvsService;
......
......@@ -35,22 +35,22 @@ AnnotateDialog::AnnotateDialog(KConfig &cfg, QWidget *parent)
: QDialog(parent)
, partConfig(cfg)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
QPushButton *user1Button = new QPushButton;
auto user1Button = new QPushButton;
user1Button->setText(i18n("Go to Line..."));
user1Button->setAutoDefault(false);
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
QPushButton *user2Button = new QPushButton;
auto user2Button = new QPushButton;
user2Button->setText(i18n("Find Prev"));
user2Button->setAutoDefault(false);
buttonBox->addButton(user2Button, QDialogButtonBox::ActionRole);
QPushButton *user3Button = new QPushButton;
auto user3Button = new QPushButton;
user3Button->setText(i18n("Find Next"));
buttonBox->addButton(user3Button, QDialogButtonBox::ActionRole);
......
......@@ -92,7 +92,7 @@ void AnnotateViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
{
painter->save();
AnnotateViewItem *item = static_cast<AnnotateViewItem *>(view->topLevelItem(index.row()));
auto item = static_cast<AnnotateViewItem *>(view->topLevelItem(index.row()));
QColor backgroundColor;
QColor foregroundColor;
......@@ -168,7 +168,7 @@ AnnotateView::AnnotateView(QWidget *parent)
setColumnCount(3);
ToolTip *toolTip = new ToolTip(viewport());
auto toolTip = new ToolTip(viewport());
connect(toolTip, SIGNAL(queryToolTip(QPoint, QRect &, QString &)), this, SLOT(slotQueryToolTip(QPoint, QRect &, QString &)));
......@@ -185,7 +185,7 @@ void AnnotateView::addLine(const LogInfo &logInfo, const QString &content, bool
QSize AnnotateView::sizeHint() const
{
QFontMetrics fm(fontMetrics());
return QSize(100 * fm.width("0"), 10 * fm.lineSpacing());
return {100 * fm.width("0"), 10 * fm.lineSpacing()};
}
void AnnotateView::configChanged()
......@@ -241,7 +241,7 @@ int AnnotateView::currentLine() const
int AnnotateView::lastLine() const
{
AnnotateViewItem *item = static_cast<AnnotateViewItem *>(topLevelItem(topLevelItemCount() - 1));
auto item = static_cast<AnnotateViewItem *>(topLevelItem(topLevelItemCount() - 1));
if (!item)
return 0;
......@@ -250,7 +250,7 @@ int AnnotateView::lastLine() const
void AnnotateView::gotoLine(int line)
{
for (AnnotateViewItem *item = static_cast<AnnotateViewItem *>(topLevelItem(0)); item; item = static_cast<AnnotateViewItem *>(itemBelow(item))) {
for (auto item = static_cast<AnnotateViewItem *>(topLevelItem(0)); item; item = static_cast<AnnotateViewItem *>(itemBelow(item))) {
if (item->lineNumber() == line) {
setCurrentItem(item);
item->setSelected(true);
......
......@@ -635,7 +635,7 @@ void CervisiaPart::popupRequested(const QPoint &p)
// context menu for non-cvs files
if (isFileItem(item)) {
UpdateItem *fileItem = static_cast<UpdateItem *>(item);
auto fileItem = static_cast<UpdateItem *>(item);
if (fileItem->entry().m_status == Cervisia::NotInCVS)
xmlName = "noncvs_context_popup";
}
......@@ -647,7 +647,7 @@ void CervisiaPart::popupRequested(const QPoint &p)
action->setChecked(item->isExpanded());
}
if (QMenu *popup = static_cast<QMenu *>(hostContainer(xmlName))) {
if (auto popup = static_cast<QMenu *>(hostContainer(xmlName))) {
if (isFileItem(item)) {
// get name of selected file
QString selectedFile;
......@@ -714,15 +714,15 @@ void CervisiaPart::updateActions()
KAboutData *CervisiaPart::createAboutData()
{
KAboutData *about = new KAboutData("cervisiapart",
i18n("Cervisia Part"),
CERVISIA_VERSION_STRING,
i18n("A CVS frontend"),
KAboutLicense::GPL,
i18n("Copyright (c) 1999-2002 Bernd Gehrmann\n"
"Copyright (c) 2002-2008 the Cervisia authors"),
QString(),
QLatin1String("http://cervisia.kde.org"));
auto about = new KAboutData("cervisiapart",
i18n("Cervisia Part"),
CERVISIA_VERSION_STRING,
i18n("A CVS frontend"),
KAboutLicense::GPL,
i18n("Copyright (c) 1999-2002 Bernd Gehrmann\n"
"Copyright (c) 2002-2008 the Cervisia authors"),
QString(),
QLatin1String("http://cervisia.kde.org"));
about->addAuthor(i18n("Bernd Gehrmann"),
i18n("Original author and former "
......@@ -816,7 +816,7 @@ void CervisiaPart::slotResolve()
return;
// Non-modal dialog
ResolveDialog *l = new ResolveDialog(*config());
auto l = new ResolveDialog(*config());
if (l->parseFile(filename))
l->show();
else
......@@ -859,7 +859,7 @@ void CervisiaPart::slotStatus()
void CervisiaPart::slotUpdateToTag()
{
UpdateDialog *l = new UpdateDialog(cvsService, widget());
auto l = new UpdateDialog(cvsService, widget());
if (l->exec()) {
QString tagopt;
......@@ -1075,7 +1075,7 @@ void CervisiaPart::slotBrowseLog()
return;
// Non-modal dialog
LogDialog *l = new LogDialog(*CervisiaPart::config());
auto l = new LogDialog(*CervisiaPart::config());
if (l->parseCvsLog(cvsService, filename))
l->show();
else
......@@ -1091,7 +1091,7 @@ void CervisiaPart::slotAnnotate()
return;
// Non-modal dialog
AnnotateDialog *dlg = new AnnotateDialog(*config());
auto dlg = new AnnotateDialog(*config());
AnnotateController ctl(dlg, cvsService);
ctl.showDialog(filename, revision);
}
......@@ -1157,7 +1157,7 @@ void CervisiaPart::slotShowWatchers()
return;
// Non-modal dialog
WatchersDialog *dlg = new WatchersDialog(*config());
auto dlg = new WatchersDialog(*config());
if (dlg->parseWatchers(cvsService, list))
dlg->show();
else
......@@ -1407,7 +1407,7 @@ void CervisiaPart::slotCheckout()
void CervisiaPart::slotRepositories()
{
RepositoryDialog *l = new RepositoryDialog(*config(), cvsService, m_cvsServiceInterfaceName, widget());
auto l = new RepositoryDialog(*config(), cvsService, m_cvsServiceInterfaceName, widget());
l->show();
}
......@@ -1472,7 +1472,7 @@ void CervisiaPart::slotLastChange()
revB += QString::number(lastnumber - 1);
// Non-modal dialog
DiffDialog *l = new DiffDialog(*config());
auto l = new DiffDialog(*config());
if (l->parseCvsDiff(cvsService, filename, revB, revA))
l->show();
else
......@@ -1482,7 +1482,7 @@ void CervisiaPart::slotLastChange()
void CervisiaPart::slotHistory()
{
// Non-modal dialog
HistoryDialog *l = new HistoryDialog(*config());
auto l = new HistoryDialog(*config());
if (l->parseHistory(cvsService))
l->show();
else
......@@ -1565,7 +1565,7 @@ void CervisiaPart::slotDoCVSEdit()
void CervisiaPart::slotConfigure()
{
KConfig *conf = config();
SettingsDialog *l = new SettingsDialog(conf, widget());
auto l = new SettingsDialog(conf, widget());
l->exec();
bool splitHorz = conf->group("LookAndFeel").readEntry("SplitHorizontally", true);
......@@ -1576,7 +1576,7 @@ void CervisiaPart::slotConfigure()
void CervisiaPart::slotCVSInfo()
{
emit setStatusBarText(i18n("Invoking help on CVS"));
auto *job = new KIO::ApplicationLauncherJob(KService::serviceByDesktopName("org.kde.khelpcenter"));
auto job = new KIO::ApplicationLauncherJob(KService::serviceByDesktopName("org.kde.khelpcenter"));
job->setUrls({QUrl(QStringLiteral("man:/(1)/cvs"))});
job->start();
}
......@@ -1599,7 +1599,7 @@ void CervisiaPart::showDiff(const QString &revision)
return;
// Non-modal dialog
DiffDialog *l = new DiffDialog(*config());
auto l = new DiffDialog(*config());
if (l->parseCvsDiff(cvsService, fileName, revision, QString()))
l->show();
else
......@@ -1686,7 +1686,7 @@ bool CervisiaPart::openSandbox(const QUrl &url)
void CervisiaPart::setFilter()
{
UpdateView::Filter filter = UpdateView::Filter(0);
auto filter = UpdateView::Filter(0);
if (opt_hideFiles)
filter = UpdateView::Filter(filter | UpdateView::OnlyDirectories);
if (opt_hideUpToDate)
......@@ -1804,9 +1804,7 @@ CervisiaBrowserExtension::CervisiaBrowserExtension(CervisiaPart *p)
{
}
CervisiaBrowserExtension::~CervisiaBrowserExtension()
{
}
CervisiaBrowserExtension::~CervisiaBrowserExtension() = default;
// Local Variables:
// c-basic-offset: 4
......
......@@ -48,10 +48,10 @@ ChangeLogDialog::ChangeLogDialog(KConfig &cfg, QWidget *parent)
setWindowTitle(i18n("Edit ChangeLog"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
......
......@@ -59,17 +59,17 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
setWindowTitle((action == Checkout) ? i18n("CVS Checkout") : i18n("CVS Import"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::helpRequested, this, &CheckoutDialog::slotHelp);
QGridLayout *grid = new QGridLayout;
auto grid = new QGridLayout;
mainLayout->addLayout(grid);
grid->setColumnStretch(0, 1);
grid->setColumnStretch(1, 20);
......@@ -83,7 +83,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
repo_combo->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
grid->addWidget(repo_combo, 0, 1);
QLabel *repo_label = new QLabel(i18n("&Repository:"));
auto repo_label = new QLabel(i18n("&Repository:"));
repo_label->setBuddy(repo_combo);
grid->addWidget(repo_label, 0, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -91,14 +91,14 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
module_edit = new QLineEdit;
module_edit->setClearButtonEnabled(true);
grid->addWidget(module_edit, 1, 1);
QLabel *module_label = new QLabel(i18n("&Module:"));
auto module_label = new QLabel(i18n("&Module:"));
module_label->setBuddy(module_edit);
grid->addWidget(module_label, 1, 0, Qt::AlignLeft | Qt::AlignVCenter);
} else {
module_combo = new KComboBox;
module_combo->setEditable(true);
QPushButton *module_button = new QPushButton(i18n("Fetch &List"));
auto module_button = new QPushButton(i18n("Fetch &List"));
connect(module_button, SIGNAL(clicked()), this, SLOT(moduleButtonClicked()));
QBoxLayout *module_layout = new QHBoxLayout();
......@@ -106,14 +106,14 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
module_layout->addWidget(module_combo, 10);
module_layout->addWidget(module_button, 0, Qt::AlignVCenter);
QLabel *module_label = new QLabel(i18n("&Module:"));
auto module_label = new QLabel(i18n("&Module:"));
module_label->setBuddy(module_combo);
grid->addWidget(module_label, 1, 0, Qt::AlignLeft | Qt::AlignVCenter);
branchCombo = new KComboBox;
branchCombo->setEditable(true);
QPushButton *branchButton = new QPushButton(i18n("Fetch &List"));
auto branchButton = new QPushButton(i18n("Fetch &List"));
connect(branchButton, SIGNAL(clicked()), this, SLOT(branchButtonClicked()));
QBoxLayout *branchLayout = new QHBoxLayout();
......@@ -121,7 +121,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
branchLayout->addWidget(branchCombo, 10);
branchLayout->addWidget(branchButton, 0, Qt::AlignVCenter);
QLabel *branch_label = new QLabel(i18n("&Branch tag:"));
auto branch_label = new QLabel(i18n("&Branch tag:"));
branch_label->setBuddy(branchCombo);
grid->addWidget(branch_label, 2, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -136,12 +136,12 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
workdir_edit->setText(QDir::homePath());
workdir_edit->setMinimumWidth(fontMetrics().width('X') * 40);
KUrlCompletion *comp = new KUrlCompletion();
auto comp = new KUrlCompletion();
workdir_edit->setCompletionObject(comp);
workdir_edit->setAutoDeleteCompletionObject(true);
connect(workdir_edit, SIGNAL(returnPressed(QString)), comp, SLOT(addItem(QString)));
QPushButton *dir_button = new QPushButton("...");
auto dir_button = new QPushButton("...");
connect(dir_button, SIGNAL(clicked()), this, SLOT(dirButtonClicked()));
dir_button->setFixedWidth(30);
......@@ -150,7 +150,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
workdir_layout->addWidget(workdir_edit, 10);
workdir_layout->addWidget(dir_button, 0, Qt::AlignVCenter);
QLabel *workdir_label = new QLabel(i18n("Working &folder:"));
auto workdir_label = new QLabel(i18n("Working &folder:"));
workdir_label->setBuddy(workdir_edit);
grid->addWidget(workdir_label, (action == Import) ? 2 : 3, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -159,7 +159,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
vendortag_edit->setClearButtonEnabled(true);
grid->addWidget(vendortag_edit, 3, 1);
QLabel *vendortag_label = new QLabel(i18n("&Vendor tag:"));
auto vendortag_label = new QLabel(i18n("&Vendor tag:"));
vendortag_label->setBuddy(vendortag_edit);
grid->addWidget(vendortag_label, 3, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -167,7 +167,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
releasetag_edit->setClearButtonEnabled(true);
grid->addWidget(releasetag_edit, 4, 1);
QLabel *releasetag_label = new QLabel(i18n("&Release tag:"));
auto releasetag_label = new QLabel(i18n("&Release tag:"));
releasetag_label->setBuddy(releasetag_edit);
grid->addWidget(releasetag_label, 4, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -175,7 +175,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
ignore_edit->setClearButtonEnabled(true);
grid->addWidget(ignore_edit, 5, 1);
QLabel *ignore_label = new QLabel(i18n("&Ignore files:"));
auto ignore_label = new QLabel(i18n("&Ignore files:"));
ignore_label->setBuddy(ignore_edit);
grid->addWidget(ignore_label, 5, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -183,7 +183,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
comment_edit->setClearButtonEnabled(true);
grid->addWidget(comment_edit, 6, 1);
QLabel *comment_label = new QLabel(i18n("&Comment:"));
auto comment_label = new QLabel(i18n("&Comment:"));
comment_label->setBuddy(comment_edit);
grid->addWidget(comment_label, 6, 0, Qt::AlignLeft | Qt::AlignVCenter);
......@@ -197,7 +197,7 @@ CheckoutDialog::CheckoutDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsservice
alias_edit->setClearButtonEnabled(true);
grid->addWidget(alias_edit, 4, 1);
QLabel *alias_label = new QLabel(i18n("Chec&k out as:"));
auto alias_label = new QLabel(i18n("Chec&k out as:"));
alias_label->setBuddy(alias_edit);
grid->addWidget(alias_label, 4, 0, Qt::AlignLeft | Qt::AlignVCenter);
......
......@@ -68,10 +68,10 @@ CommitDialog::CommitDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsserviceInte
setWindowTitle(i18n("CVS Commit"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......@@ -84,7 +84,7 @@ CommitDialog::CommitDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsserviceInte
KGuiItem::assign(user1Button, KGuiItem(i18n("&Diff")));
QLabel *textlabel = new QLabel(i18n("Commit the following &files:"));
auto textlabel = new QLabel(i18n("Commit the following &files:"));
mainLayout->addWidget(textlabel);
m_fileList = new QListWidget;
......@@ -94,7 +94,7 @@ CommitDialog::CommitDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsserviceInte
connect(m_fileList, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(fileSelected(QListWidgetItem *)));
connect(m_fileList, SIGNAL(itemSelectionChanged()), this, SLOT(fileHighlighted()));
QLabel *archivelabel = new QLabel(i18n("Older &messages:"));
auto archivelabel = new QLabel(i18n("Older &messages:"));
mainLayout->addWidget(archivelabel);
combo = new QComboBox;
......@@ -104,7 +104,7 @@ CommitDialog::CommitDialog(KConfig &cfg, OrgKdeCervisia5CvsserviceCvsserviceInte
// make sure that combobox is smaller than the screen
combo->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed));
QLabel *messagelabel = new QLabel(i18n("&Log message:"));
auto messagelabel = new QLabel(i18n("&Log message:"));
mainLayout->addWidget(messagelabel);
edit = new Cervisia::LogMessageEdit(this);
......@@ -153,7 +153,7 @@ void CommitDialog::setFileList(const QStringList &list)
edit->compObj()->addItem(text);
CommitListItem *item = new CommitListItem(text, *it, m_fileList);
auto item = new CommitListItem(text, *it, m_fileList);
item->setCheckState(Qt::Checked);
}
}
......@@ -163,7 +163,7 @@ QStringList CommitDialog::fileList() const
QStringList files;
for (int i = 0; i < m_fileList->count(); ++i) {
CommitListItem *item = static_cast<CommitListItem *>(m_fileList->item(i));
auto item = static_cast<CommitListItem *>(m_fileList->item(i));
if (item->checkState() & Qt::Checked)
files.append(item->fileName());
}
......@@ -245,7 +245,7 @@ void CommitDialog::diffClicked()
void CommitDialog::showDiffDialog(const QString &fileName)
{
DiffDialog *l = new DiffDialog(partConfig, this, "diffdialog");
auto l = new DiffDialog(partConfig, this, "diffdialog");
// disable diff button so user doesn't open the same diff several times (#83018)
user1Button->setEnabled(false);
......
......@@ -41,32 +41,32 @@ CvsInitDialog::CvsInitDialog(QWidget *parent)
setWindowTitle(i18n("Create New Repository (cvs init)"));
setModal(true);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QLabel *dirLabel = new QLabel(i18n("Repository folder:"));
auto dirLabel = new QLabel(i18n("Repository folder:"));
mainLayout->addWidget(dirLabel);
QHBoxLayout *dirLayout = new QHBoxLayout;
auto dirLayout = new QHBoxLayout;
mainLayout->addLayout(dirLayout);
m_directoryEdit = new KLineEdit;
m_directoryEdit->setFocus();
KUrlCompletion *comp = new KUrlCompletion();
auto comp = new KUrlCompletion();
m_directoryEdit->setCompletionObject(comp);
m_directoryEdit->setAutoDeleteCompletionObject(true);
dirLabel->setBuddy(m_directoryEdit);
dirLayout->addWidget(m_directoryEdit);
QPushButton *dirButton = new QPushButton("...");
auto dirButton = new QPushButton("...");
dirButton->setFixedWidth(30);
dirLayout->addWidget(dirButton);
......
......@@ -27,8 +27,8 @@
#include <QDebug>
#include <qbytearray.h>
#include <csignal>
#include <cvsloginjobadaptor.h>
#include <signal.h>
#include <sys/types.h>
static const char LOGIN_PHRASE[] = "Logging in to";
......
......@@ -116,7 +116,7 @@ CvsService::~CvsService()
QDBusObjectPath CvsService::add(const QStringList &files, bool isBinary)
{
if (!d->hasWorkingCopy() || d->hasRunningJob())
return QDBusObjectPath();
return {};
// assemble the command line
// cvs add [-kb] [FILES]
......@@ -135,7 +135,7 @@ QDBusObjectPath CvsService::add(const QStringList &files, bool isBinary)
QDBusObjectPath CvsService::addWatch(const QStringList &files, int events)
{
if (!d->hasWorkingCopy() || d->hasRunningJob())
return QDBusObjectPath();
return {};
// assemble the command line
d->singleCvsJob->clearCvsCommand();
......@@ -159,7 +159,7 @@ QDBusObjectPath CvsService::addWatch(const QStringList &files, int events)
QDBusObjectPath CvsService::annotate(const QString &fileName, const QString &revision)
{