Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Telemetry
KUserFeedback
Commits
dc3feb69
Commit
dc3feb69
authored
Mar 11, 2019
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port to new connect syntax
parent
546879d3
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
48 deletions
+29
-48
src/provider/core/provider.cpp
src/provider/core/provider.cpp
+5
-5
src/provider/core/provider.h
src/provider/core/provider.h
+0
-4
src/provider/core/selectionratiosource.cpp
src/provider/core/selectionratiosource.cpp
+11
-19
src/provider/widgets/auditlogbrowserdialog.cpp
src/provider/widgets/auditlogbrowserdialog.cpp
+3
-3
src/provider/widgets/feedbackconfigdialog.cpp
src/provider/widgets/feedbackconfigdialog.cpp
+1
-1
src/provider/widgets/feedbackconfigdialog.h
src/provider/widgets/feedbackconfigdialog.h
+0
-1
src/provider/widgets/feedbackconfigwidget.cpp
src/provider/widgets/feedbackconfigwidget.cpp
+5
-5
src/provider/widgets/feedbackconfigwidget.h
src/provider/widgets/feedbackconfigwidget.h
+0
-2
src/provider/widgets/notificationpopup.cpp
src/provider/widgets/notificationpopup.cpp
+4
-4
src/provider/widgets/notificationpopup.h
src/provider/widgets/notificationpopup.h
+0
-4
No files found.
src/provider/core/provider.cpp
View file @
dc3feb69
...
...
@@ -71,12 +71,12 @@ ProviderPrivate::ProviderPrivate(Provider *qq)
,
encouragementInterval
(
-
1
)
{
submissionTimer
.
setSingleShot
(
true
);
QObject
::
connect
(
&
submissionTimer
,
SIGNAL
(
timeout
())
,
q
,
SLOT
(
submit
())
);
QObject
::
connect
(
&
submissionTimer
,
&
QTimer
::
timeout
,
q
,
&
Provider
::
submit
);
startTime
.
start
();
encouragementTimer
.
setSingleShot
(
true
);
QObject
::
connect
(
&
encouragementTimer
,
SIGNAL
(
timeout
())
,
q
,
SLOT
(
emitShowEncouragementMessage
()
)
);
QObject
::
connect
(
&
encouragementTimer
,
&
QTimer
::
timeout
,
q
,
[
this
]()
{
emitShowEncouragementMessage
()
;
}
);
}
ProviderPrivate
::~
ProviderPrivate
()
...
...
@@ -399,7 +399,7 @@ Provider::Provider(QObject *parent) :
{
qCDebug
(
Log
);
connect
(
QCoreApplication
::
instance
(),
SIGNAL
(
aboutToQuit
())
,
this
,
SLOT
(
aboutToQuit
()
)
);
connect
(
QCoreApplication
::
instance
(),
&
QCoreApplication
::
aboutToQuit
,
this
,
[
this
]()
{
d
->
aboutToQuit
()
;
}
);
auto
domain
=
QCoreApplication
::
organizationDomain
().
split
(
QLatin1Char
(
'.'
));
std
::
reverse
(
domain
.
begin
(),
domain
.
end
());
...
...
@@ -636,7 +636,7 @@ void ProviderPrivate::submit(const QUrl &url)
request
.
setHeader
(
QNetworkRequest
::
ContentTypeHeader
,
QStringLiteral
(
"application/json"
));
request
.
setHeader
(
QNetworkRequest
::
UserAgentHeader
,
QString
(
QStringLiteral
(
"KUserFeedback/"
)
+
QStringLiteral
(
KUSERFEEDBACK_VERSION_STRING
)));
auto
reply
=
networkAccessManager
->
post
(
request
,
jsonData
(
telemetryMode
));
QObject
::
connect
(
reply
,
SIGNAL
(
finished
())
,
q
,
SLOT
(
submitFinished
()
)
);
QObject
::
connect
(
reply
,
&
QNetworkReply
::
finished
,
q
,
[
this
]()
{
submitFinished
()
;
}
);
}
void
ProviderPrivate
::
submitProbe
(
const
QUrl
&
url
)
...
...
@@ -644,7 +644,7 @@ void ProviderPrivate::submitProbe(const QUrl &url)
QNetworkRequest
request
(
url
);
request
.
setHeader
(
QNetworkRequest
::
UserAgentHeader
,
QString
(
QStringLiteral
(
"KUserFeedback/"
)
+
QStringLiteral
(
KUSERFEEDBACK_VERSION_STRING
)));
auto
reply
=
networkAccessManager
->
get
(
request
);
QObject
::
connect
(
reply
,
SIGNAL
(
finished
())
,
q
,
SLOT
(
submitProbeFinished
()
)
);
QObject
::
connect
(
reply
,
&
QNetworkReply
::
finished
,
q
,
[
this
]()
{
submitProbeFinished
()
;
}
);
}
void
ProviderPrivate
::
submitProbeFinished
()
...
...
src/provider/core/provider.h
View file @
dc3feb69
...
...
@@ -265,10 +265,6 @@ Q_SIGNALS:
private:
friend
class
ProviderPrivate
;
ProviderPrivate
*
const
d
;
Q_PRIVATE_SLOT
(
d
,
void
aboutToQuit
())
Q_PRIVATE_SLOT
(
d
,
void
submitFinished
())
Q_PRIVATE_SLOT
(
d
,
void
submitProbeFinished
())
Q_PRIVATE_SLOT
(
d
,
void
emitShowEncouragementMessage
())
// for UI
Q_PRIVATE_SLOT
(
d
,
QByteArray
jsonData
(
KUserFeedback
::
Provider
::
TelemetryMode
))
// for testing
...
...
src/provider/core/selectionratiosource.cpp
View file @
dc3feb69
...
...
@@ -35,12 +35,13 @@ class SelectionRatioSourcePrivate : public AbstractDataSourcePrivate
{
public:
SelectionRatioSourcePrivate
();
~
SelectionRatioSourcePrivate
();
void
selectionChanged
();
QString
selectedValue
()
const
;
QItemSelectionModel
*
model
;
std
::
unique_ptr
<
QObject
>
monitor
;
QMetaObject
::
Connection
monitorConnection
;
QString
description
;
QString
previousValue
;
QTime
lastChangeTime
;
...
...
@@ -49,20 +50,6 @@ public:
int
role
;
};
class
SelectionMonitor
:
public
QObject
{
Q_OBJECT
public:
explicit
SelectionMonitor
(
SelectionRatioSourcePrivate
*
d
)
:
m_receiver
(
d
)
{}
public
Q_SLOTS
:
void
selectionChanged
()
{
m_receiver
->
selectionChanged
();
}
private:
SelectionRatioSourcePrivate
*
m_receiver
;
};
}
SelectionRatioSourcePrivate
::
SelectionRatioSourcePrivate
()
...
...
@@ -71,6 +58,11 @@ SelectionRatioSourcePrivate::SelectionRatioSourcePrivate()
{
}
SelectionRatioSourcePrivate
::~
SelectionRatioSourcePrivate
()
{
QObject
::
disconnect
(
monitorConnection
);
}
void
SelectionRatioSourcePrivate
::
selectionChanged
()
{
if
(
!
previousValue
.
isEmpty
()
&&
lastChangeTime
.
elapsed
()
>
1000
)
{
...
...
@@ -99,8 +91,10 @@ SelectionRatioSource::SelectionRatioSource(QItemSelectionModel* selectionModel,
d
->
model
=
selectionModel
;
Q_ASSERT
(
selectionModel
);
d
->
monitor
.
reset
(
new
SelectionMonitor
(
d
));
QObject
::
connect
(
selectionModel
,
SIGNAL
(
selectionChanged
(
QItemSelection
,
QItemSelection
)),
d
->
monitor
.
get
(),
SLOT
(
selectionChanged
()));
d
->
monitorConnection
=
QObject
::
connect
(
selectionModel
,
&
QItemSelectionModel
::
selectionChanged
,
[
this
]()
{
Q_D
(
SelectionRatioSource
);
d
->
selectionChanged
();
});
d
->
lastChangeTime
.
start
();
d
->
selectionChanged
();
}
...
...
@@ -179,5 +173,3 @@ void SelectionRatioSource::reset(QSettings* settings)
d
->
ratioSet
.
clear
();
settings
->
remove
(
QString
());
}
#include "selectionratiosource.moc"
src/provider/widgets/auditlogbrowserdialog.cpp
View file @
dc3feb69
...
...
@@ -32,12 +32,12 @@ AuditLogBrowserDialog::AuditLogBrowserDialog(QWidget *parent)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
logEntryBox
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
logEntrySelected
())
);
connect
(
ui
->
logEntryBox
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
activated
),
this
,
&
AuditLogBrowserDialog
::
logEntrySelected
);
auto
clearButton
=
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Discard
);
Q_ASSERT
(
clearButton
);
clearButton
->
setText
(
tr
(
"Delete Log"
));
connect
(
clearButton
,
SIGNAL
(
clicked
())
,
this
,
SLOT
(
close
())
);
connect
(
clearButton
,
&
QPushButton
::
clicked
,
this
,
&
AuditLogBrowserDialog
::
close
);
setEnabled
(
false
);
}
...
...
@@ -54,7 +54,7 @@ void AuditLogBrowserDialog::setUiController(AuditLogUiController *controller)
logEntrySelected
();
auto
clearButton
=
ui
->
buttonBox
->
button
(
QDialogButtonBox
::
Discard
);
connect
(
clearButton
,
SIGNAL
(
clicked
())
,
controller
,
SLOT
(
clear
())
);
connect
(
clearButton
,
&
QPushButton
::
clicked
,
controller
,
&
AuditLogUiController
::
clear
);
setEnabled
(
true
);
}
...
...
src/provider/widgets/feedbackconfigdialog.cpp
View file @
dc3feb69
...
...
@@ -51,7 +51,7 @@ FeedbackConfigDialog::~FeedbackConfigDialog()
void
FeedbackConfigDialog
::
setFeedbackProvider
(
Provider
*
provider
)
{
d
->
ui
->
configWidget
->
setFeedbackProvider
(
provider
);
connect
(
d
->
ui
->
configWidget
,
SIGNAL
(
configurationChanged
())
,
this
,
SLOT
(
updateButtonState
()
)
);
connect
(
d
->
ui
->
configWidget
,
&
FeedbackConfigWidget
::
configurationChanged
,
this
,
[
this
]()
{
d
->
updateButtonState
()
;
}
);
d
->
updateButtonState
();
}
...
...
src/provider/widgets/feedbackconfigdialog.h
View file @
dc3feb69
...
...
@@ -51,7 +51,6 @@ public:
void
accept
()
override
;
private:
Q_PRIVATE_SLOT
(
d
,
void
updateButtonState
())
std
::
unique_ptr
<
FeedbackConfigDialogPrivate
>
d
;
};
...
...
src/provider/widgets/feedbackconfigwidget.cpp
View file @
dc3feb69
...
...
@@ -107,15 +107,15 @@ FeedbackConfigWidget::FeedbackConfigWidget(QWidget* parent)
d
->
ui
->
setupUi
(
this
);
d
->
ui
->
noTelemetryLabel
->
setText
(
d
->
controller
->
telemetryModeDescription
(
Provider
::
NoTelemetry
));
connect
(
d
->
ui
->
telemetrySlider
,
SIGNAL
(
valueChanged
(
int
))
,
this
,
SLOT
(
telemetrySliderChanged
()
)
);
connect
(
d
->
ui
->
telemetrySlider
,
SIGNAL
(
valueChanged
(
int
))
,
this
,
SIGNAL
(
configurationChanged
())
);
connect
(
d
->
ui
->
surveySlider
,
SIGNAL
(
valueChanged
(
int
))
,
this
,
SLOT
(
surveySliderChanged
()
)
);
connect
(
d
->
ui
->
surveySlider
,
SIGNAL
(
valueChanged
(
int
))
,
this
,
SIGNAL
(
configurationChanged
())
);
connect
(
d
->
ui
->
telemetrySlider
,
&
QSlider
::
valueChanged
,
this
,
[
this
]()
{
d
->
telemetrySliderChanged
()
;
}
);
connect
(
d
->
ui
->
telemetrySlider
,
&
QSlider
::
valueChanged
,
this
,
&
FeedbackConfigWidget
::
configurationChanged
);
connect
(
d
->
ui
->
surveySlider
,
&
QSlider
::
valueChanged
,
this
,
[
this
]()
{
d
->
surveySliderChanged
()
;
}
);
connect
(
d
->
ui
->
surveySlider
,
&
QSlider
::
valueChanged
,
this
,
&
FeedbackConfigWidget
::
configurationChanged
);
d
->
ui
->
rawTelemetryButton
->
setParent
(
d
->
ui
->
telemetryDetails
);
d
->
ui
->
rawTelemetryButton
->
setIcon
(
style
()
->
standardPixmap
(
QStyle
::
SP_DialogHelpButton
));
d
->
ui
->
telemetryDetails
->
installEventFilter
(
this
);
connect
(
d
->
ui
->
rawTelemetryButton
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
telemetrySliderChanged
()
)
);
connect
(
d
->
ui
->
rawTelemetryButton
,
&
QAbstractButton
::
toggled
,
this
,
[
this
]()
{
d
->
telemetrySliderChanged
()
;
}
);
d
->
auditLogController
=
new
AuditLogUiController
(
this
);
d
->
ui
->
auditLogLabel
->
setVisible
(
d
->
auditLogController
->
hasLogEntries
());
...
...
src/provider/widgets/feedbackconfigwidget.h
View file @
dc3feb69
...
...
@@ -73,8 +73,6 @@ protected:
///@endcond
private:
Q_PRIVATE_SLOT
(
d
,
void
telemetrySliderChanged
())
Q_PRIVATE_SLOT
(
d
,
void
surveySliderChanged
())
std
::
unique_ptr
<
FeedbackConfigWidgetPrivate
>
d
;
};
...
...
src/provider/widgets/notificationpopup.cpp
View file @
dc3feb69
...
...
@@ -175,8 +175,8 @@ NotificationPopup::NotificationPopup(QWidget* parent)
d
->
ui
->
frame
->
setAutoFillBackground
(
true
);
d
->
ui
->
closeButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_DialogCloseButton
));
connect
(
d
->
ui
->
actionButton
,
SIGNAL
(
clicked
())
,
this
,
SLOT
(
action
()
)
);
connect
(
d
->
ui
->
closeButton
,
SIGNAL
(
clicked
())
,
this
,
SLOT
(
hidePopup
()
)
);
connect
(
d
->
ui
->
actionButton
,
&
QPushButton
::
clicked
,
this
,
[
this
]()
{
d
->
action
()
;
}
);
connect
(
d
->
ui
->
closeButton
,
&
QPushButton
::
clicked
,
this
,
[
this
]()
{
d
->
hidePopup
()
;
}
);
parent
->
installEventFilter
(
this
);
setVisible
(
false
);
...
...
@@ -190,8 +190,8 @@ void NotificationPopup::setFeedbackProvider(Provider* provider)
{
Q_ASSERT
(
provider
);
d
->
provider
=
provider
;
connect
(
provider
,
SIGNAL
(
showEncouragementMessage
())
,
this
,
SLOT
(
showEncouragement
()
)
);
connect
(
provider
,
SIGNAL
(
surveyAvailable
(
KUserFeedback
::
SurveyInfo
)),
this
,
SLOT
(
surveyAvailable
(
KUserFeedback
::
SurveyI
nfo
)
)
);
connect
(
provider
,
&
Provider
::
showEncouragementMessage
,
this
,
[
this
]()
{
d
->
showEncouragement
()
;
}
);
connect
(
provider
,
&
Provider
::
surveyAvailable
,
this
,
[
this
](
const
SurveyInfo
&
info
)
{
d
->
surveyAvailable
(
i
nfo
)
;
}
);
}
void
NotificationPopup
::
keyReleaseEvent
(
QKeyEvent
*
event
)
...
...
src/provider/widgets/notificationpopup.h
View file @
dc3feb69
...
...
@@ -57,10 +57,6 @@ protected:
///@endcond
private:
Q_PRIVATE_SLOT
(
d
,
void
showEncouragement
())
Q_PRIVATE_SLOT
(
d
,
void
surveyAvailable
(
const
KUserFeedback
::
SurveyInfo
&
info
))
Q_PRIVATE_SLOT
(
d
,
void
hidePopup
())
Q_PRIVATE_SLOT
(
d
,
void
action
())
std
::
unique_ptr
<
NotificationPopupPrivate
>
d
;
};
...
...
Write
Preview
Markdown
is supported
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