refs #602, CWebDataServices and CCookieManager now part of CApplication

* New hint flag: DB data for the client will no longer be web loaded but fetched from cache whenever possible
* No public constructors for the 2 classes
* adjusted main
This commit is contained in:
Klaus Basan
2016-02-24 00:01:04 +01:00
committed by Mathew Sutcliffe
parent 4b7ba4f117
commit 65af7d87da
11 changed files with 54 additions and 71 deletions

View File

@@ -28,7 +28,9 @@ using namespace BlackGui;
int main(int argc, char *argv[])
{
QApplication qa(argc, argv);
Q_UNUSED(qa);
CGuiApplication a("swift mapping tool", CIcons::swiftDatabase48());
a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, BlackCore::CWebReaderFlags::FromDb);
a.start();
CSwiftData w;
w.show();

View File

@@ -32,8 +32,7 @@ using namespace BlackGui::Components;
CSwiftData::CSwiftData(QWidget *parent) :
QMainWindow(parent),
CIdentifiable(this),
ui(new Ui::CSwiftData),
m_webDataReader(new CWebDataServices(CWebReaderFlags::AllSwiftDbReaders, this))
ui(new Ui::CSwiftData)
{
ui->setupUi(this);
this->init();
@@ -58,7 +57,7 @@ void CSwiftData::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
this->performGracefulShutdown();
QApplication::exit();
sGui->exit();
}
void CSwiftData::ps_appendLogMessage(const CStatusMessage &message)
@@ -100,9 +99,9 @@ void CSwiftData::initLogDisplay()
void CSwiftData::initReaders()
{
Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader");
this->ui->comp_MainInfoArea->setProvider(this->m_webDataReader);
this->ui->comp_InfoBar->setProvider(this->m_webDataReader);
Q_ASSERT_X(sApp->getWebDataServices(), Q_FUNC_INFO, "Missing reader");
this->ui->comp_MainInfoArea->setProvider(sApp->getWebDataServices());
this->ui->comp_InfoBar->setProvider(sApp->getWebDataServices());
// web data will be read automatically when setup is syncronized
}
@@ -139,11 +138,7 @@ void CSwiftData::initMenu()
void CSwiftData::performGracefulShutdown()
{
if (this->m_webDataReader)
{
m_webDataReader->gracefulShutdown();
m_webDataReader = nullptr;
}
// void
}
void CSwiftData::displayConsole()

View File

@@ -72,7 +72,6 @@ private:
QScopedPointer<Ui::CSwiftData> ui;
BlackGui::CManagedStatusBar m_statusBar;
BlackCore::CWebDataServices *m_webDataReader = nullptr;
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this, &CSwiftData::ps_setupChanged}; //!< setup cache
BlackMisc::CData<BlackCore::Data::UpdateInfo> m_updateInfo { this }; //!< download / version data
};