Commit b893a9bb authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Provide information about how we are using KUserFeedback

Summary:
Implements --feedback
See 26569

Test Plan: Used the KCM happily

Reviewers: #plasma, vkrause

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26571
parent ec5464e7
......@@ -521,4 +521,9 @@ QRect DiscoverObject::initialGeometry() const
return window.readEntry("geometry", QRect());
}
QString DiscoverObject::describeSources() const
{
return rootObject()->property("describeSources").toString();
}
#include "DiscoverObject.moc"
......@@ -62,6 +62,8 @@ class DiscoverObject : public QObject
void showPassiveNotification(const QString &msg);
QRect initialGeometry() const;
QString describeSources() const;
public Q_SLOTS:
void openApplication(const QUrl& app);
void openMimeType(const QString& mime);
......
......@@ -52,6 +52,7 @@ QCommandLineParser* createParser()
parser->addOption(QCommandLineOption(QStringLiteral("local-filename"), i18n("Local package file to install"), QStringLiteral("package")));
parser->addOption(QCommandLineOption(QStringLiteral("listbackends"), i18n("List all the available backends.")));
parser->addOption(QCommandLineOption(QStringLiteral("search"), i18n("Search string."), QStringLiteral("text")));
parser->addOption(QCommandLineOption(QStringLiteral("feedback"), i18n("Lists the available options for user feedback")));
parser->addOption(QCommandLineOption(QStringLiteral("test"), QStringLiteral("Test file"), QStringLiteral("file.qml")));
parser->addPositionalArgument(QStringLiteral("urls"), i18n("Supports appstream: url scheme"));
DiscoverBackendsFactory::setupCommandLine(parser);
......@@ -161,6 +162,12 @@ int main(int argc, char** argv)
return 0;
}
if(parser->isSet(QStringLiteral("feedback"))) {
QTextStream(stdout) << mainWindow->describeSources() << '\n';
delete mainWindow;
return 0;
}
if (parser->isSet(QStringLiteral("test"))) {
const QUrl testFile = QUrl::fromUserInput(parser->value(QStringLiteral("test")), {}, QUrl::AssumeLocalFile);
Q_ASSERT(!testFile.isEmpty() && testFile.isLocalFile());
......
......@@ -47,6 +47,7 @@ Kirigami.ApplicationWindow
showPassiveNotification(i18n("Running as <em>root</em> is discouraged and unnecessary."));
}
readonly property string describeSources: feedbackLoader.item.describeDataSources
Loader {
id: feedbackLoader
source: "Feedback.qml"
......
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