本文整理汇总了C++中Firewall::getInt方法的典型用法代码示例。如果您正苦于以下问题:C++ Firewall::getInt方法的具体用法?C++ Firewall::getInt怎么用?C++ Firewall::getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Firewall
的用法示例。
在下文中一共展示了Firewall::getInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setFlags
void instDialog::setFlags(QTreeWidgetItem* item)
{
int obj_id = item->data(0, Qt::UserRole).toInt();
Firewall *fw = Firewall::cast(project->db()->findInIndex(obj_id));
QTreeWidgetItem* parent = item->parent();
time_t lm = fw->getInt("lastModified");
time_t lc = fw->getInt("lastCompiled");
time_t li = fw->getInt("lastInstalled");
QDateTime dt;
if (fwbdebug)
{
qDebug() << "instDialog::setFlags"
<< item->text(0)
<< "parent=" << parent
<< "fw=" << fw
<< "Firewall::isA(fw)=" << Firewall::isA(fw)
<< "lm=" << lm
<< "lc=" << lc
<< "li=" << li
<< "compile_only=" << compile_only;
qDebug() << "fw->needsCompile()" << fw->needsCompile()
<< "checkIfNeedToCompile(fw)=" << checkIfNeedToCompile(fw);
}
// need to skip the secondary cluster members if platform only
// allows installations on the primary (e.g. PIX). Note that
// platform attribute must be the same in the cluster and member
// firewalls objects. See #998
string platform = fw->getStr("platform");
bool install_only_on_primary_member = Resources::getTargetCapabilityBool(
platform, "install_only_on_primary");
Cluster *cluster = NULL;
FWObject *master_interface = NULL;
if (parent)
{
int obj_id = parent->data(0, Qt::UserRole).toInt();
cluster = Cluster::cast(project->db()->findInIndex(obj_id));
if (cluster)
{
FWObject *state_sync_group =
cluster->getFirstByType(StateSyncClusterGroup::TYPENAME);
// use state sync group to find which member firewall is
// master. This is only needed for platforms that install
// only on master (PIX at this time)
if (state_sync_group)
{
string master_id = state_sync_group->getStr("master_iface");
for (FWObjectTypedChildIterator grp_it =
state_sync_group->findByType(FWObjectReference::TYPENAME);
grp_it != grp_it.end(); ++grp_it)
{
FWObject *iface = FWObjectReference::getObject(*grp_it);
if (FWObjectDatabase::getStringId(iface->getId()) == master_id)
{
master_interface = iface;
break;
}
}
}
}
}
// Real firewalls get checkbox for install
if (Firewall::isA(fw))
{
bool checked = false;
if (!compile_only)
{
checked = checkIfNeedToInstall(fw);
if (cluster)
{
// override if checkIfNeedToCompile() is true for the
// parent cluster.
if (checkIfNeedToCompile(cluster))
{
checked = true;
}
}
item->setCheckState(INSTALL_CHECKBOX_COLUMN,
checked?Qt::Checked:Qt::Unchecked);
// If this platform requires installation only on
// the master, disable and uncheck checkbox for the standby.
if (install_only_on_primary_member && master_interface != NULL)
{
QString txt = item->text(0);
if (master_interface->isChildOf(fw))
{
// Master
item->setText(0, QString("%1 (master)").arg(txt));
} else
{
// Standby
item->setText(0, QString("%1 (standby)").arg(txt));
//.........这里部分代码省略.........