Fixed some warnings (left some because they need more attention)

This commit is contained in:
Eelke Klein 2017-02-02 07:22:54 +01:00
parent ccae3685ac
commit 468779ba38
6 changed files with 12 additions and 8 deletions

View file

@ -223,7 +223,8 @@ void ASyncDBConnection::Thread::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); //auto wait_result_stop =
whl.add(m_stopEvent);
DWORD res = MsgWaitForMultipleObjectsEx( DWORD res = MsgWaitForMultipleObjectsEx(
whl.count(), // _In_ DWORD nCount, whl.count(), // _In_ DWORD nCount,

View file

@ -158,7 +158,7 @@ Qt::ItemFlags ConnectionListModel::flags(const QModelIndex &index) const
{ {
Qt::ItemFlags result; Qt::ItemFlags result;
int row = index.row(); int row = index.row();
if (row >= 0 && row < m_connections.size()) { if (row >= 0 && row < (int)m_connections.size()) {
result = Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled; result = Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled;
} }
return result; return result;
@ -189,7 +189,7 @@ void ConnectionListModel::add(const ConnectionConfig &cfg)
Expected<ConnectionConfig> ConnectionListModel::get(int row) Expected<ConnectionConfig> ConnectionListModel::get(int row)
{ {
if (row >= 0 && row < m_connections.size()) { if (row >= 0 && row < (int)m_connections.size()) {
return m_connections.at(row).m_config; return m_connections.at(row).m_config;
} }
else { else {
@ -201,7 +201,7 @@ Expected<ConnectionConfig> ConnectionListModel::get(int row)
bool ConnectionListModel::removeRows(int row, int count, const QModelIndex &parent) bool ConnectionListModel::removeRows(int row, int count, const QModelIndex &parent)
{ {
bool result = false; bool result = false;
if (row >= 0 && row < m_connections.size()) { if (row >= 0 && row < (int)m_connections.size()) {
beginRemoveRows(parent, row, row + count -1); beginRemoveRows(parent, row, row + count -1);
SCOPE_EXIT { endRemoveRows(); }; SCOPE_EXIT { endRemoveRows(); };
@ -261,7 +261,7 @@ void ConnectionListModel::save()
void ConnectionListModel::save(int index) void ConnectionListModel::save(int index)
{ {
if (index >= 0 && index < m_connections.size()) { if (index >= 0 && index < (int)m_connections.size()) {
auto& e = m_connections[index]; auto& e = m_connections[index];
if (e.m_dirty) { if (e.m_dirty) {
QString file_name = iniFileName(); QString file_name = iniFileName();

View file

@ -50,7 +50,7 @@ void ConnectionManagerWindow::on_actionAdd_Connection_triggered()
} }
void ConnectionManagerWindow::on_currentChanged(const QModelIndex &current, void ConnectionManagerWindow::on_currentChanged(const QModelIndex &current,
const QModelIndex &previous) const QModelIndex &)
{ {
int currow = current.row(); int currow = current.row();
auto clm = m_masterController->getConnectionListModel(); auto clm = m_masterController->getConnectionListModel();

View file

@ -6,8 +6,9 @@ Expected<OpenDatabase*> OpenDatabase::createOpenDatabase(const ConnectionConfig
OpenDatabase *odb = new OpenDatabase(cfg, nullptr); OpenDatabase *odb = new OpenDatabase(cfg, nullptr);
if (odb->Init()) { if (odb->Init()) {
return odb;
} }
return odb;
//return Expected<ConnectionConfig>::fromException(std::out_of_range("Invalid row")); //return Expected<ConnectionConfig>::fromException(std::out_of_range("Invalid row"));
} }

View file

@ -206,7 +206,7 @@ int QueryExplainModel::rowCount(const QModelIndex &parent) const
return result; return result;
} }
int QueryExplainModel::columnCount(const QModelIndex &parent) const int QueryExplainModel::columnCount(const QModelIndex &) const
{ {
// if (parent.isValid()) { // if (parent.isValid()) {
// return 6;//static_cast<ExplainTreeModelItem*>(parent.internalPointer())->columnCount(); // return 6;//static_cast<ExplainTreeModelItem*>(parent.internalPointer())->columnCount();

View file

@ -4,6 +4,8 @@
#include <string> #include <string>
#include "explaintreemodelitem.h" #include "explaintreemodelitem.h"
/** \brief Model class for displaying the explain of a query in a tree like format.
*/
class QueryExplainModel : public QAbstractItemModel class QueryExplainModel : public QAbstractItemModel
{ {
Q_OBJECT Q_OBJECT