Commit 5cda40e2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent 916307d5
......@@ -130,8 +130,7 @@ void FileList::modifyItem(QListWidgetItem *item)
// Open a standard Filedialog
const QUrl url = mFileListHelper.openUrl(previousPath);
QList<QUrl> urls;
urls.append(url);
const QList<QUrl> urls{url};
const QStringList paths = mFileListHelper.findPaths(urls);
// We only take the first path
......
......@@ -80,7 +80,7 @@ QStringList FileListHelper::findPaths(const QList<QUrl> &urls)
{
QStringList paths;
for (QList<QUrl>::ConstIterator it = urls.constBegin(); it != urls.constEnd(); ++it) {
for (QList<QUrl>::ConstIterator it = urls.constBegin(), total = urls.constEnd(); it != total; ++it) {
QUrl url(*it);
if (isValidFile(url)) {
......
......@@ -105,7 +105,7 @@ void LogLevelFileList::addItem()
void LogLevelFileList::updateSpecificButtons()
{
if (fileList->selectedItems().count() > 0) {
if (!fileList->selectedItems().isEmpty()) {
changeItem->setEnabled(true);
} else {
changeItem->setEnabled(false);
......@@ -152,7 +152,7 @@ QList<int> LogLevelFileList::levels()
{
QList<int> levels;
const int count = fileList->count();
levels.reserve(count);
for (int i = 0; i < count; i++) {
levels.append(this->level(i)->id());
}
......
......@@ -147,7 +147,7 @@ LogLine *SyslogAnalyzer::parseMessage(const QString &logLine, const LogFile &ori
// If the delete process identifier option is enabled
if (KSystemLogConfig::deleteProcessIdentifier()) {
int squareBracket = process.indexOf(QLatin1Char('['));
const int squareBracket = process.indexOf(QLatin1Char('['));
// If we find a bracket, we remove the useless part
if (squareBracket != -1) {
......
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