D27517: Better handle authentication error

Aleix Pol Gonzalez noreply at phabricator.kde.org
Fri Feb 21 01:32:38 GMT 2020


apol added a comment.


  Review without knowing very well the codebase.

INLINE COMMENTS

> accountmodel.cpp:181
>  {
> -    if(!index.isValid()) {
> -        return false;
> +    qDebug() << "AccountModel::setDataWithResult";
> +    if (!index.isValid()) {

Remove?

> accountmodel.h:64
> +            AuthError
> +        };
> +

Q_ENUM is useful for these, especially since you use them with qDebug.

> accountmodel.h:71
>          QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
> -        bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
> +        AccountModel::Result setDataWithResult(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
>          bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;

I'm not very familiar with the code. Are you sure setData wasn't called elsewhere? The one you changed was an overriden virtual. In fact, if you're changing it, you can use more adequate API like you don't need to pass the Qt::EditRole.

REPOSITORY
  R128 User Manager

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

To: meven, #plasma, davidedmundson, nicolasfella
Cc: apol, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200221/4ff5140b/attachment.html>


More information about the Plasma-devel mailing list