Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Telemetry
KUserFeedback
Commits
fa397a3b
Commit
fa397a3b
authored
Dec 22, 2016
by
Volker Krause
Browse files
Add Qt version data source
parent
c92732fd
Changes
8
Hide whitespace changes
Inline
Side-by-side
analyzer/mainwindow.cpp
View file @
fa397a3b
...
...
@@ -29,8 +29,10 @@
#include <provider/widgets/feedbackconfigdialog.h>
#include <provider/core/applicationversionsource.h>
#include <provider/core/platforminfosource.h>
#include <provider/core/propertyratiosource.h>
#include <provider/core/provider.h>
#include <provider/core/qtversionsource.h>
#include <QApplication>
#include <QDebug>
...
...
@@ -140,6 +142,8 @@ MainWindow::MainWindow() :
viewModeSource
->
addValueMapping
(
2
,
QStringLiteral
(
"schemaEditor"
));
m_feedbackProvider
->
addDataSource
(
viewModeSource
,
Provider
::
AllStatistics
);
m_feedbackProvider
->
addDataSource
(
new
ApplicationVersionSource
,
Provider
::
BasicStatistics
);
m_feedbackProvider
->
addDataSource
(
new
PlatformInfoSource
,
Provider
::
AllStatistics
);
m_feedbackProvider
->
addDataSource
(
new
QtVersionSource
,
Provider
::
AllStatistics
);
}
MainWindow
::~
MainWindow
()
...
...
analyzer/schemaentrytemplates/qtVersion.json
View file @
fa397a3b
...
...
@@ -5,7 +5,7 @@
"aggregation"
:
"category"
,
"elements"
:
[
{
"name"
:
"
qtVersion
"
,
"name"
:
"
value
"
,
"type"
:
"string"
}
]
...
...
data/org.kde.UserFeedbackAnalyzer.schema
View file @
fa397a3b
...
...
@@ -42,7 +42,7 @@
"aggregationType": "category",
"elements": [
{
"name": "
qtVersion
",
"name": "
value
",
"type": "string"
}
],
...
...
provider/core/CMakeLists.txt
View file @
fa397a3b
...
...
@@ -3,6 +3,7 @@ set(userfeedback_core_srcs
applicationversionsource.cpp
platforminfosource.cpp
provider.cpp
qtversionsource.cpp
screeninfosource.cpp
surveyinfo.cpp
)
...
...
provider/core/qtversionsource.cpp
0 → 100644
View file @
fa397a3b
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "qtversionsource.h"
#include <QVariant>
using
namespace
UserFeedback
;
QtVersionSource
::
QtVersionSource
()
:
AbstractDataSource
(
QStringLiteral
(
"qtVersion"
))
{
}
QVariant
QtVersionSource
::
data
()
{
QVariantMap
m
;
m
.
insert
(
QStringLiteral
(
"value"
),
QString
::
fromLatin1
(
qVersion
()));
return
m
;
}
provider/core/qtversionsource.h
0 → 100644
View file @
fa397a3b
/*
Copyright (C) 2016 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef USERFEEDBACK_QTVERSIONSOURCE_H
#define USERFEEDBACK_QTVERSIONSOURCE_H
#include "userfeedbackcore_export.h"
#include "abstractdatasource.h"
namespace
UserFeedback
{
/*! Data source reporting the Qt version used at runtime. */
class
USERFEEDBACKCORE_EXPORT
QtVersionSource
:
public
AbstractDataSource
{
public:
QtVersionSource
();
QVariant
data
()
Q_DECL_OVERRIDE
;
};
}
#endif // USERFEEDBACK_QTVERSIONSOURCE_H
tests/auto/datasourcetest.cpp
View file @
fa397a3b
...
...
@@ -18,6 +18,7 @@
#include <provider/core/applicationversionsource.h>
#include <provider/core/platforminfosource.h>
#include <provider/core/propertyratiosource.h>
#include <provider/core/qtversionsource.h>
#include <provider/core/screeninfosource.h>
#include <QDebug>
...
...
@@ -122,6 +123,14 @@ private slots:
QVERIFY
(
m
.
contains
(
QLatin1String
(
"value"
)));
QCOMPARE
(
m
.
value
(
QLatin1String
(
"value"
)).
toString
(),
QLatin1String
(
"1.9.84"
));
}
void
testQtVersionSource
()
{
QtVersionSource
src
;
const
auto
m
=
src
.
data
().
toMap
();
QVERIFY
(
m
.
contains
(
QLatin1String
(
"value"
)));
QCOMPARE
(
m
.
value
(
QLatin1String
(
"value"
)).
toString
(),
QLatin1String
(
QT_VERSION_STR
));
}
};
QTEST_MAIN
(
DataSourceTest
)
...
...
tests/manual/orwell.cpp
View file @
fa397a3b
...
...
@@ -23,6 +23,7 @@
#include <provider/core/platforminfosource.h>
#include <provider/core/propertyratiosource.h>
#include <provider/core/provider.h>
#include <provider/core/qtversionsource.h>
#include <provider/core/screeninfosource.h>
#include <provider/core/surveyinfo.h>
...
...
@@ -107,6 +108,7 @@ int main(int argc, char** argv)
provider
->
setEncouragementDelay
(
10
);
provider
->
addDataSource
(
new
UserFeedback
::
ApplicationVersionSource
,
UserFeedback
::
Provider
::
BasicStatistics
);
provider
->
addDataSource
(
new
UserFeedback
::
PlatformInfoSource
,
UserFeedback
::
Provider
::
AllStatistics
);
provider
->
addDataSource
(
new
UserFeedback
::
QtVersionSource
,
UserFeedback
::
Provider
::
BasicStatistics
);
provider
->
addDataSource
(
new
UserFeedback
::
ScreenInfoSource
,
UserFeedback
::
Provider
::
AllStatistics
);
Orwell
mainWindow
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment