DatabaseWidget::DatabaseWidget(QWidget *parent) : QWidget(parent), _ui(new Ui::DatabaseWidget), _csvFileName(DefaultBaseName), _thread(nullptr) { _ui->setupUi(this); _db = new Database; _thread = new QThread; _db->moveToThread(_thread); _thread->start(); connect(_db, SIGNAL(baseOpening()), this, SLOT(onBaseOpening())); connect(_db, SIGNAL(baseOpened()), this, SLOT(onBaseOpened())); connect(_db, SIGNAL(toDebug(QString,QString)), this, SIGNAL(toDebug(QString,QString))); connect(&_futureWatcher, SIGNAL(finished()), this, SLOT(onProcessOfOpenFinished())); connect(&_futureWatcherParser, SIGNAL(finished()), this, SLOT(onProcessOfParsingFinished())); _parser = new XlsParser; connect(_ui->comboBoxTypeFSubj, SIGNAL(activated(int)), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditFSubj, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditDistrict, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditTypeOfCity, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditTypeOfCity2, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditCity, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditCity2, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditTypeOfStreet, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditStreet, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditBuild, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditKorp, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditLiter, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->lineEditAdditional, SIGNAL(returnPressed()), this, SLOT(onFindButtonClicked())); connect(_ui->_lineEditAddress, SIGNAL(returnPressed()), this, SLOT(onParseButtonClicked())); connect(this, SIGNAL(selectAddress(Address)), _db, SLOT(selectAddress(Address))); connect(_db, SIGNAL(selectedRows(int)), this, SLOT(onSelectedRows(int))); connect(this, SIGNAL(updateModel()), _db, SLOT(updateTableModel())); _ui->_pushButtonDelete->hide(); }
void onResolveResult(const boost::system::error_code& error, iterator it, const shared_ptr<Resolver>& self) { m_scheduler.cancelEvent(m_resolveTimeout); // ensure the Resolver isn't destructed while callbacks are still pending, see #2653 m_resolver.get_io_service().post(bind([] (const shared_ptr<Resolver>&) {}, self)); if (error) { if (error == boost::asio::error::operation_aborted) return; if (m_onError) m_onError("Hostname cannot be resolved: " + error.message()); return; } it = selectAddress(it); if (it != iterator() && m_onSuccess) { m_onSuccess(it->endpoint().address()); } else if (m_onError) { m_onError("No endpoints match the specified address selector"); } }
iterator syncResolve(const query& q) { return selectAddress(m_resolver.resolve(q)); }