Deprecation Cleanup (#119)
* squash unused warning * Check QtVersion and use correct calls for (re)moved methods * QSqlQuery = is deprecated replaced with std::move Co-authored-by: Chris Rizzitello <crizzitello@ics.com>main
parent
129e84e319
commit
4e3ce893d2
|
@ -24,9 +24,13 @@ void TagWidget::setReadOnly(bool readonly) {
|
|||
}
|
||||
|
||||
void TagWidget::mouseReleaseEvent(QMouseEvent* evt) {
|
||||
#if(QT_VERSION_MAJOR > 5)
|
||||
const int x = evt->position().x();
|
||||
const int y = evt->position().y();
|
||||
#else
|
||||
const int x = evt->x();
|
||||
const int y = evt->y();
|
||||
|
||||
#endif
|
||||
if (removeArea.contains(x, y)) {
|
||||
emit removePressed();
|
||||
}
|
||||
|
|
|
@ -439,7 +439,7 @@ QSqlQuery DatabaseConnection::executeQuery(const QSqlDatabase& db, const QString
|
|||
if (!result.success) {
|
||||
throw result.err;
|
||||
}
|
||||
return result.query;
|
||||
return std::move(result.query);
|
||||
}
|
||||
|
||||
QueryResult DatabaseConnection::executeQueryNoThrow(const QSqlDatabase& db, const QString &stmt,
|
||||
|
@ -448,14 +448,14 @@ QueryResult DatabaseConnection::executeQueryNoThrow(const QSqlDatabase& db, cons
|
|||
|
||||
bool prepared = query.prepare(stmt);
|
||||
if (!prepared) {
|
||||
return QueryResult(query);
|
||||
return QueryResult(std::move(query));
|
||||
}
|
||||
for (const auto &arg : args) {
|
||||
query.addBindValue(arg);
|
||||
}
|
||||
|
||||
query.exec();
|
||||
return QueryResult(query);
|
||||
return QueryResult(std::move(query));
|
||||
}
|
||||
|
||||
// doInsert is a version of executeQuery that returns the last inserted id, rather than the
|
||||
|
|
|
@ -15,8 +15,8 @@ class QueryResult {
|
|||
public:
|
||||
QueryResult(){}
|
||||
QueryResult(QSqlQuery query) {
|
||||
this->query = query;
|
||||
this->err = query.lastError();
|
||||
this->query = std::move(query);
|
||||
this->success = err.type() == QSqlError::NoError;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ void PortingDialog::onSubmitPressed() {
|
|||
connect(executedManifest, &porting::SystemManifest::onStatusUpdate, portStatusLabel, &QLabel::setText);
|
||||
connect(this, &PortingDialog::onWorkComplete, this, &PortingDialog::onPortComplete);
|
||||
|
||||
QtConcurrent::run(portAction);
|
||||
std::ignore = QtConcurrent::run(portAction);
|
||||
}
|
||||
|
||||
void PortingDialog::onPortComplete(bool success) {
|
||||
|
|
|
@ -26,7 +26,9 @@ int main(int argc, char* argv[]) {
|
|||
Q_INIT_RESOURCE(res_icons);
|
||||
Q_INIT_RESOURCE(res_migrations);
|
||||
|
||||
#if (QT_VERSION_MAJOR < 6)
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
QCoreApplication::setApplicationName("ashirt");
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
Loading…
Reference in New Issue