MemberDlg::MemberDlg(const QString &str):tableName(str)
{
    this->setAttribute(Qt::WA_DeleteOnClose);
    set_wnd_layout();
    createConnect();
    this->setWindowTitle(tr("家庭成员添加"));
}
Exemple #2
0
/*!
 *  \fn DWORD PMD::pmcheckwlan()
 *  \ingroup win32backend
 *  \public
 *  \brief Public function to encapsulate the checking of all WLAN interfaces.
 *  \retval 1 : At least one monitor mode card found.
 *  \retval 0 : No monitor mode cards found.
 *  \retval -1 : The process is broken.
 *  \retval -2 : Monitor mode found but could not be stopped.
 *  \retval -3 : Monitor mode found and stopped.
 */
DWORD PMD::pmcheckwlan() {
	
	DWORD rtn = -1;

	createConnect();
	setInterfaceList();

	
	for (pInterfaceList->dwIndex = 0; pInterfaceList->dwIndex < pInterfaceList->dwNumberOfItems; pInterfaceList->dwIndex++)
	{
		getInterfaceCapability();
		
		rtn = queryInterface();
		
		if (rtn == 1) {
			if (stopMonitorMode() == ERROR_SUCCESS) {
				printf ("Monitor mode stopped~\n");
				rtn = -3;
			}
			else  {
				printf ("Monitor mode failed to stop!\n");
				rtn = -2;
			}
			cleanup();
          	return rtn;
        }
		
	}
	
	cleanup();
	return rtn;
}
Exemple #3
0
TimerWindow::TimerWindow(QWidget *parent) :
    QWidget(parent)
{
#ifndef USE_DB_HELPER
    manager = new QNetworkAccessManager(this);
#endif
    initLayout();
    createTimer();
    createConnect();
    getWeekData();
}
    MYSQL *MysqlConnPool::getConnect() {
	std::lock_guard<std::recursive_mutex> rMutexGard(_lock);
	if (idleConn.empty()) {
	    if (!createConnect()) {
		return NULL;
	    }
	    CLOG(INFO) << "Create new sql connect to pool.";
	}
	MYSQL *ret = idleConn.back();
	idleConn.pop_back();
	return ret;
    }
Exemple #5
0
kXneurApp::frmSettings::frmSettings(QWidget *parent, kXneurApp::xNeurConfig *cfg) :  QDialog(parent),  ui(new Ui::frmSettings)
{
  ui->setupUi(this);
  setAttribute( Qt::WA_DeleteOnClose, true);
  ui->tabWidget->setCurrentIndex(0);
  cfgNeur = cfg;
  config = new KConfig("kdeneurrc");
  properties = config->group("Properties");
  settintgGrid();
  createConnect();
  readSettingsKdeNeur();
}
    bool MysqlConnPool::init()
    {
	/*Init db*/
	_mysqlHost = Config::getInstance().getDBHost();
	_userName = Config::getInstance().getDBUserName();
	_userPassword = Config::getInstance().getDBPassword();
	_databaseName = Config::getInstance().getDBName();
        _mysqlPort = Config::getInstance().getDBPort();
        _connPoolSize = Config::getInstance().getDBConnPoolSize();
	if (_connPoolSize > MAX_POOL_SIZE)
	{
	    _connPoolSize = MAX_POOL_SIZE;
	}

	for (int i = 0; i < _connPoolSize; ++i) {
	    if (!createConnect()) {
		return false;
	    }
	}
	_inited = true;
	return true;
    }