Commit 92e2b220 authored by Laurent Montel's avatar Laurent Montel 😁

Minor

parent 6960b280
......@@ -22,7 +22,6 @@
#include <QPushButton>
#include <KLocalizedString>
#include <kguiitem.h>
#include <kstatusbar.h>
#include <kmessagebox.h>
#include <QDebug>
......@@ -87,7 +86,7 @@ KfindDlg::KfindDlg(const QUrl &url, QWidget *parent)
connect(this, SIGNAL(user1Clicked()),
win, SLOT(saveResults()));
connect(this, SIGNAL(closeClicked()), this, SLOT(finishAndClose()));
connect(this, &KDialog::closeClicked, this, &KfindDlg::finishAndClose);
connect(win, SIGNAL(resultSelected(bool)),
this, SIGNAL(resultSelected(bool)));
......@@ -228,7 +227,7 @@ void KfindDlg::addFiles(const QList< QPair<KFileItem, QString> > &pairs)
isResultReported = true;
}
QString str = i18np("one file found", "%1 files found", win->itemCount());
const QString str = i18np("one file found", "%1 files found", win->itemCount());
setProgressMsg(str);
}
......@@ -254,7 +253,7 @@ void KfindDlg::slotDeleteItem(const QString &file)
win->removeItem(QUrl::fromLocalFile(file));
QString str = i18np("one file found", "%1 files found", win->itemCount());
const QString str = i18np("one file found", "%1 files found", win->itemCount());
setProgressMsg(str);
}
......
......@@ -205,8 +205,8 @@ QMimeData *KFindItemModel::mimeData(const QModelIndexList &indexes) const
}
}
if (uris.count() <= 0) {
return 0;
if (uris.isEmpty()) {
return nullptr;
}
QMimeData *mimeData = new QMimeData();
......@@ -414,7 +414,7 @@ void KFindTreeView::removeItem(const QUrl &url)
//Close menu
if (m_contextMenu) {
delete m_contextMenu;
m_contextMenu = 0;
m_contextMenu = nullptr;
}
}
m_model->removeItem(url);
......@@ -496,8 +496,8 @@ void KFindTreeView::openContainingFolder()
void KFindTreeView::slotExecuteSelected()
{
QModelIndexList selected = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
if (selected.size() == 0) {
const QModelIndexList selected = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
if (selected.isEmpty()) {
return;
}
......@@ -535,8 +535,8 @@ void KFindTreeView::contextMenuRequested(const QPoint &p)
{
KFileItemList fileList;
QModelIndexList selected = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
if (selected.size() == 0) {
const QModelIndexList selected = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
if (selected.isEmpty()) {
return;
}
......@@ -587,7 +587,7 @@ QList<QUrl> KFindTreeView::selectedUrls()
{
QList<QUrl> uris;
QModelIndexList indexes = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
const QModelIndexList indexes = m_proxyModel->mapSelectionToSource(selectionModel()->selection()).indexes();
Q_FOREACH (const QModelIndex &index, indexes) {
if (index.column() == 0 && index.isValid()) {
KFindItem item = m_model->itemAtIndex(index);
......
......@@ -62,7 +62,7 @@ struct LessMimeType_ByComment
KfindTabWidget::KfindTabWidget(QWidget *parent)
: KTabWidget(parent)
, regExpDialog(0)
, regExpDialog(nullptr)
{
// This validator will be used for all numeric edit fields
//KDigitValidator *digitV = new KDigitValidator(this);
......@@ -327,7 +327,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
"program files and images).</qt>");
binaryContextCb->setToolTip(binaryTooltip);
QPushButton *editRegExp = 0;
QPushButton *editRegExp = nullptr;
if (!KServiceTypeTrader::self()->query(QStringLiteral("KRegExpEditor/KRegExpEditor")).isEmpty()) {
// The editor is available, so lets use it.
editRegExp = new QPushButton(i18n("&Edit..."), pages[2]);
......
......@@ -142,7 +142,7 @@ void KQuery::slotResult(KJob *_job)
if (job != _job) {
return;
}
job = 0;
job = nullptr;
m_result = _job->error();
checkEntries();
......@@ -153,7 +153,7 @@ void KQuery::slotCanceled(KJob *_job)
if (job != _job) {
return;
}
job = 0;
job = nullptr;
m_fileItems.clear();
......@@ -229,7 +229,7 @@ void KQuery::slotListEntries(QStringList list)
processQuery(KFileItem(KFileItem::Unknown, KFileItem::Unknown, QUrl::fromLocalFile(*it)));
}
if (m_foundFilesList.size() > 0) {
if (!m_foundFilesList.isEmpty()) {
emit foundFileList(m_foundFilesList);
}
}
......@@ -251,7 +251,7 @@ void KQuery::processQuery(const KFileItem &file)
while (nextItem.hasNext())
{
QRegExp *reg = nextItem.next();
matched = matched || (reg == 0L) || (reg->exactMatch(file.url().adjusted(QUrl::StripTrailingSlash).fileName()));
matched = matched || (reg == nullptr) || (reg->exactMatch(file.url().adjusted(QUrl::StripTrailingSlash).fileName()));
}
if (!matched) {
return;
......@@ -551,7 +551,7 @@ void KQuery::setGroupname(const QString &groupname)
void KQuery::setRegExp(const QString &regexp, bool caseSensitive)
{
QRegExp *regExp;
QRegExp *regExp = nullptr;
QRegExp sep(QStringLiteral(";"));
const QStringList strList = regexp.split(sep, QString::SkipEmptyParts);
// QRegExp globChars ("[\\*\\?\\[\\]]", TRUE, FALSE);
......
......@@ -73,7 +73,7 @@ int main(int argc, char **argv)
aboutData.processCommandLine(&parser);
QUrl url;
if (parser.positionalArguments().count() > 0)
if (!parser.positionalArguments().isEmpty())
{
url = QUrl::fromUserInput(parser.positionalArguments().at(0), QDir::currentPath(), QUrl::AssumeLocalFile);
}
......
Markdown is supported
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