Fix warnings and dependencies

This commit is contained in:
eelke 2025-02-23 16:52:39 +01:00
parent 86a9a0d709
commit ee86327869
14 changed files with 38 additions and 43 deletions

View file

@ -1,4 +1,4 @@
The program is build with Qt 6.3 using QtCreator and the Visual Studio 2019 C++ compiler.
The program is build with Qt 6.8 using QtCreator and the Visual Studio 2022 C++ compiler.
Only 64-bits builds are actively maintained.
[Documentation](https://eelke.gitlab.io/pgLab/) is generated automatically when a commit is tagged. It also includes releasenotes.
@ -8,7 +8,6 @@ The release notes use collected from git using [reno](https://docs.openstack.org
- boost
- botan
- fmt
- googletest
- libpq

View file

@ -207,7 +207,7 @@ bool ConnectionController::retrieveFromPasswordManager(const std::string &passwo
password = m_passwordManager->decrypt(password_id, enc_password);
return true;
}
catch (const PasswordManagerException &ex)
catch (const PasswordManagerException &)
{
return false;
}

View file

@ -5,7 +5,6 @@
#include "catalog/PgDatabaseCatalog.h"
#include "catalog/PgDatabaseContainer.h"
#include "catalog/PgAuthIdContainer.h"
#include "ResultTableModelUtil.h"
#include <QtConcurrent>
#include "Pgsql_Connection.h"
@ -31,7 +30,7 @@ void DatabasesTableModel::setDatabaseList(std::shared_ptr<const PgDatabaseCatalo
for (const auto& d : *dats)
{
databases.emplace_back(d);
oidIndex.emplace(d.oid(), databases.size() - 1);
oidIndex.emplace(d.oid(), static_cast<int>(databases.size() - 1));
}
StartLoadDatabaseSizes(std::move(oidIndex));
}
@ -90,7 +89,7 @@ QVariant DatabasesTableModel::headerData(int section, Qt::Orientation orientatio
int DatabasesTableModel::rowCount(const QModelIndex &) const
{
int result = 0;
result = databases.size();
result = static_cast<int>(databases.size());
return result;
}

View file

@ -586,7 +586,9 @@ void QueryTool::generateCode()
{
QString command = getCommand();
if (resultList.empty()) {
QMessageBox::question(this, "pglab", tr("Please execute the query first"), QMessageBox::Ok);
QMessageBox::question(this, "pglab", tr("Please execute the query first"),
QMessageBox::StandardButtons(QMessageBox::Ok),
QMessageBox::Ok);
}
if (resultList.size() == 1) {
std::shared_ptr<const Pgsql::Result> dbres = resultList[0]->GetPgsqlResult();

View file

@ -263,7 +263,7 @@ void ASyncDBConnectionThread::waitForAndSendCommand()
{
WaitHandleList whl;
auto wait_result_new_command = whl.add(m_commandQueue.m_newEvent);
auto wait_result_stop = whl.add(m_stopEvent);
whl.add(m_stopEvent);
DWORD res = MsgWaitForMultipleObjectsEx(
whl.count(), // _In_ DWORD nCount,
@ -284,7 +284,6 @@ void ASyncDBConnectionThread::doNewCommand()
// get command from top of queue (but leave it in the queue, we need the callback)
if (! m_commandQueue.m_queue.empty()) {
const Command &command = m_commandQueue.m_queue.front();
bool query_send = false;
if (command.params.empty())
m_connection.sendQuery(command.command.c_str());
else

View file

@ -8,12 +8,12 @@ Json::Value ParamToJson(const Param &param)
return v;
}
Param ParamFromJson(const Json::Value &json)
{
Param p;
// Param ParamFromJson(const Json::Value &json)
// {
// Param p;
return p;
}
// return p;
// }
Json::Value ParamListToJson(const t_ParamList &list)
{
@ -24,14 +24,15 @@ Json::Value ParamListToJson(const t_ParamList &list)
return root;
}
t_ParamList ParamListFromJson(const Json::Value &json)
{
t_ParamList result;
if (json.isArray()) {
result.reserve(json.size());
for (auto &e : json) {
result.push_back(ParamFromJson(e));
}
}
return result;
}
// t_ParamList ParamListFromJson(const Json::Value &json)
// {
// t_ParamList result;
// if (json.isArray()) {
// result.reserve(json.size());
// for (auto &e : json) {
// result.push_back(ParamFromJson(e));
// }
// }
// return result;
//}

View file

@ -41,7 +41,7 @@ QVariant ParamListModel::headerData(int section, Qt::Orientation orientation, in
int ParamListModel::rowCount(const QModelIndex &) const
{
return m_paramList.size();
return static_cast<int>(m_paramList.size());
}
int ParamListModel::columnCount(const QModelIndex &) const

View file

@ -2,7 +2,7 @@
/**
*/
QString convert(QStringView in, ConvertToNumericEscape conversion, NumericEscapeFormat format, QString prefix)
{
return "TODO";
}
// QString convert(QStringView in, ConvertToNumericEscape conversion, NumericEscapeFormat format, QString prefix)
// {
// return "TODO";
// }

View file

@ -42,7 +42,7 @@ std::string HumanReadableBytes(uint64_t bytes)
};
std::ostringstream out;
for (int i = 0; i < (sizeof(scales) / sizeof(scale)); ++i)
for (unsigned int i = 0; i < (sizeof(scales) / sizeof(scale)); ++i)
{
if (bytes >= scales[i].scale)
{

View file

@ -44,10 +44,10 @@ void KeyStrengthener::saveParams(SQLiteConnection &db, const QString &table_name
+ "VALUES(?1, ?2, ?3, ?4, ?5, ?6, ?7)");
stmt.Bind(1, 1);
stmt.Bind(2, "Scrypt");
stmt.Bind(3, i1);
stmt.Bind(4, i2);
stmt.Bind(5, i3);
stmt.Bind(6, m_keySize);
stmt.Bind(3, (int)i1);
stmt.Bind(4, (int)i2);
stmt.Bind(5, (int)i3);
stmt.Bind(6, (int)m_keySize);
stmt.Bind(7, salt_str);
stmt.Step();
}

View file

@ -5,12 +5,8 @@
#include <libpq-fe.h>
#include <QString>
#include <vector>
#include <codecvt>
#include <memory>
#include <fmt/format.h>
#include "Pgsql_Canceller.h"
#include "Pgsql_Result.h"

View file

@ -116,7 +116,7 @@ void Params::clear()
void Params::appendValues(const t_paramValues &r)
{
const int n = static_cast<int>(r.size());
const int ofs = m_paramValues.size();
const size_t ofs = m_paramValues.size();
m_paramValues.reserve(ofs + n);
for (int i = 0; i < n; ++i) {
if (r[i]) {

View file

@ -128,7 +128,7 @@ Value::operator int64_t() const
if (m_val == nullptr)
return 0LL;
const int len = std::strlen(m_val);
const size_t len = std::strlen(m_val);
if (len > 0) {
char *endptr = nullptr;
int64_t result = std::strtoll(m_val, &endptr, 10);
@ -136,7 +136,6 @@ Value::operator int64_t() const
return result;
}
throw std::runtime_error("Value conversion to int64_t failed");
// return std::strtoll(m_val, nullptr, 10);
}
Value::operator bool() const

View file

@ -7,7 +7,7 @@
CONFIG += staticlib
QT += core
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = pgsql
TEMPLATE = lib