Remove unneeded headers and code.

This commit is contained in:
eelke 2019-01-06 08:17:37 +01:00
parent d6fce5c31f
commit d3c85722c7
2 changed files with 10 additions and 70 deletions

View file

@ -1,25 +1,19 @@
#include "DatabaseWindow.h" #include "DatabaseWindow.h"
#include "plugin_support/IPluginContentWidgetContext.h" #include "plugin_support/IPluginContentWidgetContext.h"
#include "TablesPage.h"
#include "FunctionsPage.h"
#include "SequencesPage.h"
#include "util.h" #include "util.h"
#include "CodeGenerator.h"
#include "MasterController.h" #include "MasterController.h"
#include "ScopeGuard.h"
#include "EditTableWidget.h"
#include "TaskExecutor.h" #include "TaskExecutor.h"
#include <QApplication> #include <QApplication>
#include <QCloseEvent>
#include <QElapsedTimer>
#include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QMetaMethod> #include <QMetaMethod>
#include <QMetaObject> #include <QTableView>
#include <QStandardPaths>
#include <QTextTable> // Pages that should become modules
#include <QVBoxLayout> #include "TablesPage.h"
#include <algorithm> #include "EditTableWidget.h"
#include "CodeGenerator.h"
#include "FunctionsPage.h"
#include "SequencesPage.h"
namespace pg = Pgsql; namespace pg = Pgsql;
@ -73,7 +67,6 @@ void DatabaseWindow::setConfig(const ConnectionConfig &config)
void DatabaseWindow::catalogLoaded() void DatabaseWindow::catalogLoaded()
{ {
try { try {
//SCOPE_EXIT { loadFuture = {}; };
m_database = loadWatcher.future().result(); m_database = loadWatcher.future().result();
auto ctx = context(); auto ctx = context();
ctx->registerObject(m_database); ctx->registerObject(m_database);
@ -128,46 +121,6 @@ void DatabaseWindow::on_actionAbout_triggered()
} }
void DatabaseWindow::closeEvent(QCloseEvent* /*event*/)
{
// TODO collect which files need saving
// std::vector<QString> files_to_save;
// int n = ui->tabWidget->count();
// for (int i = 0; i < n; ++i) {
// QWidget *w = ui->tabWidget->widget(i);
// QueryTab *qt = dynamic_cast<QueryTab*>(w);
// if (qt) {
// if (qt->isChanged()) {
// files_to_save.push_back(qt->fileName());
// }
// }
// }
// QString s;
// for (const auto& e : files_to_save) {
// s += e + "\n";
// }
// QMessageBox msgBox;
// msgBox.setIcon(QMessageBox::Warning);
// msgBox.setText("The following documents need to be saved");
// msgBox.setInformativeText(s);
// msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
// msgBox.setDefaultButton(QMessageBox::Cancel);
// //int ret =
// msgBox.exec();
}
void DatabaseWindow::showEvent(QShowEvent *event)
{
if (!event->spontaneous()) {
// m_queryTextChanged = false;
}
event->accept();
}
void DatabaseWindow::on_actionShow_connection_manager_triggered() void DatabaseWindow::on_actionShow_connection_manager_triggered()
{ {
m_masterController->showConnectionManager(); m_masterController->showConnectionManager();

View file

@ -1,24 +1,13 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
#include "ASyncDBConnection.h" #include "plugin_support/LMainWindow.h"
#include "ConnectionConfig.h" #include "ConnectionConfig.h"
#include "OpenDatabase.h" #include "OpenDatabase.h"
#include "plugin_support/LMainWindow.h"
#include <QRunnable>
#include <QSocketNotifier>
#include <memory>
#include <future>
#include "Pgsql_Connection.h" #include "Pgsql_Connection.h"
#include "ControllableTask.h" #include "ControllableTask.h"
#include <chrono>
#include <deque>
#include <mutex>
#include <QMutex>
#include <QWaitCondition>
#include <QFuture>
#include <QFutureWatcher> #include <QFutureWatcher>
#include <memory>
namespace Pgsql { namespace Pgsql {
class Connection; class Connection;
@ -72,8 +61,6 @@ private:
QFutureWatcher<LoadCatalog::Result> loadWatcher; QFutureWatcher<LoadCatalog::Result> loadWatcher;
void closeEvent(QCloseEvent *event);
void showEvent(QShowEvent *event);
void newCreateTablePage(); void newCreateTablePage();
private slots: private slots: