mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -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) :
|
ConfigWindow::ConfigWindow(QWidget *parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
|
{
|
||||||
|
initConfigWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigWindow::initConfigWindow()
|
||||||
{
|
{
|
||||||
ui = new Ui::ConfigWindow;
|
ui = new Ui::ConfigWindow;
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ConfigWindow::on_buttonBox_accepted()
|
void ConfigWindow::on_buttonBox_accepted()
|
||||||
{
|
{
|
||||||
this->close();
|
this->close();
|
||||||
|
@ -46,6 +46,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ConfigWindow *ui;
|
Ui::ConfigWindow *ui;
|
||||||
|
void initConfigWindow();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFIGWINDOW_H
|
#endif // CONFIGWINDOW_H
|
||||||
|
@ -15,21 +15,15 @@
|
|||||||
|
|
||||||
|
|
||||||
FloatingWindow::FloatingWindow(QWidget *parent) :
|
FloatingWindow::FloatingWindow(QWidget *parent) :
|
||||||
QMainWindow(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)
|
|
||||||
{
|
{
|
||||||
ui = new Ui::FloatingWindow;
|
|
||||||
ui->setupUi(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FloatingWindow::Init()
|
bool FloatingWindow::Init()
|
||||||
{
|
{
|
||||||
|
ui = new Ui::FloatingWindow;
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
// Creating Menu
|
// Creating Menu
|
||||||
createMenu();
|
createMenu();
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ private:
|
|||||||
void createActions();
|
void createActions();
|
||||||
void closeEvent(QCloseEvent * event);
|
void closeEvent(QCloseEvent * event);
|
||||||
|
|
||||||
QAction *m_newAction;
|
QAction *m_newAction = Q_NULLPTR;
|
||||||
QAction *m_copyUrlAction;
|
QAction *m_copyUrlAction = Q_NULLPTR;
|
||||||
QAction *m_configAction;
|
QAction *m_configAction = Q_NULLPTR;
|
||||||
QAction *m_logAction;
|
QAction *m_logAction = Q_NULLPTR;
|
||||||
QAction *m_quitAction;
|
QAction *m_quitAction = Q_NULLPTR;
|
||||||
|
|
||||||
QMenu *m_floatingWindowMenu;
|
QMenu *m_floatingWindowMenu;
|
||||||
MenuActions *m_menuActions;
|
MenuActions *m_menuActions;
|
||||||
|
@ -20,12 +20,16 @@
|
|||||||
LogWindow::LogWindow(QWidget *parent, QString serverLogFile) :
|
LogWindow::LogWindow(QWidget *parent, QString serverLogFile) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
m_serverLogFile(serverLogFile)
|
m_serverLogFile(serverLogFile)
|
||||||
|
{
|
||||||
|
initLogWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogWindow::initLogWindow()
|
||||||
{
|
{
|
||||||
ui = new Ui::LogWindow;
|
ui = new Ui::LogWindow;
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LogWindow::LoadLog()
|
void LogWindow::LoadLog()
|
||||||
{
|
{
|
||||||
int startupLines;
|
int startupLines;
|
||||||
|
@ -36,6 +36,7 @@ private:
|
|||||||
QString m_startupLogFile;
|
QString m_startupLogFile;
|
||||||
QString m_serverLogFile;
|
QString m_serverLogFile;
|
||||||
|
|
||||||
|
void initLogWindow();
|
||||||
int readLog(QString logFile, QPlainTextEdit *logWidget);
|
int readLog(QString logFile, QPlainTextEdit *logWidget);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,14 +15,10 @@
|
|||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
MenuActions::MenuActions():
|
MenuActions::MenuActions()
|
||||||
m_appServerUrl(""),
|
|
||||||
m_logFile(""),
|
|
||||||
m_logWindow(Q_NULLPTR)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MenuActions::setAppServerUrl(QString appServerUrl)
|
void MenuActions::setAppServerUrl(QString appServerUrl)
|
||||||
{
|
{
|
||||||
m_appServerUrl = appServerUrl;
|
m_appServerUrl = appServerUrl;
|
||||||
|
@ -29,9 +29,9 @@ public:
|
|||||||
QString getAppServerUrl() { return m_appServerUrl; }
|
QString getAppServerUrl() { return m_appServerUrl; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_appServerUrl;
|
QString m_appServerUrl = "";
|
||||||
QString m_logFile;
|
QString m_logFile = "";
|
||||||
LogWindow *m_logWindow;
|
LogWindow *m_logWindow = Q_NULLPTR;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void onNew();
|
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):
|
Server::Server(quint16 port, QString key, QString logFileName):
|
||||||
m_port(port),
|
m_port(port),
|
||||||
m_key(key),
|
m_key(key),
|
||||||
m_logFileName(logFileName),
|
m_logFileName(logFileName)
|
||||||
m_wcAppName(Q_NULLPTR),
|
|
||||||
m_wcPythonHome(Q_NULLPTR)
|
|
||||||
{
|
{
|
||||||
// Initialise Python
|
// Initialise Python
|
||||||
Py_NoSiteFlag=1;
|
Py_NoSiteFlag=1;
|
||||||
@ -81,7 +79,7 @@ Server::Server(quint16 port, QString key, QString logFileName):
|
|||||||
QString python_path = settings.value("PythonPath").toString();
|
QString python_path = settings.value("PythonPath").toString();
|
||||||
|
|
||||||
// Get the application directory
|
// Get the application directory
|
||||||
QString app_dir = qApp->applicationDirPath();
|
QString app_dir = QCoreApplication::applicationDirPath();
|
||||||
QString path_env = qgetenv("PATH");
|
QString path_env = qgetenv("PATH");
|
||||||
QString pythonHome;
|
QString pythonHome;
|
||||||
QStringList path_list;
|
QStringList path_list;
|
||||||
|
@ -46,11 +46,11 @@ private:
|
|||||||
QString m_logFileName;
|
QString m_logFileName;
|
||||||
|
|
||||||
// Application name in UTF-8 for Python
|
// Application name in UTF-8 for Python
|
||||||
wchar_t *m_wcAppName;
|
wchar_t *m_wcAppName = Q_NULLPTR;
|
||||||
QByteArray PGA_APP_NAME_UTF8;
|
QByteArray PGA_APP_NAME_UTF8;
|
||||||
|
|
||||||
// PythonHome for Python
|
// PythonHome for Python
|
||||||
wchar_t *m_wcPythonHome;
|
wchar_t *m_wcPythonHome = Q_NULLPTR;
|
||||||
QByteArray pythonHome_utf8;
|
QByteArray pythonHome_utf8;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,14 +12,7 @@
|
|||||||
// App headers
|
// App headers
|
||||||
#include "TrayIcon.h"
|
#include "TrayIcon.h"
|
||||||
|
|
||||||
TrayIcon::TrayIcon():
|
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)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,11 +33,11 @@ private:
|
|||||||
void createTrayIcon();
|
void createTrayIcon();
|
||||||
void createActions();
|
void createActions();
|
||||||
|
|
||||||
QAction *m_newAction;
|
QAction *m_newAction = Q_NULLPTR;
|
||||||
QAction *m_copyUrlAction;
|
QAction *m_copyUrlAction = Q_NULLPTR;
|
||||||
QAction *m_configAction;
|
QAction *m_configAction = Q_NULLPTR;
|
||||||
QAction *m_logAction;
|
QAction *m_logAction = Q_NULLPTR;
|
||||||
QAction *m_quitAction;
|
QAction *m_quitAction = Q_NULLPTR;
|
||||||
|
|
||||||
QSystemTrayIcon *m_trayIcon;
|
QSystemTrayIcon *m_trayIcon;
|
||||||
QMenu *m_trayIconMenu;
|
QMenu *m_trayIconMenu;
|
||||||
|
Loading…
Reference in New Issue
Block a user