Commit 2857f080 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Make it possible to use the AddonsList and PackageState with QDebug

parent fd01fb97
......@@ -19,6 +19,7 @@
***************************************************************************/
#include "AddonList.h"
#include <QDebug>
AddonList::AddonList()
{}
......@@ -70,3 +71,13 @@ AddonList::State AddonList::addonState(const QString& addonName) const
else
return None;
}
QDebug operator<<(QDebug debug, const AddonList& addons)
{
QDebugStateSaver saver(debug);
debug.nospace() << "AddonsList(";
debug.nospace() << "install:" << addons.addonsToInstall() << ',';
debug.nospace() << "remove:" << addons.addonsToRemove() << ',';
debug.nospace() << ')';
return debug;
}
......@@ -51,4 +51,6 @@ private:
QStringList m_toRemove;
};
DISCOVERCOMMON_EXPORT QDebug operator<<(QDebug dbg, const AddonList& addons);
#endif // ADDONLIST_H
......@@ -19,6 +19,7 @@
***************************************************************************/
#include "PackageState.h"
#include <QDebug>
PackageState::PackageState(QString name, QString description, bool installed)
: PackageState(name, name, description, installed)
......@@ -55,3 +56,13 @@ void PackageState::setInstalled(bool installed)
{
m_installed = installed;
}
QDebug operator<<(QDebug debug, const PackageState& state)
{
QDebugStateSaver saver(debug);
debug.nospace() << "PackageState(";
debug.nospace() << state.name() << ':';
debug.nospace() << "installed: " << state.isInstalled() << ',';
debug.nospace() << ')';
return debug;
}
......@@ -49,4 +49,6 @@ class DISCOVERCOMMON_EXPORT PackageState
bool m_installed;
};
DISCOVERCOMMON_EXPORT QDebug operator<<(QDebug dbg, const PackageState &state);
#endif // PACKAGESTATE_H
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