mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-20 18:27:16 +01:00
fixes #2216 regression: system groups appear with user group icons and are editable
This commit is contained in:
parent
821454988c
commit
6b7d1f5806
@ -546,7 +546,9 @@ string FWObject::getPath(bool relative, bool detailed) const
|
||||
p = p->getParent();
|
||||
}
|
||||
|
||||
return std::for_each(res.begin(), res.end(), pathAccumulator());
|
||||
string path = std::for_each(res.begin(), res.end(), pathAccumulator());
|
||||
if (relative && path[0] == '/') path.erase(0, 1);
|
||||
return path;
|
||||
}
|
||||
|
||||
const string& FWObject::getComment() const
|
||||
|
||||
@ -74,33 +74,8 @@
|
||||
using namespace std;
|
||||
using namespace libfwbuilder;
|
||||
|
||||
const char* standardFolders[] = {
|
||||
"Objects",
|
||||
"Objects/Addresses",
|
||||
"Objects/DNS Names",
|
||||
"Objects/Address Tables",
|
||||
"Objects/Address Ranges",
|
||||
"Objects/Groups",
|
||||
"Objects/Hosts",
|
||||
"Objects/Networks",
|
||||
|
||||
"Services",
|
||||
"Services/Custom",
|
||||
"Services/Groups",
|
||||
"Services/IP",
|
||||
"Services/ICMP",
|
||||
"Services/TCP",
|
||||
"Services/UDP",
|
||||
"Services/TagServices",
|
||||
"Services/Users",
|
||||
|
||||
"Firewalls",
|
||||
"Clusters",
|
||||
"Time",
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
QStringList FWBTree::standardFolders;
|
||||
QSet<QString> FWBTree::standardIDs;
|
||||
QMap<QString,QString> FWBTree::systemGroupTypes;
|
||||
QMap<QString,QString> FWBTree::systemGroupNames;
|
||||
@ -121,6 +96,33 @@ void FWBTree::init_statics()
|
||||
{
|
||||
if (systemGroupPaths.size() == 0)
|
||||
{
|
||||
// Names of the standard folders should be translatable.
|
||||
// Function isStandardFolder() takes this into account.
|
||||
|
||||
standardFolders << "Objects";
|
||||
standardFolders << "Objects/Addresses";
|
||||
standardFolders << "Objects/DNS Names";
|
||||
standardFolders << "Objects/Address Tables";
|
||||
standardFolders << "Objects/Address Ranges";
|
||||
standardFolders << "Objects/Groups";
|
||||
standardFolders << "Objects/Hosts";
|
||||
standardFolders << "Objects/Networks";
|
||||
|
||||
standardFolders << "Services";
|
||||
standardFolders << "Services/Custom";
|
||||
standardFolders << "Services/Groups";
|
||||
standardFolders << "Services/IP";
|
||||
standardFolders << "Services/ICMP";
|
||||
standardFolders << "Services/TCP";
|
||||
standardFolders << "Services/UDP";
|
||||
standardFolders << "Services/TagServices";
|
||||
standardFolders << "Services/Users";
|
||||
|
||||
standardFolders << "Firewalls";
|
||||
standardFolders << "Clusters";
|
||||
standardFolders << "Time";
|
||||
|
||||
|
||||
systemGroupPaths[Library::TYPENAME] = "";
|
||||
|
||||
systemGroupPaths[IPv4::TYPENAME] = "Objects/Addresses";
|
||||
@ -387,9 +389,7 @@ bool FWBTree::isSystem(FWObject *obj)
|
||||
bool FWBTree::isStandardFolder(FWObject *obj)
|
||||
{
|
||||
string path = obj->getPath(true); // relative path
|
||||
for (const char **cptr=standardFolders; *cptr!=NULL; cptr++)
|
||||
if (path== *cptr) return true;
|
||||
return false;
|
||||
return (standardFolders.contains(QString::fromUtf8(path.c_str())));
|
||||
}
|
||||
|
||||
bool FWBTree::isStandardId(FWObject *obj)
|
||||
|
||||
@ -42,6 +42,8 @@ namespace libfwbuilder {
|
||||
class FWBTree
|
||||
{
|
||||
|
||||
static QStringList standardFolders;
|
||||
|
||||
static QMap<QString,QString> systemGroupTypes;
|
||||
static QMap<QString,QString> systemGroupNames;
|
||||
static QMap<QString,QString> systemGroupPaths;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user