Commit 81abfe95 authored by Volker Krause's avatar Volker Krause
Browse files

Initialize product id based on application name and organization domain.

parent 7ca23363
......@@ -31,9 +31,9 @@
#include <QTime>
#include <QUrl>
#include <algorithm>
#include <numeric>
using namespace UserFeedback;
namespace UserFeedback {
......@@ -75,6 +75,10 @@ ProviderPrivate::ProviderPrivate(Provider *qq)
, startCount(0)
, usageTime(0)
{
auto domain = QCoreApplication::organizationDomain().split(QLatin1Char('.'));
std::reverse(domain.begin(), domain.end());
productId = domain.join(QLatin1Char('.')) + QLatin1Char('.') + QCoreApplication::applicationName();
startTime.start();
}
......@@ -163,6 +167,11 @@ Provider::Provider(QObject *parent) :
d->load();
}
Provider::~Provider()
{
delete d;
}
void Provider::setProductIdentifier(const QString &productId)
{
d->productId = productId;
......
......@@ -35,6 +35,7 @@ class USERFEEDBACKCORE_EXPORT Provider : public QObject
Q_OBJECT
public:
explicit Provider(QObject *parent = Q_NULLPTR);
~Provider();
/** Set the product identifier.
* This is used to distinguish independent products on the same server.
......
......@@ -84,7 +84,6 @@ int main(int argc, char** argv)
QApplication app(argc, argv);
provider.reset(new UserFeedback::Provider);
provider->setProductIdentifier(QStringLiteral("org.kde.orwell"));
provider->setFeedbackServer(QUrl(QStringLiteral("https://feedback.volkerkrause.eu")));
Orwell mainWindow;
......
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