Fix warnings and dependencies
This commit is contained in:
parent
86a9a0d709
commit
ee86327869
14 changed files with 38 additions and 43 deletions
|
|
@ -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.
|
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.
|
[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
|
- boost
|
||||||
- botan
|
- botan
|
||||||
- fmt
|
|
||||||
- googletest
|
- googletest
|
||||||
- libpq
|
- libpq
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ bool ConnectionController::retrieveFromPasswordManager(const std::string &passwo
|
||||||
password = m_passwordManager->decrypt(password_id, enc_password);
|
password = m_passwordManager->decrypt(password_id, enc_password);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (const PasswordManagerException &ex)
|
catch (const PasswordManagerException &)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include "catalog/PgDatabaseCatalog.h"
|
#include "catalog/PgDatabaseCatalog.h"
|
||||||
#include "catalog/PgDatabaseContainer.h"
|
#include "catalog/PgDatabaseContainer.h"
|
||||||
#include "catalog/PgAuthIdContainer.h"
|
#include "catalog/PgAuthIdContainer.h"
|
||||||
#include "ResultTableModelUtil.h"
|
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include "Pgsql_Connection.h"
|
#include "Pgsql_Connection.h"
|
||||||
|
|
||||||
|
|
@ -31,7 +30,7 @@ void DatabasesTableModel::setDatabaseList(std::shared_ptr<const PgDatabaseCatalo
|
||||||
for (const auto& d : *dats)
|
for (const auto& d : *dats)
|
||||||
{
|
{
|
||||||
databases.emplace_back(d);
|
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));
|
StartLoadDatabaseSizes(std::move(oidIndex));
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +89,7 @@ QVariant DatabasesTableModel::headerData(int section, Qt::Orientation orientatio
|
||||||
int DatabasesTableModel::rowCount(const QModelIndex &) const
|
int DatabasesTableModel::rowCount(const QModelIndex &) const
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
result = databases.size();
|
result = static_cast<int>(databases.size());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -586,7 +586,9 @@ void QueryTool::generateCode()
|
||||||
{
|
{
|
||||||
QString command = getCommand();
|
QString command = getCommand();
|
||||||
if (resultList.empty()) {
|
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) {
|
if (resultList.size() == 1) {
|
||||||
std::shared_ptr<const Pgsql::Result> dbres = resultList[0]->GetPgsqlResult();
|
std::shared_ptr<const Pgsql::Result> dbres = resultList[0]->GetPgsqlResult();
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ void ASyncDBConnectionThread::waitForAndSendCommand()
|
||||||
{
|
{
|
||||||
WaitHandleList whl;
|
WaitHandleList whl;
|
||||||
auto wait_result_new_command = whl.add(m_commandQueue.m_newEvent);
|
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(
|
DWORD res = MsgWaitForMultipleObjectsEx(
|
||||||
whl.count(), // _In_ DWORD nCount,
|
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)
|
// get command from top of queue (but leave it in the queue, we need the callback)
|
||||||
if (! m_commandQueue.m_queue.empty()) {
|
if (! m_commandQueue.m_queue.empty()) {
|
||||||
const Command &command = m_commandQueue.m_queue.front();
|
const Command &command = m_commandQueue.m_queue.front();
|
||||||
bool query_send = false;
|
|
||||||
if (command.params.empty())
|
if (command.params.empty())
|
||||||
m_connection.sendQuery(command.command.c_str());
|
m_connection.sendQuery(command.command.c_str());
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ Json::Value ParamToJson(const Param ¶m)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
Param ParamFromJson(const Json::Value &json)
|
// Param ParamFromJson(const Json::Value &json)
|
||||||
{
|
// {
|
||||||
Param p;
|
// Param p;
|
||||||
|
|
||||||
return p;
|
// return p;
|
||||||
}
|
// }
|
||||||
|
|
||||||
Json::Value ParamListToJson(const t_ParamList &list)
|
Json::Value ParamListToJson(const t_ParamList &list)
|
||||||
{
|
{
|
||||||
|
|
@ -24,14 +24,15 @@ Json::Value ParamListToJson(const t_ParamList &list)
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
t_ParamList ParamListFromJson(const Json::Value &json)
|
// t_ParamList ParamListFromJson(const Json::Value &json)
|
||||||
{
|
// {
|
||||||
t_ParamList result;
|
// t_ParamList result;
|
||||||
if (json.isArray()) {
|
// if (json.isArray()) {
|
||||||
result.reserve(json.size());
|
// result.reserve(json.size());
|
||||||
for (auto &e : json) {
|
// for (auto &e : json) {
|
||||||
result.push_back(ParamFromJson(e));
|
// result.push_back(ParamFromJson(e));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return result;
|
// return result;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ QVariant ParamListModel::headerData(int section, Qt::Orientation orientation, in
|
||||||
|
|
||||||
int ParamListModel::rowCount(const QModelIndex &) const
|
int ParamListModel::rowCount(const QModelIndex &) const
|
||||||
{
|
{
|
||||||
return m_paramList.size();
|
return static_cast<int>(m_paramList.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
int ParamListModel::columnCount(const QModelIndex &) const
|
int ParamListModel::columnCount(const QModelIndex &) const
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
QString convert(QStringView in, ConvertToNumericEscape conversion, NumericEscapeFormat format, QString prefix)
|
// QString convert(QStringView in, ConvertToNumericEscape conversion, NumericEscapeFormat format, QString prefix)
|
||||||
{
|
// {
|
||||||
return "TODO";
|
// return "TODO";
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ std::string HumanReadableBytes(uint64_t bytes)
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostringstream out;
|
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)
|
if (bytes >= scales[i].scale)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,10 @@ void KeyStrengthener::saveParams(SQLiteConnection &db, const QString &table_name
|
||||||
+ "VALUES(?1, ?2, ?3, ?4, ?5, ?6, ?7)");
|
+ "VALUES(?1, ?2, ?3, ?4, ?5, ?6, ?7)");
|
||||||
stmt.Bind(1, 1);
|
stmt.Bind(1, 1);
|
||||||
stmt.Bind(2, "Scrypt");
|
stmt.Bind(2, "Scrypt");
|
||||||
stmt.Bind(3, i1);
|
stmt.Bind(3, (int)i1);
|
||||||
stmt.Bind(4, i2);
|
stmt.Bind(4, (int)i2);
|
||||||
stmt.Bind(5, i3);
|
stmt.Bind(5, (int)i3);
|
||||||
stmt.Bind(6, m_keySize);
|
stmt.Bind(6, (int)m_keySize);
|
||||||
stmt.Bind(7, salt_str);
|
stmt.Bind(7, salt_str);
|
||||||
stmt.Step();
|
stmt.Step();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,8 @@
|
||||||
#include <libpq-fe.h>
|
#include <libpq-fe.h>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <codecvt>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <fmt/format.h>
|
|
||||||
|
|
||||||
#include "Pgsql_Canceller.h"
|
#include "Pgsql_Canceller.h"
|
||||||
#include "Pgsql_Result.h"
|
#include "Pgsql_Result.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ void Params::clear()
|
||||||
void Params::appendValues(const t_paramValues &r)
|
void Params::appendValues(const t_paramValues &r)
|
||||||
{
|
{
|
||||||
const int n = static_cast<int>(r.size());
|
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);
|
m_paramValues.reserve(ofs + n);
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
if (r[i]) {
|
if (r[i]) {
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ Value::operator int64_t() const
|
||||||
if (m_val == nullptr)
|
if (m_val == nullptr)
|
||||||
return 0LL;
|
return 0LL;
|
||||||
|
|
||||||
const int len = std::strlen(m_val);
|
const size_t len = std::strlen(m_val);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
char *endptr = nullptr;
|
char *endptr = nullptr;
|
||||||
int64_t result = std::strtoll(m_val, &endptr, 10);
|
int64_t result = std::strtoll(m_val, &endptr, 10);
|
||||||
|
|
@ -136,7 +136,6 @@ Value::operator int64_t() const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
throw std::runtime_error("Value conversion to int64_t failed");
|
throw std::runtime_error("Value conversion to int64_t failed");
|
||||||
// return std::strtoll(m_val, nullptr, 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::operator bool() const
|
Value::operator bool() const
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
CONFIG += staticlib
|
CONFIG += staticlib
|
||||||
QT += core
|
QT += core
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
TARGET = pgsql
|
TARGET = pgsql
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue