mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Fixed runtime issues reported by SonarQube.
This commit is contained in:
parent
3e00fe2b0f
commit
cf64e2c97c
@ -14,12 +14,16 @@
|
||||
|
||||
ConfigWindow::ConfigWindow(QWidget *parent) :
|
||||
QDialog(parent)
|
||||
{
|
||||
initConfigWindow();
|
||||
}
|
||||
|
||||
void ConfigWindow::initConfigWindow()
|
||||
{
|
||||
ui = new Ui::ConfigWindow;
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
void ConfigWindow::on_buttonBox_accepted()
|
||||
{
|
||||
this->close();
|
||||
|
@ -46,6 +46,7 @@ private slots:
|
||||
|
||||
private:
|
||||
Ui::ConfigWindow *ui;
|
||||
void initConfigWindow();
|
||||
};
|
||||
|
||||
#endif // CONFIGWINDOW_H
|
||||
|
@ -15,21 +15,15 @@
|
||||
|
||||
|
||||
FloatingWindow::FloatingWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
m_newAction(Q_NULLPTR),
|
||||
m_configAction(Q_NULLPTR),
|
||||
m_logAction(Q_NULLPTR),
|
||||
m_quitAction(Q_NULLPTR),
|
||||
m_floatingWindowMenu(Q_NULLPTR),
|
||||
m_menuActions(Q_NULLPTR)
|
||||
QMainWindow(parent)
|
||||
{
|
||||
ui = new Ui::FloatingWindow;
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
bool FloatingWindow::Init()
|
||||
{
|
||||
ui = new Ui::FloatingWindow;
|
||||
ui->setupUi(this);
|
||||
|
||||
// Creating Menu
|
||||
createMenu();
|
||||
|
||||
|
@ -40,11 +40,11 @@ private:
|
||||
void createActions();
|
||||
void closeEvent(QCloseEvent * event);
|
||||
|
||||
QAction *m_newAction;
|
||||
QAction *m_copyUrlAction;
|
||||
QAction *m_configAction;
|
||||
QAction *m_logAction;
|
||||
QAction *m_quitAction;
|
||||
QAction *m_newAction = Q_NULLPTR;
|
||||
QAction *m_copyUrlAction = Q_NULLPTR;
|
||||
QAction *m_configAction = Q_NULLPTR;
|
||||
QAction *m_logAction = Q_NULLPTR;
|
||||
QAction *m_quitAction = Q_NULLPTR;
|
||||
|
||||
QMenu *m_floatingWindowMenu;
|
||||
MenuActions *m_menuActions;
|
||||
|
@ -20,12 +20,16 @@
|
||||
LogWindow::LogWindow(QWidget *parent, QString serverLogFile) :
|
||||
QDialog(parent),
|
||||
m_serverLogFile(serverLogFile)
|
||||
{
|
||||
initLogWindow();
|
||||
}
|
||||
|
||||
void LogWindow::initLogWindow()
|
||||
{
|
||||
ui = new Ui::LogWindow;
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
||||
void LogWindow::LoadLog()
|
||||
{
|
||||
int startupLines;
|
||||
|
@ -36,6 +36,7 @@ private:
|
||||
QString m_startupLogFile;
|
||||
QString m_serverLogFile;
|
||||
|
||||
void initLogWindow();
|
||||
int readLog(QString logFile, QPlainTextEdit *logWidget);
|
||||
};
|
||||
|
||||
|
@ -15,14 +15,10 @@
|
||||
#include <QClipboard>
|
||||
#include <QMessageBox>
|
||||
|
||||
MenuActions::MenuActions():
|
||||
m_appServerUrl(""),
|
||||
m_logFile(""),
|
||||
m_logWindow(Q_NULLPTR)
|
||||
MenuActions::MenuActions()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void MenuActions::setAppServerUrl(QString appServerUrl)
|
||||
{
|
||||
m_appServerUrl = appServerUrl;
|
||||
|
@ -29,9 +29,9 @@ public:
|
||||
QString getAppServerUrl() { return m_appServerUrl; }
|
||||
|
||||
private:
|
||||
QString m_appServerUrl;
|
||||
QString m_logFile;
|
||||
LogWindow *m_logWindow;
|
||||
QString m_appServerUrl = "";
|
||||
QString m_logFile = "";
|
||||
LogWindow *m_logWindow = Q_NULLPTR;
|
||||
|
||||
protected slots:
|
||||
void onNew();
|
||||
|
@ -58,9 +58,7 @@ static void add_to_path(QString &python_path, QString path, bool prepend=false)
|
||||
Server::Server(quint16 port, QString key, QString logFileName):
|
||||
m_port(port),
|
||||
m_key(key),
|
||||
m_logFileName(logFileName),
|
||||
m_wcAppName(Q_NULLPTR),
|
||||
m_wcPythonHome(Q_NULLPTR)
|
||||
m_logFileName(logFileName)
|
||||
{
|
||||
// Initialise Python
|
||||
Py_NoSiteFlag=1;
|
||||
@ -81,7 +79,7 @@ Server::Server(quint16 port, QString key, QString logFileName):
|
||||
QString python_path = settings.value("PythonPath").toString();
|
||||
|
||||
// Get the application directory
|
||||
QString app_dir = qApp->applicationDirPath();
|
||||
QString app_dir = QCoreApplication::applicationDirPath();
|
||||
QString path_env = qgetenv("PATH");
|
||||
QString pythonHome;
|
||||
QStringList path_list;
|
||||
|
@ -46,11 +46,11 @@ private:
|
||||
QString m_logFileName;
|
||||
|
||||
// Application name in UTF-8 for Python
|
||||
wchar_t *m_wcAppName;
|
||||
wchar_t *m_wcAppName = Q_NULLPTR;
|
||||
QByteArray PGA_APP_NAME_UTF8;
|
||||
|
||||
// PythonHome for Python
|
||||
wchar_t *m_wcPythonHome;
|
||||
wchar_t *m_wcPythonHome = Q_NULLPTR;
|
||||
QByteArray pythonHome_utf8;
|
||||
};
|
||||
|
||||
|
@ -12,14 +12,7 @@
|
||||
// App headers
|
||||
#include "TrayIcon.h"
|
||||
|
||||
TrayIcon::TrayIcon():
|
||||
m_newAction(Q_NULLPTR),
|
||||
m_configAction(Q_NULLPTR),
|
||||
m_logAction(Q_NULLPTR),
|
||||
m_quitAction(Q_NULLPTR),
|
||||
m_trayIcon(Q_NULLPTR),
|
||||
m_trayIconMenu(Q_NULLPTR),
|
||||
m_menuActions(Q_NULLPTR)
|
||||
TrayIcon::TrayIcon()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -33,11 +33,11 @@ private:
|
||||
void createTrayIcon();
|
||||
void createActions();
|
||||
|
||||
QAction *m_newAction;
|
||||
QAction *m_copyUrlAction;
|
||||
QAction *m_configAction;
|
||||
QAction *m_logAction;
|
||||
QAction *m_quitAction;
|
||||
QAction *m_newAction = Q_NULLPTR;
|
||||
QAction *m_copyUrlAction = Q_NULLPTR;
|
||||
QAction *m_configAction = Q_NULLPTR;
|
||||
QAction *m_logAction = Q_NULLPTR;
|
||||
QAction *m_quitAction = Q_NULLPTR;
|
||||
|
||||
QSystemTrayIcon *m_trayIcon;
|
||||
QMenu *m_trayIconMenu;
|
||||
|
@ -233,9 +233,9 @@ int main(int argc, char * argv[])
|
||||
#if QT_VERSION >= 0x050000
|
||||
QTcpSocket socket;
|
||||
|
||||
#if QT_VERSION >= 0x050900
|
||||
#if QT_VERSION >= 0x050900
|
||||
socket.setProxy(QNetworkProxy::NoProxy);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
socket.bind(0, QTcpSocket::ShareAddress);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user