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
1be6e139
Commit
1be6e139
authored
Mar 15, 2019
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up QNetworkReplies correctly
parent
ef010f9b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
0 deletions
+17
-0
src/console/jobs/handshakejob.cpp
src/console/jobs/handshakejob.cpp
+1
-0
src/console/jobs/productexportjob.cpp
src/console/jobs/productexportjob.cpp
+3
-0
src/console/jobs/productimportjob.cpp
src/console/jobs/productimportjob.cpp
+3
-0
src/console/mainwindow.cpp
src/console/mainwindow.cpp
+2
-0
src/console/model/datamodel.cpp
src/console/model/datamodel.cpp
+1
-0
src/console/model/productmodel.cpp
src/console/model/productmodel.cpp
+1
-0
src/console/model/surveymodel.cpp
src/console/model/surveymodel.cpp
+2
-0
src/console/schemaeditor/schemaeditor.cpp
src/console/schemaeditor/schemaeditor.cpp
+1
-0
src/console/surveyeditor/surveyeditor.cpp
src/console/surveyeditor/surveyeditor.cpp
+3
-0
No files found.
src/console/jobs/handshakejob.cpp
View file @
1be6e139
...
...
@@ -39,6 +39,7 @@ HandshakeJob::HandshakeJob(RESTClient* restClient, QObject* parent)
}
else
{
emitError
(
reply
->
errorString
());
}
reply
->
deleteLater
();
});
connect
(
reply
,
&
QNetworkReply
::
redirected
,
this
,
[
this
,
reply
](
const
auto
&
url
)
{
auto
s
=
m_restClient
->
serverInfo
();
...
...
src/console/jobs/productexportjob.cpp
View file @
1be6e139
...
...
@@ -34,6 +34,7 @@ ProductExportJob::ProductExportJob(const QString& productId, const QString& dest
Q_ASSERT
(
m_restClient
->
isConnected
());
auto
reply
=
RESTApi
::
listProducts
(
restClient
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
productId
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
deleteLater
();
return
;
...
...
@@ -82,6 +83,7 @@ void ProductExportJob::doExportSurveys()
{
auto
reply
=
RESTApi
::
listSurveys
(
m_restClient
,
m_product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
deleteLater
();
return
;
...
...
@@ -101,6 +103,7 @@ void ProductExportJob::doExportData()
{
auto
reply
=
RESTApi
::
listSamples
(
m_restClient
,
m_product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
deleteLater
();
return
;
...
...
src/console/jobs/productimportjob.cpp
View file @
1be6e139
...
...
@@ -59,6 +59,7 @@ void ProductImportJob::doImportSchema()
auto
reply
=
RESTApi
::
createProduct
(
m_restClient
,
m_product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
deleteLater
();
return
;
...
...
@@ -86,6 +87,7 @@ void ProductImportJob::doImportSurveys()
++
m_jobCount
;
auto
reply
=
RESTApi
::
createSurvey
(
m_restClient
,
m_product
,
s
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
--
m_jobCount
;
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
deleteLater
();
...
...
@@ -114,6 +116,7 @@ void ProductImportJob::doImportData()
auto
reply
=
RESTApi
::
addSamples
(
m_restClient
,
m_product
,
samples
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
==
QNetworkReply
::
NoError
)
emitFinished
();
});
...
...
src/console/mainwindow.cpp
View file @
1be6e139
...
...
@@ -241,6 +241,7 @@ void MainWindow::createProduct()
auto
reply
=
RESTApi
::
createProduct
(
m_restClient
,
product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
,
name
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
==
QNetworkReply
::
NoError
)
{
logMessage
(
QString
::
fromUtf8
(
reply
->
readAll
()));
m_productModel
->
reload
();
...
...
@@ -262,6 +263,7 @@ void MainWindow::deleteProduct()
auto
reply
=
RESTApi
::
deleteProduct
(
m_restClient
,
product
);
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
[
this
,
reply
]()
{
reply
->
deleteLater
();
if
(
reply
->
error
()
==
QNetworkReply
::
NoError
)
{
logMessage
(
QString
::
fromUtf8
(
reply
->
readAll
()));
}
...
...
src/console/model/datamodel.cpp
View file @
1be6e139
...
...
@@ -117,6 +117,7 @@ void DataModel::reload()
const
auto
samples
=
Sample
::
fromJson
(
reply
->
readAll
(),
m_product
);
setSamples
(
samples
);
}
reply
->
deleteLater
();
});
}
...
...
src/console/model/productmodel.cpp
View file @
1be6e139
...
...
@@ -61,6 +61,7 @@ void ProductModel::reload()
auto
json
=
reply
->
readAll
();
mergeProducts
(
Product
::
fromJson
(
json
));
}
reply
->
deleteLater
();
});
}
...
...
src/console/model/surveymodel.cpp
View file @
1be6e139
...
...
@@ -59,6 +59,7 @@ void SurveyModel::reload()
m_surveys
=
Survey
::
fromJson
(
data
);
endResetModel
();
}
reply
->
deleteLater
();
});
}
...
...
@@ -107,6 +108,7 @@ bool SurveyModel::setData(const QModelIndex &index, const QVariant &value, int r
reload
();
});
emit
dataChanged
(
index
,
index
);
reply
->
deleteLater
();
return
true
;
}
return
false
;
...
...
src/console/schemaeditor/schemaeditor.cpp
View file @
1be6e139
...
...
@@ -121,6 +121,7 @@ void SchemaEditor::save()
setDirty
(
false
);
emit
logMessage
(
QString
::
fromUtf8
((
reply
->
readAll
())));
emit
productChanged
(
product
());
reply
->
deleteLater
();
});
}
...
...
src/console/surveyeditor/surveyeditor.cpp
View file @
1be6e139
...
...
@@ -77,6 +77,7 @@ void SurveyEditor::createSurvey()
emit
logMessage
(
QString
::
fromUtf8
(
reply
->
readAll
()));
}
m_surveyModel
->
reload
();
reply
->
deleteLater
();
});
}
...
...
@@ -100,6 +101,7 @@ void SurveyEditor::editSurvey()
return
;
emit
logMessage
(
QString
::
fromUtf8
(
reply
->
readAll
()));
m_surveyModel
->
reload
();
reply
->
deleteLater
();
});
}
...
...
@@ -126,6 +128,7 @@ void SurveyEditor::deleteSurvey()
return
;
emit
logMessage
(
QString
::
fromUtf8
(
reply
->
readAll
()));
m_surveyModel
->
reload
();
reply
->
deleteLater
();
});
}
...
...
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