mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-21 18:57:14 +01:00
Merge branch 'development' of ssh://git@vc.netcitadel.com:2222/var/git/fwbuilder into development
This commit is contained in:
commit
959a10535d
2
VERSION
2
VERSION
@ -7,7 +7,7 @@ FWB_MICRO_VERSION=0
|
|||||||
# build number is like "nano" version number. I am incrementing build
|
# build number is like "nano" version number. I am incrementing build
|
||||||
# number during development cycle
|
# number during development cycle
|
||||||
#
|
#
|
||||||
BUILD_NUM="3447"
|
BUILD_NUM="3448"
|
||||||
|
|
||||||
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"
|
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
#define VERSION "4.2.0.3447"
|
#define VERSION "4.2.0.3448"
|
||||||
#define GENERATION "4.2"
|
#define GENERATION "4.2"
|
||||||
|
|||||||
@ -1,3 +1,10 @@
|
|||||||
|
2011-01-26 Vadim Kurland <vadim@netcitadel.com>
|
||||||
|
|
||||||
|
* init.cpp (init): fixed #1989 "variables respath and librespath
|
||||||
|
are redundant and copy Constants::getTemplateDirectory()". Got rid
|
||||||
|
of global variables sysfname, tempfname, librespath, respath and
|
||||||
|
localepath; will now use class Constants to keep this information.
|
||||||
|
|
||||||
2011-01-25 vadim <vadim@netcitadel.com>
|
2011-01-25 vadim <vadim@netcitadel.com>
|
||||||
|
|
||||||
* src/fwbuilder/libfwbuilder-config.h.in: fixes #1937 "RES_DIR
|
* src/fwbuilder/libfwbuilder-config.h.in: fixes #1937 "RES_DIR
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
%define name fwbuilder
|
%define name fwbuilder
|
||||||
%define version 4.2.0.3447
|
%define version 4.2.0.3448
|
||||||
%define release 1
|
%define release 1
|
||||||
|
|
||||||
%if "%_vendor" == "MandrakeSoft"
|
%if "%_vendor" == "MandrakeSoft"
|
||||||
|
|||||||
@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Section: checkinstall
|
Section: checkinstall
|
||||||
Maintainer: vadim@fwbuilder.org
|
Maintainer: vadim@fwbuilder.org
|
||||||
Version: 4.2.0.3447-1
|
Version: 4.2.0.3448-1
|
||||||
Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15
|
Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15
|
||||||
Description: Firewall Builder GUI and policy compilers
|
Description: Firewall Builder GUI and policy compilers
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
%define name fwbuilder
|
%define name fwbuilder
|
||||||
%define version 4.2.0.3447
|
%define version 4.2.0.3448
|
||||||
%define release 1
|
%define release 1
|
||||||
|
|
||||||
%if "%_vendor" == "MandrakeSoft"
|
%if "%_vendor" == "MandrakeSoft"
|
||||||
|
|||||||
@ -13,17 +13,13 @@
|
|||||||
#include "fwbuilder/Tools.h"
|
#include "fwbuilder/Tools.h"
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
#include "fwbuilder/Constants.h"
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include "commoninit.h"
|
#include "commoninit.h"
|
||||||
|
|
||||||
|
|
||||||
// TODO: switch to QString
|
// TODO: switch to QString
|
||||||
std::string appRootDir;
|
std::string appRootDir;
|
||||||
std::string userDataDir;
|
std::string userDataDir;
|
||||||
std::string respath;
|
|
||||||
std::string localepath;
|
|
||||||
std::string librespath;
|
|
||||||
std::string sysfname;
|
|
||||||
std::string tempfname;
|
|
||||||
std::string argv0;
|
std::string argv0;
|
||||||
std::string ee;
|
std::string ee;
|
||||||
|
|
||||||
@ -54,20 +50,11 @@ void init(char * const*)
|
|||||||
|
|
||||||
/* On Unix RES_DIR and LIBFWBUILDER_TEMPLATE_DIR are absolute paths */
|
/* On Unix RES_DIR and LIBFWBUILDER_TEMPLATE_DIR are absolute paths */
|
||||||
|
|
||||||
if (respath=="") respath = Constants::getTemplateDirectory();
|
|
||||||
librespath = Constants::getTemplateDirectory();
|
|
||||||
|
|
||||||
libfwbuilder::init();
|
libfwbuilder::init();
|
||||||
|
|
||||||
/* need argv0 for built-in installer on unix and mac */
|
/* need argv0 for built-in installer on unix and mac */
|
||||||
argv0 = appRootDir + FS_SEPARATOR + "fwbuilder";
|
argv0 = appRootDir + FS_SEPARATOR + "fwbuilder";
|
||||||
|
|
||||||
sysfname = respath + FS_SEPARATOR + "objects_init.xml";
|
|
||||||
tempfname = respath+ FS_SEPARATOR + "templates.xml";
|
|
||||||
|
|
||||||
/* define localepath the same way as we define PKGLOCALEDIR in qmake.inc */
|
|
||||||
localepath = respath + "/locale";
|
|
||||||
|
|
||||||
/* default directory where the user may want to save files */
|
/* default directory where the user may want to save files */
|
||||||
userDataDir = string(getenv("HOME"));
|
userDataDir = string(getenv("HOME"));
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "fwbuilder/FWObject.h"
|
#include "fwbuilder/FWObject.h"
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
@ -38,7 +39,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
extern std::string respath;
|
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -133,7 +133,8 @@ bool Configlet::reload(const std::string &_prefix, const QString &file_name)
|
|||||||
QString Configlet::getFullPath(const QString &path)
|
QString Configlet::getFullPath(const QString &path)
|
||||||
{
|
{
|
||||||
if (QDir::isRelativePath(path))
|
if (QDir::isRelativePath(path))
|
||||||
return QString(respath.c_str()) + "/configlets/" + path;
|
return QString(Constants::getResourcesDirectory().c_str()) +
|
||||||
|
"/configlets/" + path;
|
||||||
else
|
else
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,8 @@ extern int errno;
|
|||||||
#include "fwbuilder/TagService.h"
|
#include "fwbuilder/TagService.h"
|
||||||
#include "fwbuilder/UserService.h"
|
#include "fwbuilder/UserService.h"
|
||||||
|
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include "../common/init.cpp"
|
#include "../common/init.cpp"
|
||||||
|
|
||||||
#include "fwbedit.h"
|
#include "fwbedit.h"
|
||||||
@ -562,9 +564,7 @@ int main(int argc, char * const *argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new Resources(respath+FS_SEPARATOR+"resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
//new Resources(respath); // creates singleton Resources::global_res
|
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -572,7 +572,7 @@ int main(int argc, char * const *argv)
|
|||||||
/* load the data file */
|
/* load the data file */
|
||||||
UpgradePredicate upgrade_predicate(autoupgrade_flag);
|
UpgradePredicate upgrade_predicate(autoupgrade_flag);
|
||||||
|
|
||||||
objdb->load(filename, &upgrade_predicate, librespath);
|
objdb->load(filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
if (cmd == MERGE)
|
if (cmd == MERGE)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -83,5 +83,4 @@ extern void findObjects(const std::string &obj_path,
|
|||||||
extern bool getBool(std::string s);
|
extern bool getBool(std::string s);
|
||||||
extern void usage();
|
extern void usage();
|
||||||
|
|
||||||
extern std::string librespath;
|
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
#include "fwbuilder/ObjectGroup.h"
|
#include "fwbuilder/ObjectGroup.h"
|
||||||
#include "fwbuilder/ServiceGroup.h"
|
#include "fwbuilder/ServiceGroup.h"
|
||||||
#include "fwbuilder/IntervalGroup.h"
|
#include "fwbuilder/IntervalGroup.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include "fwbedit.h"
|
#include "fwbedit.h"
|
||||||
#include "upgradePredicate.h"
|
#include "upgradePredicate.h"
|
||||||
@ -61,7 +62,7 @@ void mergeTree(FWObjectDatabase *objdb, const string &mergefile, int conflict_re
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(mergefile, &upgrade_predicate, librespath);
|
ndb->load(mergefile, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
FWObject *dobj = ndb->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
FWObject *dobj = ndb->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
||||||
if (dobj) ndb->remove(dobj, false);
|
if (dobj) ndb->remove(dobj, false);
|
||||||
|
|||||||
@ -70,6 +70,8 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_WS_MAC)
|
#if defined(Q_WS_MAC)
|
||||||
extern void connectOdocHandler();
|
extern void connectOdocHandler();
|
||||||
@ -186,7 +188,7 @@ int main( int argc, char *argv[] )
|
|||||||
|
|
||||||
INIT2;
|
INIT2;
|
||||||
|
|
||||||
string full_res_path = respath + FS_SEPARATOR + "resources.xml";
|
string full_res_path = Constants::getResourcesFilePath();
|
||||||
|
|
||||||
if (fwbdebug)
|
if (fwbdebug)
|
||||||
{
|
{
|
||||||
@ -232,7 +234,7 @@ int main( int argc, char *argv[] )
|
|||||||
QString local = QLocale::system().name();//"en_US";//
|
QString local = QLocale::system().name();//"en_US";//
|
||||||
QTranslator translator(0);
|
QTranslator translator(0);
|
||||||
translator.load(QLatin1String("fwbuilder_") +
|
translator.load(QLatin1String("fwbuilder_") +
|
||||||
QString(local), localepath.c_str());
|
QString(local), Constants::getLocaleDirectory().c_str());
|
||||||
app->installTranslator (&translator);
|
app->installTranslator (&translator);
|
||||||
|
|
||||||
QString qt_resource_dir =
|
QString qt_resource_dir =
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/Tools.h"
|
#include "fwbuilder/Tools.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -109,12 +110,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -138,7 +133,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new Resources(respath+FS_SEPARATOR+"resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -149,7 +144,7 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( filename, &upgrade_predicate, librespath);
|
objdb->load( filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,7 @@
|
|||||||
#include "fwbuilder/Cluster.h"
|
#include "fwbuilder/Cluster.h"
|
||||||
#include "fwbuilder/Firewall.h"
|
#include "fwbuilder/Firewall.h"
|
||||||
#include "fwbuilder/Interface.h"
|
#include "fwbuilder/Interface.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -118,12 +119,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -146,7 +141,7 @@ int main(int argc, char **argv)
|
|||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new Resources(respath + FS_SEPARATOR + "resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -157,10 +152,11 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( Constants::getStandardObjectsFilePath(),
|
||||||
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName("");
|
objdb->setFileName("");
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(filename, &upgrade_predicate, librespath);
|
ndb->load(filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->merge(ndb, NULL);
|
objdb->merge(ndb, NULL);
|
||||||
delete ndb;
|
delete ndb;
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/Cluster.h"
|
#include "fwbuilder/Cluster.h"
|
||||||
#include "fwbuilder/Firewall.h"
|
#include "fwbuilder/Firewall.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -114,12 +115,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -142,7 +137,7 @@ int main(int argc, char **argv)
|
|||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new Resources(respath+FS_SEPARATOR+"resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -153,10 +148,11 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( Constants::getStandardObjectsFilePath(),
|
||||||
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName("");
|
objdb->setFileName("");
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(filename, &upgrade_predicate, librespath);
|
ndb->load(filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->merge(ndb, NULL);
|
objdb->merge(ndb, NULL);
|
||||||
delete ndb;
|
delete ndb;
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -94,12 +95,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -127,7 +122,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -139,7 +134,7 @@ int main(int argc, char **argv)
|
|||||||
cerr << flush;
|
cerr << flush;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( filename, &upgrade_predicate, librespath);
|
objdb->load( filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
Author: Vadim Zaliva lord@crocodile.org
|
Author: Vadim Zaliva lord@crocodile.org
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
|
|
||||||
This program is free software which we release under the GNU General Public
|
This program is free software which we release under the GNU General Public
|
||||||
License. You may redistribute and/or modify this program under the terms
|
License. You may redistribute and/or modify this program under the terms
|
||||||
of that license as published by the Free Software Foundation; either
|
of that license as published by the Free Software Foundation; either
|
||||||
@ -31,6 +28,14 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
|
|
||||||
|
string Constants::res_dir;
|
||||||
|
|
||||||
|
void Constants::init(const std::string &app_root_dir)
|
||||||
|
{
|
||||||
|
if (app_root_dir.empty()) res_dir = string(RES_DIR);
|
||||||
|
else res_dir = app_root_dir + FS_SEPARATOR + string(RES_DIR);
|
||||||
|
}
|
||||||
|
|
||||||
const string Constants::getLibraryDescription()
|
const string Constants::getLibraryDescription()
|
||||||
{
|
{
|
||||||
return "Firewall Builder API ";
|
return "Firewall Builder API ";
|
||||||
@ -50,3 +55,36 @@ const string Constants::getTemplateDirectory()
|
|||||||
{
|
{
|
||||||
return string(RES_DIR);
|
return string(RES_DIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Constants::getDTDDirectory()
|
||||||
|
{
|
||||||
|
if (res_dir.empty()) init("");
|
||||||
|
return res_dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
string Constants::getResourcesDirectory()
|
||||||
|
{
|
||||||
|
if (res_dir.empty()) init("");
|
||||||
|
return res_dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
string Constants::getResourcesFilePath()
|
||||||
|
{
|
||||||
|
return getResourcesDirectory() + FS_SEPARATOR + "resources.xml";
|
||||||
|
}
|
||||||
|
|
||||||
|
string Constants::getStandardObjectsFilePath()
|
||||||
|
{
|
||||||
|
return getResourcesDirectory() + FS_SEPARATOR + "objects_init.xml";
|
||||||
|
}
|
||||||
|
|
||||||
|
string Constants::getTemplatesObjectsFilePath()
|
||||||
|
{
|
||||||
|
return getResourcesDirectory() + FS_SEPARATOR + "templates.xml";
|
||||||
|
}
|
||||||
|
|
||||||
|
string Constants::getLocaleDirectory()
|
||||||
|
{
|
||||||
|
return getResourcesDirectory() + "/locale";
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
Author: Vadim Zaliva lord@crocodile.org
|
Author: Vadim Zaliva lord@crocodile.org
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
|
|
||||||
This program is free software which we release under the GNU General Public
|
This program is free software which we release under the GNU General Public
|
||||||
License. You may redistribute and/or modify this program under the terms
|
License. You may redistribute and/or modify this program under the terms
|
||||||
of that license as published by the Free Software Foundation; either
|
of that license as published by the Free Software Foundation; either
|
||||||
@ -40,7 +37,11 @@ namespace libfwbuilder
|
|||||||
*/
|
*/
|
||||||
class Constants
|
class Constants
|
||||||
{
|
{
|
||||||
public:
|
static std::string res_dir;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
static void init(const std::string &app_root_dir);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns library's description
|
* Returns library's description
|
||||||
@ -61,6 +62,38 @@ class Constants
|
|||||||
* Returns directory in which library stores it's data files.
|
* Returns directory in which library stores it's data files.
|
||||||
*/
|
*/
|
||||||
static const std::string getTemplateDirectory();
|
static const std::string getTemplateDirectory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns directory where we install XML DTD file
|
||||||
|
*/
|
||||||
|
static std::string getDTDDirectory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns directory where we install resources
|
||||||
|
*/
|
||||||
|
static std::string getResourcesDirectory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns full path to the resources file
|
||||||
|
*/
|
||||||
|
static std::string getResourcesFilePath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns full path to the standard objects library file
|
||||||
|
*/
|
||||||
|
static std::string getStandardObjectsFilePath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns full path to the prepackaged firewall template objects file
|
||||||
|
*/
|
||||||
|
static std::string getTemplatesObjectsFilePath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns full path to the directory where we install locale files
|
||||||
|
*/
|
||||||
|
static std::string getLocaleDirectory();
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/Firewall.h"
|
#include "fwbuilder/Firewall.h"
|
||||||
#include "fwbuilder/RuleSet.h"
|
#include "fwbuilder/RuleSet.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
@ -279,7 +280,8 @@ void FWWindow::printFirewallFromFile(QString fileName,
|
|||||||
QPrinter *printer = new QPrinter(QPrinter::HighResolution);
|
QPrinter *printer = new QPrinter(QPrinter::HighResolution);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
objdb->load(fileName.toLatin1().constData(), &up, librespath);
|
objdb->load(fileName.toLatin1().constData(), &up,
|
||||||
|
Constants::getDTDDirectory());
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include "Help.h"
|
#include "Help.h"
|
||||||
#include "FWWindow.h"
|
#include "FWWindow.h"
|
||||||
|
|
||||||
@ -36,6 +38,8 @@
|
|||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace libfwbuilder;
|
||||||
|
|
||||||
|
|
||||||
Help* Help::help_window = NULL;
|
Help* Help::help_window = NULL;
|
||||||
|
|
||||||
@ -56,8 +60,10 @@ Help::Help(QWidget *, const QString &title, bool _load_links_in_browser) :
|
|||||||
QString locale = QLocale::system().name(); //"en_US";
|
QString locale = QLocale::system().name(); //"en_US";
|
||||||
|
|
||||||
// Set up path to help qtextBrowser find contents, such as files for <img>
|
// Set up path to help qtextBrowser find contents, such as files for <img>
|
||||||
paths.append(QString(respath.c_str()) + "/help/" + locale);
|
paths.append(QString(Constants::getResourcesDirectory().c_str()) +
|
||||||
paths.append(QString(respath.c_str()) + "/help/" + "en_US");
|
"/help/" + locale);
|
||||||
|
paths.append(QString(Constants::getResourcesDirectory().c_str()) +
|
||||||
|
"/help/" + "en_US");
|
||||||
m_dialog->textview->setSearchPaths(paths);
|
m_dialog->textview->setSearchPaths(paths);
|
||||||
m_dialog->textview->setOpenLinks(true);
|
m_dialog->textview->setOpenLinks(true);
|
||||||
m_dialog->textview->setOpenExternalLinks(true);
|
m_dialog->textview->setOpenExternalLinks(true);
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
#include <fwbuilder/Rule.h>
|
#include <fwbuilder/Rule.h>
|
||||||
#include <fwbuilder/Interface.h>
|
#include <fwbuilder/Interface.h>
|
||||||
#include <fwbuilder/Library.h>
|
#include <fwbuilder/Library.h>
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include "ProjectPanel.h"
|
#include "ProjectPanel.h"
|
||||||
|
|
||||||
@ -476,7 +477,7 @@ void ProjectPanel::fileCompare()
|
|||||||
{
|
{
|
||||||
db1 = new FWObjectDatabase();
|
db1 = new FWObjectDatabase();
|
||||||
db1->load(fname1.toLocal8Bit().constData(),
|
db1->load(fname1.toLocal8Bit().constData(),
|
||||||
&upgrade_predicate, librespath);
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
dobj = db1->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
dobj = db1->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
||||||
if (dobj) db1->remove(dobj, false);
|
if (dobj) db1->remove(dobj, false);
|
||||||
@ -495,7 +496,7 @@ void ProjectPanel::fileCompare()
|
|||||||
{
|
{
|
||||||
db2 = new FWObjectDatabase();
|
db2 = new FWObjectDatabase();
|
||||||
db2->load(fname2.toLocal8Bit().constData(),
|
db2->load(fname2.toLocal8Bit().constData(),
|
||||||
&upgrade_predicate, librespath);
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
dobj = db2->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
dobj = db2->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
||||||
if (dobj) db2->remove(dobj, false);
|
if (dobj) db2->remove(dobj, false);
|
||||||
@ -847,7 +848,7 @@ FWObject* ProjectPanel::loadLibrary(const string &libfpath)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(libfpath, &upgrade_predicate, librespath);
|
ndb->load(libfpath, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
FWObject *dobj = ndb->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
FWObject *dobj = ndb->findInIndex(FWObjectDatabase::DELETED_OBJECTS_ID);
|
||||||
if (dobj) ndb->remove(dobj, false);
|
if (dobj) ndb->remove(dobj, false);
|
||||||
@ -940,9 +941,11 @@ void ProjectPanel::loadStandardObjects()
|
|||||||
|
|
||||||
// always load system objects
|
// always load system objects
|
||||||
if (fwbdebug)
|
if (fwbdebug)
|
||||||
qDebug("ProjectPanel::load(): sysfname = %s", sysfname.c_str());
|
qDebug("ProjectPanel::load(): sysfname = %s",
|
||||||
|
Constants::getStandardObjectsFilePath().c_str());
|
||||||
|
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( Constants::getStandardObjectsFilePath(),
|
||||||
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName("");
|
objdb->setFileName("");
|
||||||
|
|
||||||
if (fwbdebug) qDebug("ProjectPanel::load(): create User library");
|
if (fwbdebug) qDebug("ProjectPanel::load(): create User library");
|
||||||
@ -1012,7 +1015,8 @@ bool ProjectPanel::loadFromRCS(RCS *_rcs)
|
|||||||
// always loading system objects
|
// always loading system objects
|
||||||
mw->showStatusBarMessage(tr("Loading system objects...") );
|
mw->showStatusBarMessage(tr("Loading system objects...") );
|
||||||
|
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( Constants::getStandardObjectsFilePath(),
|
||||||
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName("");
|
objdb->setFileName("");
|
||||||
|
|
||||||
// objects from a data file are in database ndb
|
// objects from a data file are in database ndb
|
||||||
@ -1021,7 +1025,7 @@ bool ProjectPanel::loadFromRCS(RCS *_rcs)
|
|||||||
|
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(rcs->getFileName().toLocal8Bit().constData(),
|
ndb->load(rcs->getFileName().toLocal8Bit().constData(),
|
||||||
&upgrade_predicate,librespath);
|
&upgrade_predicate,Constants::getDTDDirectory());
|
||||||
time_t oldtimestamp = ndb->getTimeLastModified();
|
time_t oldtimestamp = ndb->getTimeLastModified();
|
||||||
|
|
||||||
/* loadingLib is true if user wants to open a library or master library file */
|
/* loadingLib is true if user wants to open a library or master library file */
|
||||||
|
|||||||
@ -34,6 +34,8 @@
|
|||||||
#include "Help.h"
|
#include "Help.h"
|
||||||
#include "UserWorkflow.h"
|
#include "UserWorkflow.h"
|
||||||
|
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
@ -63,8 +65,10 @@ StartTipDialog::StartTipDialog(QWidget *parent): QDialog(parent)
|
|||||||
|
|
||||||
QString locale = QLocale::system().name(); //"en_US";
|
QString locale = QLocale::system().name(); //"en_US";
|
||||||
QStringList paths;
|
QStringList paths;
|
||||||
paths.append(QString(respath.c_str()) + "/help/" + locale);
|
paths.append(QString(Constants::getResourcesDirectory().c_str()) +
|
||||||
paths.append(QString(respath.c_str()) + "/help/" + "en_US");
|
"/help/" + locale);
|
||||||
|
paths.append(QString(Constants::getResourcesDirectory().c_str()) +
|
||||||
|
"/help/" + "en_US");
|
||||||
|
|
||||||
m_dialog->textview->setSearchPaths(paths);
|
m_dialog->textview->setSearchPaths(paths);
|
||||||
m_dialog->textview->setOpenLinks(true);
|
m_dialog->textview->setOpenLinks(true);
|
||||||
|
|||||||
@ -47,6 +47,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace libfwbuilder;
|
||||||
|
|
||||||
|
|
||||||
debugDialog::debugDialog(QWidget *parent) : QDialog(parent)
|
debugDialog::debugDialog(QWidget *parent) : QDialog(parent)
|
||||||
@ -62,16 +63,18 @@ debugDialog::debugDialog(QWidget *parent) : QDialog(parent)
|
|||||||
m_dialog->debugText->append( QString("Path to executable: %1")
|
m_dialog->debugText->append( QString("Path to executable: %1")
|
||||||
.arg(argv0.c_str()) );
|
.arg(argv0.c_str()) );
|
||||||
m_dialog->debugText->append( QString("Path to resources: %1")
|
m_dialog->debugText->append( QString("Path to resources: %1")
|
||||||
.arg(respath.c_str()) );
|
.arg(Constants::getResourcesDirectory().c_str()) );
|
||||||
m_dialog->debugText->append( QString("Path to locale: %1")
|
m_dialog->debugText->append( QString("Path to locale: %1")
|
||||||
.arg(localepath.c_str()) );
|
.arg(Constants::getLocaleDirectory().c_str()) );
|
||||||
m_dialog->debugText->append( QString("Path to lib resources: %1")
|
m_dialog->debugText->append( QString("Path to libfwbuilder data directory: %1")
|
||||||
.arg(librespath.c_str()) );
|
.arg(Constants::getDTDDirectory().c_str()) );
|
||||||
m_dialog->debugText->append( QString("appRootDir: %1")
|
m_dialog->debugText->append( QString("appRootDir: %1")
|
||||||
.arg(appRootDir.c_str()) );
|
.arg(appRootDir.c_str()) );
|
||||||
m_dialog->debugText->append( "\n" );
|
m_dialog->debugText->append( "\n" );
|
||||||
m_dialog->debugText->append( QString("sysfname: %1").arg(sysfname.c_str()));
|
m_dialog->debugText->append( QString("standard objects library: %1")
|
||||||
m_dialog->debugText->append( QString("tempfname: %1").arg(tempfname.c_str()));
|
.arg(Constants::getStandardObjectsFilePath().c_str()));
|
||||||
|
m_dialog->debugText->append( QString("standard templates library: %1")
|
||||||
|
.arg(Constants::getTemplatesObjectsFilePath().c_str()));
|
||||||
m_dialog->debugText->append( QString("user name: %1").arg(user_name) );
|
m_dialog->debugText->append( QString("user name: %1").arg(user_name) );
|
||||||
m_dialog->debugText->append( "\n" );
|
m_dialog->debugText->append( "\n" );
|
||||||
m_dialog->debugText->append( QString("Path to rcs: %1").arg(RCS_FILE_NAME));
|
m_dialog->debugText->append( QString("Path to rcs: %1").arg(RCS_FILE_NAME));
|
||||||
|
|||||||
@ -44,11 +44,6 @@ extern UserWorkflow *wfl;
|
|||||||
|
|
||||||
extern std::string appRootDir;
|
extern std::string appRootDir;
|
||||||
extern std::string userDataDir;
|
extern std::string userDataDir;
|
||||||
extern std::string respath;
|
|
||||||
extern std::string localepath;
|
|
||||||
extern std::string librespath;
|
|
||||||
extern std::string sysfname;
|
|
||||||
extern std::string tempfname;
|
|
||||||
extern std::string argv0;
|
extern std::string argv0;
|
||||||
extern std::string ee;
|
extern std::string ee;
|
||||||
extern int fwbdebug;
|
extern int fwbdebug;
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
#include "fwbuilder/BackgroundOp.h"
|
#include "fwbuilder/BackgroundOp.h"
|
||||||
#include "fwbuilder/IPv4.h"
|
#include "fwbuilder/IPv4.h"
|
||||||
#include "fwbuilder/IPv6.h"
|
#include "fwbuilder/IPv6.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <qlineedit.h>
|
#include <qlineedit.h>
|
||||||
#include <qtextedit.h>
|
#include <qtextedit.h>
|
||||||
@ -126,7 +127,8 @@ newFirewallDialog::newFirewallDialog(QWidget *parentw, FWObject *_p) :
|
|||||||
this, SLOT(updateTemplatePanel()));
|
this, SLOT(updateTemplatePanel()));
|
||||||
|
|
||||||
m_dialog->useStandard->setChecked(true);
|
m_dialog->useStandard->setChecked(true);
|
||||||
m_dialog->templateFilePath->setText(tempfname.c_str());
|
m_dialog->templateFilePath->setText(
|
||||||
|
Constants::getTemplatesObjectsFilePath().c_str());
|
||||||
updateTemplatePanel();
|
updateTemplatePanel();
|
||||||
|
|
||||||
/* fill in platform. Since iptables is the most popular, start with
|
/* fill in platform. Since iptables is the most popular, start with
|
||||||
@ -207,7 +209,8 @@ void newFirewallDialog::browseTemplate()
|
|||||||
|
|
||||||
void newFirewallDialog::useStandardTemplate()
|
void newFirewallDialog::useStandardTemplate()
|
||||||
{
|
{
|
||||||
m_dialog->templateFilePath->setText(tempfname.c_str());
|
m_dialog->templateFilePath->setText(
|
||||||
|
Constants::getTemplatesObjectsFilePath().c_str());
|
||||||
updateTemplatePanel();
|
updateTemplatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +232,8 @@ void newFirewallDialog::updateTemplatePanel()
|
|||||||
|
|
||||||
if (using_std)
|
if (using_std)
|
||||||
{
|
{
|
||||||
m_dialog->templateFilePath->setText(tempfname.c_str());
|
m_dialog->templateFilePath->setText(
|
||||||
|
Constants::getTemplatesObjectsFilePath().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -576,7 +580,7 @@ void newFirewallDialog::showPage(const int page)
|
|||||||
{
|
{
|
||||||
tmpldb->load(
|
tmpldb->load(
|
||||||
m_dialog->templateFilePath->text().toAscii().data(),
|
m_dialog->templateFilePath->text().toAscii().data(),
|
||||||
&upgrade_predicate, librespath);
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
}
|
}
|
||||||
catch (FWException &ex)
|
catch (FWException &ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,6 +43,7 @@
|
|||||||
#include "fwbuilder/BackgroundOp.h"
|
#include "fwbuilder/BackgroundOp.h"
|
||||||
#include "fwbuilder/IPv4.h"
|
#include "fwbuilder/IPv4.h"
|
||||||
#include "fwbuilder/IPv6.h"
|
#include "fwbuilder/IPv6.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <qlineedit.h>
|
#include <qlineedit.h>
|
||||||
#include <qtextedit.h>
|
#include <qtextedit.h>
|
||||||
@ -104,7 +105,8 @@ newHostDialog::newHostDialog(QWidget *parentw, FWObject *_p) : QDialog(parentw)
|
|||||||
this,SLOT(useStandardTemplate()));
|
this,SLOT(useStandardTemplate()));
|
||||||
connect( m_dialog->useTemplate, SIGNAL(released()),
|
connect( m_dialog->useTemplate, SIGNAL(released()),
|
||||||
this,SLOT(updateTemplatePanel()));
|
this,SLOT(updateTemplatePanel()));
|
||||||
m_dialog->templateFilePath->setText(tempfname.c_str());
|
m_dialog->templateFilePath->setText(
|
||||||
|
Constants::getTemplatesObjectsFilePath().c_str());
|
||||||
updateTemplatePanel();
|
updateTemplatePanel();
|
||||||
|
|
||||||
setNextEnabled( OBJECT_NAME_PAGE, false );
|
setNextEnabled( OBJECT_NAME_PAGE, false );
|
||||||
@ -131,7 +133,8 @@ void newHostDialog::browseTemplate()
|
|||||||
|
|
||||||
void newHostDialog::useStandardTemplate()
|
void newHostDialog::useStandardTemplate()
|
||||||
{
|
{
|
||||||
m_dialog->templateFilePath->setText(tempfname.c_str());
|
m_dialog->templateFilePath->setText(
|
||||||
|
Constants::getTemplatesObjectsFilePath().c_str());
|
||||||
updateTemplatePanel();
|
updateTemplatePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +143,7 @@ void newHostDialog::updateTemplatePanel()
|
|||||||
if (m_dialog->useTemplate->checkState()==Qt::Checked)
|
if (m_dialog->useTemplate->checkState()==Qt::Checked)
|
||||||
{
|
{
|
||||||
QString fileName = m_dialog->templateFilePath->text();
|
QString fileName = m_dialog->templateFilePath->text();
|
||||||
bool using_std = fileName == tempfname.c_str();
|
bool using_std = fileName == Constants::getTemplatesObjectsFilePath().c_str();
|
||||||
|
|
||||||
m_dialog->templateFrame->setVisible(true);
|
m_dialog->templateFrame->setVisible(true);
|
||||||
m_dialog->templateFilePathLabel->setVisible(!using_std);
|
m_dialog->templateFilePathLabel->setVisible(!using_std);
|
||||||
@ -391,7 +394,7 @@ void newHostDialog::showPage(const int page)
|
|||||||
tmpldb = new FWObjectDatabase();
|
tmpldb = new FWObjectDatabase();
|
||||||
tmpldb->setReadOnly( false );
|
tmpldb->setReadOnly( false );
|
||||||
tmpldb->load( m_dialog->templateFilePath->text().toAscii().data(),
|
tmpldb->load( m_dialog->templateFilePath->text().toAscii().data(),
|
||||||
&upgrade_predicate, librespath);
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
}
|
}
|
||||||
list<FWObject*> fl;
|
list<FWObject*> fl;
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -94,12 +95,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -126,7 +121,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new Resources(respath + FS_SEPARATOR + "resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -137,10 +132,11 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( Constants::getStandardObjectsFilePath(),
|
||||||
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName("");
|
objdb->setFileName("");
|
||||||
FWObjectDatabase *ndb = new FWObjectDatabase();
|
FWObjectDatabase *ndb = new FWObjectDatabase();
|
||||||
ndb->load(filename, &upgrade_predicate, librespath);
|
ndb->load(filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->merge(ndb, NULL);
|
objdb->merge(ndb, NULL);
|
||||||
delete ndb;
|
delete ndb;
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/Tools.h"
|
#include "fwbuilder/Tools.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -118,12 +119,6 @@ int main(int argc, char **argv)
|
|||||||
only_print_inspection_code = true;
|
only_print_inspection_code = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -147,7 +142,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new Resources(respath + FS_SEPARATOR + "resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -158,7 +153,7 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( filename, &upgrade_predicate, librespath);
|
objdb->load( filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
#include "fwbuilder/XMLTools.h"
|
#include "fwbuilder/XMLTools.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/Tools.h"
|
#include "fwbuilder/Tools.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -109,12 +110,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QString arg = args.at(idx);
|
QString arg = args.at(idx);
|
||||||
last_arg = arg;
|
last_arg = arg;
|
||||||
if (arg == "-r")
|
|
||||||
{
|
|
||||||
idx++;
|
|
||||||
respath = string(args.at(idx).toLatin1().constData());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (arg == "-V")
|
if (arg == "-V")
|
||||||
{
|
{
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
@ -138,7 +133,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
new Resources(respath+FS_SEPARATOR+"resources.xml");
|
new Resources(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
/* create database */
|
/* create database */
|
||||||
objdb = new FWObjectDatabase();
|
objdb = new FWObjectDatabase();
|
||||||
@ -149,7 +144,7 @@ int main(int argc, char **argv)
|
|||||||
cout << " *** Loading data ...";
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( filename, &upgrade_predicate, librespath);
|
objdb->load( filename, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
//std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
std::string platform;
|
std::string platform;
|
||||||
|
|||||||
@ -44,6 +44,7 @@
|
|||||||
#include "fwbuilder/Policy.h"
|
#include "fwbuilder/Policy.h"
|
||||||
#include "fwbuilder/Rule.h"
|
#include "fwbuilder/Rule.h"
|
||||||
#include "fwbuilder/TagService.h"
|
#include "fwbuilder/TagService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@ -82,15 +83,11 @@ void ImporterTest::setUp()
|
|||||||
|
|
||||||
db->setReadOnly( false );
|
db->setReadOnly( false );
|
||||||
|
|
||||||
//path.pop_back();
|
qDebug() << Constants::getStandardObjectsFilePath().c_str();
|
||||||
//path << "objects_init.xml";
|
qDebug() << Constants::getDTDDirectory().c_str();
|
||||||
//sysfname = path.join(FS_SEPARATOR).toStdString();
|
|
||||||
//librespath = string(PREFIX) + "/share/libfwbuilder-" + VERSION;
|
|
||||||
|
|
||||||
qDebug() << sysfname.c_str();
|
db->load( Constants::getStandardObjectsFilePath(),
|
||||||
qDebug() << librespath.c_str();
|
&upgrade_predicate, Constants::getDTDDirectory());
|
||||||
|
|
||||||
db->load( sysfname, &upgrade_predicate, librespath);
|
|
||||||
qDebug() << "st";
|
qDebug() << "st";
|
||||||
|
|
||||||
db->setFileName("");
|
db->setFileName("");
|
||||||
|
|||||||
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include "../../../common/init.cpp"
|
#include "../../../common/init.cpp"
|
||||||
|
|
||||||
//std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
std::string platform;
|
std::string platform;
|
||||||
@ -44,7 +43,7 @@ int main(int argc, char** argv)
|
|||||||
QApplication app(argc, argv, false);
|
QApplication app(argc, argv, false);
|
||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
runner.addTest( ImporterTest::suite() );
|
runner.addTest( ImporterTest::suite() );
|
||||||
runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
|
runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
//std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
std::string platform;
|
std::string platform;
|
||||||
|
|||||||
@ -30,7 +30,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
//std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
std::string platform;
|
std::string platform;
|
||||||
|
|||||||
@ -30,7 +30,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
//std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
std::string platform;
|
std::string platform;
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
//std::string respath;
|
|
||||||
//int fwbdebug = 0;
|
//int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
#include "UsageResolverTest.h"
|
#include "UsageResolverTest.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string respath;
|
|
||||||
int fwbdebug = 0;
|
int fwbdebug = 0;
|
||||||
QString user_name;
|
QString user_name;
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "fwbuilder/Firewall.h"
|
#include "fwbuilder/Firewall.h"
|
||||||
#include "fwbuilder/Interface.h"
|
#include "fwbuilder/Interface.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -37,8 +38,6 @@ using namespace libfwbuilder;
|
|||||||
using namespace CppUnit;
|
using namespace CppUnit;
|
||||||
|
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -586,7 +585,7 @@ void interfacePropertiesTest::testManageIpAddresses()
|
|||||||
|
|
||||||
string file_name = "test.fwb";
|
string file_name = "test.fwb";
|
||||||
db->setReadOnly( false );
|
db->setReadOnly( false );
|
||||||
db->load(file_name, &upgrade_predicate, librespath);
|
db->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
db->setFileName(file_name);
|
db->setFileName(file_name);
|
||||||
db->reIndex();
|
db->reIndex();
|
||||||
|
|
||||||
@ -656,7 +655,7 @@ void interfacePropertiesTest::testManageIpAddressesCluster()
|
|||||||
|
|
||||||
string file_name = "test.fwb";
|
string file_name = "test.fwb";
|
||||||
db->setReadOnly( false );
|
db->setReadOnly( false );
|
||||||
db->load(file_name, &upgrade_predicate, librespath);
|
db->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
db->setFileName(file_name);
|
db->setFileName(file_name);
|
||||||
db->reIndex();
|
db->reIndex();
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,12 @@
|
|||||||
#include "common/init.cpp"
|
#include "common/init.cpp"
|
||||||
#include "interfacePropertiesTest.h"
|
#include "interfacePropertiesTest.h"
|
||||||
|
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <cppunit/ui/text/TestRunner.h>
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
//std::string respath;
|
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
|
|
||||||
int main(int, char **argv)
|
int main(int, char **argv)
|
||||||
@ -41,9 +42,7 @@ int main(int, char **argv)
|
|||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
// Resources("../../res/resources.xml");
|
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
runner.addTest( interfacePropertiesTest::suite() );
|
runner.addTest( interfacePropertiesTest::suite() );
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "fwbuilder/FWObjectDatabase.h"
|
#include "fwbuilder/FWObjectDatabase.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -46,8 +47,6 @@ using namespace libfwbuilder;
|
|||||||
using namespace fwcompiler;
|
using namespace fwcompiler;
|
||||||
|
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -74,7 +73,7 @@ void GeneratedScriptTest::loadDataFile(const string &file_name)
|
|||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load(file_name, &upgrade_predicate, librespath);
|
objdb->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(file_name);
|
objdb->setFileName(file_name);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -51,8 +52,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
runner.addTest( GeneratedScriptTest::suite() );
|
runner.addTest( GeneratedScriptTest::suite() );
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "fwbuilder/FWObjectDatabase.h"
|
#include "fwbuilder/FWObjectDatabase.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -46,8 +47,6 @@ using namespace libfwbuilder;
|
|||||||
using namespace fwcompiler;
|
using namespace fwcompiler;
|
||||||
|
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -74,7 +73,7 @@ void GeneratedScriptTest::loadDataFile(const string &file_name)
|
|||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load(file_name, &upgrade_predicate, librespath);
|
objdb->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(file_name);
|
objdb->setFileName(file_name);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -51,7 +52,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "fwbuilder/FWObjectDatabase.h"
|
#include "fwbuilder/FWObjectDatabase.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -46,8 +47,6 @@ using namespace libfwbuilder;
|
|||||||
using namespace fwcompiler;
|
using namespace fwcompiler;
|
||||||
|
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -80,7 +79,7 @@ void GeneratedScriptTest::loadDataFile(const string &file_name)
|
|||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load(file_name, &upgrade_predicate, librespath);
|
objdb->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(file_name);
|
objdb->setFileName(file_name);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
} catch (FWException &ex)
|
} catch (FWException &ex)
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -51,7 +52,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "fwbuilder/FWObjectDatabase.h"
|
#include "fwbuilder/FWObjectDatabase.h"
|
||||||
#include "fwbuilder/FWException.h"
|
#include "fwbuilder/FWException.h"
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -46,8 +47,6 @@ using namespace libfwbuilder;
|
|||||||
using namespace fwcompiler;
|
using namespace fwcompiler;
|
||||||
|
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -74,7 +73,7 @@ void GeneratedScriptTest::loadDataFile(const string &file_name)
|
|||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load(file_name, &upgrade_predicate, librespath);
|
objdb->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(file_name);
|
objdb->setFileName(file_name);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -51,7 +52,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include "Configlet.h"
|
#include "Configlet.h"
|
||||||
|
|
||||||
#include "fwbuilder/IPService.h"
|
#include "fwbuilder/IPService.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
@ -31,7 +32,6 @@ using namespace std;
|
|||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
using namespace fwcompiler;
|
using namespace fwcompiler;
|
||||||
|
|
||||||
extern string librespath;
|
|
||||||
|
|
||||||
class UpgradePredicate: public XMLTools::UpgradePredicate
|
class UpgradePredicate: public XMLTools::UpgradePredicate
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ void GeneratedScriptTest::loadDataFile(const string &file_name)
|
|||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load(file_name, &upgrade_predicate, librespath);
|
objdb->load(file_name, &upgrade_predicate, Constants::getDTDDirectory());
|
||||||
objdb->setFileName(file_name);
|
objdb->setFileName(file_name);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
@ -41,7 +42,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
init(argv);
|
init(argv);
|
||||||
|
|
||||||
Resources res(respath + FS_SEPARATOR + "resources.xml");
|
Resources res(Constants::getResourcesFilePath());
|
||||||
|
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
#include "common/commoninit.h"
|
#include "common/commoninit.h"
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
#include "fwbuilder/Resources.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
@ -65,7 +66,7 @@ void build_app(int argc, char** argv,
|
|||||||
|
|
||||||
*wfl = new UserWorkflow();
|
*wfl = new UserWorkflow();
|
||||||
|
|
||||||
string full_res_path = respath + FS_SEPARATOR + "resources.xml";
|
string full_res_path = Constants::getResourcesFilePath();
|
||||||
|
|
||||||
new Resources(full_res_path);
|
new Resources(full_res_path);
|
||||||
|
|
||||||
|
|||||||
@ -29,17 +29,19 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
#include "ui_newclusterdialog_q.h"
|
#include "ui_newclusterdialog_q.h"
|
||||||
|
|
||||||
#include "FWWindow.h"
|
#include "FWWindow.h"
|
||||||
#include "fwbuilder/Policy.h"
|
|
||||||
#include "ObjectTreeView.h"
|
#include "ObjectTreeView.h"
|
||||||
#include "ProjectPanel.h"
|
#include "ProjectPanel.h"
|
||||||
#include "StartTipDialog.h"
|
#include "StartTipDialog.h"
|
||||||
|
|
||||||
#include "ObjectTreeView.h"
|
#include "ObjectTreeView.h"
|
||||||
#include "ObjectTreeViewItem.h"
|
#include "ObjectTreeViewItem.h"
|
||||||
#include "FWObjectClipboard.h"
|
#include "FWObjectClipboard.h"
|
||||||
#include "FWBApplication.h"
|
#include "FWBApplication.h"
|
||||||
|
|
||||||
|
#include "fwbuilder/Policy.h"
|
||||||
|
#include "fwbuilder/Constants.h"
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
using namespace libfwbuilder;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -86,7 +88,7 @@ void newClusterDialogTest::test1()
|
|||||||
//init();
|
//init();
|
||||||
FWObjectDatabase *db = new FWObjectDatabase();
|
FWObjectDatabase *db = new FWObjectDatabase();
|
||||||
XMLTools::UpgradePredicate p;
|
XMLTools::UpgradePredicate p;
|
||||||
db->load("test_work.fwb", &p, librespath);
|
db->load("test_work.fwb", &p, Constants::getDTDDirectory());
|
||||||
newClusterDialog_ext *dialog = new newClusterDialog_ext(NULL, db);
|
newClusterDialog_ext *dialog = new newClusterDialog_ext(NULL, db);
|
||||||
vector<FWObject*> fws;
|
vector<FWObject*> fws;
|
||||||
QStringList fwnames;
|
QStringList fwnames;
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
//std::string respath;
|
|
||||||
//int fwbdebug = 0;
|
//int fwbdebug = 0;
|
||||||
//QString user_name;
|
//QString user_name;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user