D10578: balooctl monitor: Wait for dbus interface

Alexey Min noreply at phabricator.kde.org
Sat Feb 17 08:40:18 UTC 2018


alexeymin added a comment.


  Looks almost fine, just fix these:

INLINE COMMENTS

> monitorcommand.cpp:45
> +        , QDBusConnection::sessionBus()
> +        , this
> +    );

Strange formatting of commas in above 3 lines. It looks OK in constructor, where member initialization may be added later, but here, when the parameter count is fixed, no need to start new line with a comma. I'd suggest to keep as it was before

> monitorcommand.cpp:54
> +        QThread::msleep(50);
> +        m_dbusInterface->disconnect();
> +        m_dbusInterface = new org::kde::baloo::fileindexer(QStringLiteral("org.kde.baloo")

`delete m_dbusInterface;` after this line, because below you are creating a new object? Each every 50 ms? Memory leaks here

> monitorcommand.cpp:58
> +            , QDBusConnection::sessionBus()
> +            , this
> +        );

Again, strange formatting of commas

> monitorcommand.cpp:65
> +    connect(m_dbusInterface, &org::kde::baloo::fileindexer::startedIndexingFile
> +        , this, &MonitorCommand::startedIndexingFile);
> +    connect(m_dbusInterface, &org::kde::baloo::fileindexer::finishedIndexingFile

Strange formatting of commas

> monitorcommand.cpp:67
> +    connect(m_dbusInterface, &org::kde::baloo::fileindexer::finishedIndexingFile
> +        , this, &MonitorCommand::finishedIndexingFile);
> +    

Strange formatting of commas

> monitorcommand.cpp:72
> +    connect(balooWatcher, &QDBusServiceWatcher::serviceUnregistered
> +        , [this, diedMessage]() {
> +            m_out << diedMessage << endl;

Strange formatting of commas

> monitorcommand.h:28
> +#include "command.h"
> +#include "fileindexerinterface.h"
>  #include <QObject>

Why dod you move local includes up? Usually they are below globals

> monitorcommand.h:60
>      QString m_currentFile;
> +
>  };

extra empty string?

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D10578

To: michaelh, dfaure
Cc: alexeymin, #frameworks, ashaposhnikov, michaelh, spoorun, nicolasfella
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180217/868f9543/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list