Update to latest resease.
Patches have been pushed upstream (Yay!) so this should be a lot easier going forward. Thanks to Rick Murphy (K1MU) for helping upstream these bits.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= trustedqsl
|
||||
PORTVERSION= 2.1.3
|
||||
PORTVERSION= 2.2
|
||||
CATEGORIES= comms hamradio
|
||||
MASTER_SITES= http://www.arrl.org/files/file/LoTW%20Instructions/ \
|
||||
LOCAL/shurd
|
||||
@@ -21,7 +21,7 @@ USE_BDB= 5+
|
||||
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
|
||||
USES= cmake compiler:c++11-lib pkgconfig tar:tgz
|
||||
USES= cmake compiler:c++11-lib pkgconfig
|
||||
CMAKE_ARGS= -DBDB_PREFIX=${LOCALBASE}
|
||||
USE_WX= 2.8+
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
SHA256 (tqsl-2.1.3.tgz) = 188437fdb37eb966336abbfaa0e33d83488567504e8fc87589eca7bbf7b84472
|
||||
SIZE (tqsl-2.1.3.tgz) = 3443675
|
||||
SHA256 (tqsl-2.2.tar.gz) = 2f68a6cbac7c0546d4f9c088d504d933c3fd3681fd4cfbf30b77ad57c4c4ac5a
|
||||
SIZE (tqsl-2.2.tar.gz) = 3454622
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--- CMakeLists.txt.orig 2015-10-21 17:26:38 UTC
|
||||
+++ CMakeLists.txt
|
||||
@@ -15,6 +15,9 @@ find_package(OptionalAddSubdirectory REQ
|
||||
|
||||
option(USE_STATIC_MSVCRT "Use a static Visual C++ Runtime when building with MSVC")
|
||||
|
||||
+if(UNIX)
|
||||
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
+endif()
|
||||
if(MSVC AND USE_STATIC_MSVCRT)
|
||||
foreach(flag_var
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
||||
@@ -1,15 +0,0 @@
|
||||
--- apps/CMakeLists.txt.orig 2015-10-21 17:26:38 UTC
|
||||
+++ apps/CMakeLists.txt
|
||||
@@ -148,7 +148,11 @@ if(NOT APPLE AND NOT WIN32)
|
||||
add_definitions("-DCONFDIR=\"${CMAKE_INSTALL_PREFIX}/share/TrustedQSL/\"")
|
||||
install(TARGETS tqsl DESTINATION bin)
|
||||
install(DIRECTORY help DESTINATION share/TrustedQSL)
|
||||
- install(FILES tqsl.5 DESTINATION share/man/man5)
|
||||
+ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
+ install(FILES tqsl.5 DESTINATION man/man5)
|
||||
+ else()
|
||||
+ install(FILES tqsl.5 DESTINATION share/man/man5)
|
||||
+ endif()
|
||||
install(FILES icons/key48.png DESTINATION share/pixmaps RENAME TrustedQSL.png)
|
||||
install(FILES lang/de/tqslapp.mo DESTINATION share/locale/de/LC_MESSAGES)
|
||||
install(FILES lang/de/wxstd.mo DESTINATION share/locale/de/LC_MESSAGES)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- apps/tqsl.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ apps/tqsl.cpp
|
||||
@@ -4680,7 +4680,7 @@ QSLApp::OnInit() {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
origCommandLine += wxT(" ");
|
||||
origCommandLine += argv[i];
|
||||
- if (argv[i] && (argv[i][0] == wxT('-') || argv[i][0] == wxT('/')))
|
||||
+ if ((argv[i][0] == wxT('-') || argv[i][0] == wxT('/')))
|
||||
if (wxIsalpha(argv[i][1]) && wxIsupper(argv[i][1]))
|
||||
argv[i][1] = wxTolower(argv[i][1]);
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
--- cmakemodules/FindBDB.cmake.orig 2015-10-21 17:26:38 UTC
|
||||
+++ cmakemodules/FindBDB.cmake
|
||||
@@ -1,10 +1,12 @@
|
||||
# Find Berkeley DB
|
||||
|
||||
# Look for the header file.
|
||||
-if(APPLE) #exclude obsolete default OSX db
|
||||
+if(APPLE OR CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") #exclude obsolete default OSX db
|
||||
FIND_PATH(BDB_INCLUDE_DIR db.h NO_DEFAULT_PATH PATHS
|
||||
"/usr/local/BerkeleyDB.6.0/include"
|
||||
"/usr/local/BerkeleyDB.5.3/include"
|
||||
+ "/usr/local/include/db5"
|
||||
+ "${BDB_PREFIX}/include/db5"
|
||||
"${BDB_PREFIX}/include"
|
||||
)
|
||||
else()
|
||||
@@ -15,6 +17,8 @@ FIND_PATH(BDB_INCLUDE_DIR db.h
|
||||
"C:\\db-6.0.20\\build_windows"
|
||||
"C:\\db-6.0.20\\build_windows"
|
||||
"C:\\db-5.3.21\\build_windows"
|
||||
+ #*nix dirs
|
||||
+ "${BDB_PREFIX}/include"
|
||||
)
|
||||
endif()
|
||||
MARK_AS_ADVANCED(BDB_INCLUDE_DIR)
|
||||
@@ -31,6 +35,7 @@ FIND_LIBRARY(BDB_LIBRARY NAMES
|
||||
libdb6-0.3
|
||||
libdb6-0.so
|
||||
libdb_small53s
|
||||
+ libdb5
|
||||
libdb53s
|
||||
libdb5-5.3
|
||||
libdb5-5.so
|
||||
@@ -45,6 +50,7 @@ FIND_LIBRARY(BDB_LIBRARY NAMES
|
||||
"/usr/local/BerkeleyDB.6.0/lib"
|
||||
"/usr/local/BerkeleyDB.5.3/lib"
|
||||
"${BDB_PREFIX}/lib"
|
||||
+ "${BDB_PREFIX}/lib/db5"
|
||||
"${BDB_PREFIX}"
|
||||
)
|
||||
MARK_AS_ADVANCED(BDB_LIBRARY)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- src/converter.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/converter.cpp
|
||||
@@ -88,7 +88,7 @@ main(int argc, char *argv[]) {
|
||||
optind++;
|
||||
const char *ofile = (optind < argc) ? argv[optind] : "converted.tq7";
|
||||
ofstream out;
|
||||
- out.open(ofile, ios::out|ios::trunc|ios::binary);
|
||||
+ out.open(ofile, std::ios::out|std::ios::trunc|std::ios::binary);
|
||||
if (!out.is_open())
|
||||
throw myexc(string("Unable to open ") + ofile);
|
||||
bool haveout = false;
|
||||
@@ -1,31 +0,0 @@
|
||||
--- src/gen_crq.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/gen_crq.cpp
|
||||
@@ -99,9 +99,9 @@ main(int argc, char *argv[]) {
|
||||
throw tqslexc();
|
||||
if (tqsl_getCertificateDXCCEntity(sign_cert, &cdxcc))
|
||||
throw tqslexc();
|
||||
- cout << "Signing certificate issuer: " << buf << endl;
|
||||
- cout << "Signing certificate serial: " << serial << endl;
|
||||
- cout << " Signing certificate DXCC: " << cdxcc << endl;
|
||||
+ std::cout << "Signing certificate issuer: " << buf << endl;
|
||||
+ std::cout << "Signing certificate serial: " << serial << endl;
|
||||
+ std::cout << " Signing certificate DXCC: " << cdxcc << endl;
|
||||
if (tqsl_beginSigning(sign_cert, const_cast<char *>(""), 0, 0))
|
||||
throw tqslexc();
|
||||
}
|
||||
@@ -124,13 +124,13 @@ main(int argc, char *argv[]) {
|
||||
*cp = '_';
|
||||
}
|
||||
string filename = string(argv[optind]) + ".tq5";
|
||||
- cout << "Creating CRQ for " << crq.callSign << " DXCC=" << crq.dxccEntity << endl;
|
||||
+ std::cout << "Creating CRQ for " << crq.callSign << " DXCC=" << crq.dxccEntity << endl;
|
||||
if (tqsl_createCertRequest(filename.c_str(), &crq, 0, 0))
|
||||
throw tqslexc();
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
} catch(exception& x) {
|
||||
- cerr << "Aborting: " << x.what() << endl;
|
||||
+ std::cerr << "Aborting: " << x.what() << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
@@ -1,189 +0,0 @@
|
||||
--- src/location.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/location.cpp
|
||||
@@ -2226,7 +2226,7 @@ tqsl_load_loc(TQSL_LOCATION *loc, XMLEle
|
||||
if (field.gabbi_name != "") {
|
||||
// A field that may exist
|
||||
XMLElement el;
|
||||
- if (ep->second.getFirstElement(field.gabbi_name, el)) {
|
||||
+ if (ep->second->getFirstElement(field.gabbi_name, el)) {
|
||||
field.cdata = el.getText();
|
||||
switch (field.input_type) {
|
||||
case TQSL_LOCATION_FIELD_DDLIST:
|
||||
@@ -2368,7 +2368,7 @@ tqsl_mergeStationLocations(const char *l
|
||||
for (nameiter = namelist.find("StationData"); nameiter != namelist.end(); nameiter++) {
|
||||
if (nameiter->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> rval = nameiter->second.getAttribute("name");
|
||||
+ pair<string, bool> rval = nameiter->second->getAttribute("name");
|
||||
if (rval.second) {
|
||||
locnames.push_back(rval.first);
|
||||
}
|
||||
@@ -2381,7 +2381,7 @@ tqsl_mergeStationLocations(const char *l
|
||||
for (ep = ellist.find("StationData"); ep != ellist.end(); ep++) {
|
||||
if (ep->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> rval = ep->second.getAttribute("name");
|
||||
+ pair<string, bool> rval = ep->second->getAttribute("name");
|
||||
bool found = false;
|
||||
if (rval.second) {
|
||||
for (size_t j = 0; j < locnames.size(); j++) {
|
||||
@@ -2393,19 +2393,19 @@ tqsl_mergeStationLocations(const char *l
|
||||
}
|
||||
if (!found) {
|
||||
// Add this one to the station data file
|
||||
- XMLElement newtop("StationData");
|
||||
- newtop.setPretext("\n ");
|
||||
- newtop.setAttribute("name", rval.first);
|
||||
- newtop.setText("\n ");
|
||||
- XMLElement sub;
|
||||
- sub.setPretext(newtop.getPretext() + " ");
|
||||
+ std::shared_ptr<XMLElement> newtop(new XMLElement("StationData"));
|
||||
+ newtop->setPretext("\n ");
|
||||
+ newtop->setAttribute("name", rval.first);
|
||||
+ newtop->setText("\n ");
|
||||
+ std::shared_ptr<XMLElement> sub(new XMLElement);
|
||||
+ sub->setPretext(newtop->getPretext() + " ");
|
||||
XMLElement el;
|
||||
- bool elok = ep->second.getFirstElement(el);
|
||||
+ bool elok = ep->second->getFirstElement(el);
|
||||
while (elok) {
|
||||
- sub.setElementName(el.getElementName());
|
||||
- sub.setText(el.getText());
|
||||
- newtop.addElement(sub);
|
||||
- elok = ep->second.getNextElement(el);
|
||||
+ sub->setElementName(el.getElementName());
|
||||
+ sub->setText(el.getText());
|
||||
+ newtop->addElement(sub);
|
||||
+ elok = ep->second->getNextElement(el);
|
||||
}
|
||||
old_data.addElement(newtop);
|
||||
old_data.setText("\n");
|
||||
@@ -2444,7 +2444,7 @@ tqsl_move_station_location(const char *n
|
||||
for (from_ep = from_ellist.find("StationData"); from_ep != from_ellist.end(); from_ep++) {
|
||||
if (from_ep->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> from_rval = from_ep->second.getAttribute("name");
|
||||
+ pair<string, bool> from_rval = from_ep->second->getAttribute("name");
|
||||
if (from_rval.second && !strcasecmp(from_rval.first.c_str(), name)) {
|
||||
// Match, move it.
|
||||
// First, delete any old backup for this station location
|
||||
@@ -2453,26 +2453,26 @@ tqsl_move_station_location(const char *n
|
||||
for (to_ep = to_ellist.find("StationData"); to_ep != to_ellist.end(); to_ep++) {
|
||||
if (to_ep->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> to_rval = to_ep->second.getAttribute("name");
|
||||
+ pair<string, bool> to_rval = to_ep->second->getAttribute("name");
|
||||
if (to_rval.second && !strcasecmp(to_rval.first.c_str(), name)) {
|
||||
to_ellist.erase(to_ep);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Now add it to the target
|
||||
- XMLElement newtop("StationData");
|
||||
- newtop.setPretext("\n ");
|
||||
- newtop.setAttribute("name", from_rval.first);
|
||||
- newtop.setText("\n ");
|
||||
- XMLElement sub;
|
||||
- sub.setPretext(newtop.getPretext() + " ");
|
||||
+ std::shared_ptr<XMLElement> newtop(new XMLElement("StationData"));
|
||||
+ newtop->setPretext("\n ");
|
||||
+ newtop->setAttribute("name", from_rval.first);
|
||||
+ newtop->setText("\n ");
|
||||
+ std::shared_ptr<XMLElement> sub(new XMLElement);
|
||||
+ sub->setPretext(newtop->getPretext() + " ");
|
||||
XMLElement el;
|
||||
- bool elok = from_ep->second.getFirstElement(el);
|
||||
+ bool elok = from_ep->second->getFirstElement(el);
|
||||
while (elok) {
|
||||
- sub.setElementName(el.getElementName());
|
||||
- sub.setText(el.getText());
|
||||
- newtop.addElement(sub);
|
||||
- elok = from_ep->second.getNextElement(el);
|
||||
+ sub->setElementName(el.getElementName());
|
||||
+ sub->setText(el.getText());
|
||||
+ newtop->addElement(sub);
|
||||
+ elok = from_ep->second->getNextElement(el);
|
||||
}
|
||||
to_sfile.addElement(newtop);
|
||||
to_sfile.setText("\n");
|
||||
@@ -2528,7 +2528,7 @@ tqsl_getStationLocation(tQSL_Location *l
|
||||
for (ep = ellist.find("StationData"); ep != ellist.end(); ep++) {
|
||||
if (ep->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> rval = ep->second.getAttribute("name");
|
||||
+ pair<string, bool> rval = ep->second->getAttribute("name");
|
||||
if (rval.second && !strcasecmp(trim(rval.first).c_str(), trim(loc->name).c_str())) {
|
||||
exists = true;
|
||||
break;
|
||||
@@ -2724,33 +2724,33 @@ tqsl_location_to_xml(TQSL_LOCATION *loc,
|
||||
}
|
||||
for (int i = 0; i < numf; i++) {
|
||||
TQSL_LOCATION_FIELD& field = loc->pagelist[loc->page-1].fieldlist[i];
|
||||
- XMLElement fd;
|
||||
- fd.setPretext(sd.getPretext() + " ");
|
||||
- fd.setElementName(field.gabbi_name);
|
||||
+ std::shared_ptr<XMLElement> fd(new XMLElement);
|
||||
+ fd->setPretext(sd.getPretext() + " ");
|
||||
+ fd->setElementName(field.gabbi_name);
|
||||
switch (field.input_type) {
|
||||
case TQSL_LOCATION_FIELD_DDLIST:
|
||||
case TQSL_LOCATION_FIELD_LIST:
|
||||
if (field.idx < 0 || field.idx >= static_cast<int>(field.items.size())) {
|
||||
- fd.setText("");
|
||||
+ fd->setText("");
|
||||
if (field.gabbi_name == "CALL") {
|
||||
- fd.setText("NONE");
|
||||
+ fd->setText("NONE");
|
||||
}
|
||||
} else if (field.data_type == TQSL_LOCATION_FIELD_INT) {
|
||||
char numbuf[20];
|
||||
snprintf(numbuf, sizeof numbuf, "%d", field.items[field.idx].ivalue);
|
||||
- fd.setText(numbuf);
|
||||
+ fd->setText(numbuf);
|
||||
} else {
|
||||
- fd.setText(field.items[field.idx].text);
|
||||
+ fd->setText(field.items[field.idx].text);
|
||||
}
|
||||
break;
|
||||
case TQSL_LOCATION_FIELD_TEXT:
|
||||
field.cdata = trim(field.cdata);
|
||||
if (field.flags & TQSL_LOCATION_FIELD_UPPER)
|
||||
field.cdata = string_toupper(field.cdata);
|
||||
- fd.setText(field.cdata);
|
||||
+ fd->setText(field.cdata);
|
||||
break;
|
||||
}
|
||||
- if (strcmp(fd.getText().c_str(), ""))
|
||||
+ if (strcmp(fd->getText().c_str(), ""))
|
||||
sd.addElement(fd);
|
||||
}
|
||||
int rval;
|
||||
@@ -2824,7 +2824,7 @@ tqsl_saveStationLocationCapture(tQSL_Loc
|
||||
for (ep = ellist.find("StationData"); ep != ellist.end(); ep++) {
|
||||
if (ep->first != "StationData")
|
||||
break;
|
||||
- pair<string, bool> rval = ep->second.getAttribute("name");
|
||||
+ pair<string, bool> rval = ep->second->getAttribute("name");
|
||||
if (rval.second && !strcasecmp(rval.first.c_str(), loc->name.c_str())) {
|
||||
exists = true;
|
||||
break;
|
||||
@@ -2835,14 +2835,14 @@ tqsl_saveStationLocationCapture(tQSL_Loc
|
||||
tQSL_Error = TQSL_NAME_EXISTS;
|
||||
return 1;
|
||||
}
|
||||
- XMLElement sd("StationData");
|
||||
- sd.setPretext("\n ");
|
||||
- if (tqsl_location_to_xml(loc, sd)) {
|
||||
+ std::shared_ptr<XMLElement> sd(new XMLElement("StationData"));
|
||||
+ sd->setPretext("\n ");
|
||||
+ if (tqsl_location_to_xml(loc, *sd)) {
|
||||
tqslTrace("tqsl_saveStationLocationCaptureName", "error in loc_to_xml %d", tQSL_Error);
|
||||
return 1;
|
||||
}
|
||||
- sd.setAttribute("name", loc->name);
|
||||
- sd.setText("\n ");
|
||||
+ sd->setAttribute("name", loc->name);
|
||||
+ sd->setText("\n ");
|
||||
|
||||
// If 'exists', ep points to the existing station record
|
||||
if (exists)
|
||||
@@ -1,60 +0,0 @@
|
||||
--- src/openssl_cert.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/openssl_cert.cpp
|
||||
@@ -3353,18 +3353,18 @@ tqsl_restoreCallsignCertificate(const ch
|
||||
for (ep = ellist.find("UserCert"); ep != ellist.end(); ep++) {
|
||||
if (ep->first != "UserCert")
|
||||
break;
|
||||
- pair<string, bool> rval = ep->second.getAttribute("CallSign");
|
||||
+ pair<string, bool> rval = ep->second->getAttribute("CallSign");
|
||||
if (rval.second) call = rval.first;
|
||||
- rval = ep->second.getAttribute("serial");
|
||||
+ rval = ep->second->getAttribute("serial");
|
||||
if (rval.second) serial = strtol(rval.first.c_str(), NULL, 10);
|
||||
- rval = ep->second.getAttribute("dxcc");
|
||||
+ rval = ep->second->getAttribute("dxcc");
|
||||
if (rval.second) dxcc = strtol(rval.first.c_str(), NULL, 10);
|
||||
|
||||
XMLElement el;
|
||||
- if (ep->second.getFirstElement("SignedCert", el)) {
|
||||
+ if (ep->second->getFirstElement("SignedCert", el)) {
|
||||
publicKey = el.getText();
|
||||
}
|
||||
- if (ep->second.getFirstElement("PrivateKey", el)) {
|
||||
+ if (ep->second->getFirstElement("PrivateKey", el)) {
|
||||
privateKey = el.getText();
|
||||
}
|
||||
}
|
||||
@@ -5208,23 +5208,23 @@ tqsl_setCertificateStatus(long serial, c
|
||||
for (ep = ellist.find("Cert"); ep != ellist.end(); ep++) {
|
||||
if (ep->first != "Cert")
|
||||
break;
|
||||
- pair<string, bool> rval = ep->second.getAttribute("serial");
|
||||
+ pair<string, bool> rval = ep->second->getAttribute("serial");
|
||||
if (rval.second && strtol(rval.first.c_str(), NULL, 10) == serial) {
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- XMLElement cs("Cert");
|
||||
- cs.setPretext("\n ");
|
||||
- XMLElement se;
|
||||
- se.setPretext(cs.getPretext() + " ");
|
||||
- se.setElementName("status");
|
||||
- se.setText(status);
|
||||
- cs.addElement(se);
|
||||
+ std::shared_ptr<XMLElement> cs(new XMLElement("Cert"));
|
||||
+ cs->setPretext("\n ");
|
||||
+ std::shared_ptr<XMLElement> se(new XMLElement);
|
||||
+ se->setPretext(cs->getPretext() + " ");
|
||||
+ se->setElementName("status");
|
||||
+ se->setText(status);
|
||||
+ cs->addElement(se);
|
||||
|
||||
- cs.setAttribute("serial", sstr);
|
||||
- cs.setText("\n ");
|
||||
+ cs->setAttribute("serial", sstr);
|
||||
+ cs->setText("\n ");
|
||||
|
||||
if (exists)
|
||||
ellist.erase(ep);
|
||||
@@ -1,11 +0,0 @@
|
||||
--- src/tqslconvert.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/tqslconvert.cpp
|
||||
@@ -549,7 +549,7 @@ static bool open_db(TQSL_CONVERTER *conv
|
||||
fprintf(conv->errfile, "opening DB %s returns status %s\n", conv->dbpath, db_strerror(dbret));
|
||||
// Can't open the database - maybe try private?
|
||||
if ((dbret == EACCES || dbret == EROFS) || (dbret == EINVAL && errno == dbret)) {
|
||||
- if (!(envflags && DB_PRIVATE)) {
|
||||
+ if (!(envflags & DB_PRIVATE)) {
|
||||
envflags |= DB_PRIVATE;
|
||||
continue;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
--- src/xml.cpp.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/xml.cpp
|
||||
@@ -47,17 +47,17 @@ XMLElement::getAttribute(const string& k
|
||||
void
|
||||
XMLElement::xml_start(void *data, const XML_Char *name, const XML_Char **atts) {
|
||||
XMLElement *el = reinterpret_cast<XMLElement *>(data);
|
||||
- XMLElement new_el(name);
|
||||
+ std::shared_ptr<XMLElement> new_el(new XMLElement(name));
|
||||
//cout << "Element: " << name << endl;
|
||||
for (int i = 0; atts[i]; i += 2) {
|
||||
- new_el.setAttribute(atts[i], atts[i+1]);
|
||||
+ new_el->setAttribute(atts[i], atts[i+1]);
|
||||
}
|
||||
if (el->_parsingStack.empty()) {
|
||||
el->_parsingStack.push_back(el->addElement(new_el));
|
||||
} else {
|
||||
- new_el.setPretext(el->_parsingStack.back()->second.getText());
|
||||
- el->_parsingStack.back()->second.setText("");
|
||||
- el->_parsingStack.push_back(el->_parsingStack.back()->second.addElement(new_el));
|
||||
+ new_el->setPretext(el->_parsingStack.back()->second->getText());
|
||||
+ el->_parsingStack.back()->second->setText("");
|
||||
+ el->_parsingStack.push_back(el->_parsingStack.back()->second->addElement(new_el));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ XMLElement::xml_end(void *data, const XM
|
||||
void
|
||||
XMLElement::xml_text(void *data, const XML_Char *text, int len) {
|
||||
XMLElement *el = reinterpret_cast<XMLElement *>(data);
|
||||
- el->_parsingStack.back()->second._text.append(text, len);
|
||||
+ el->_parsingStack.back()->second->_text.append(text, len);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1,51 +0,0 @@
|
||||
--- src/xml.h.orig 2015-10-21 17:26:38 UTC
|
||||
+++ src/xml.h
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
+#include <memory>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <expat.h>
|
||||
@@ -28,7 +29,7 @@ namespace tqsllib {
|
||||
|
||||
class XMLElement;
|
||||
|
||||
-typedef multimap<string, XMLElement> XMLElementList;
|
||||
+typedef multimap<string, std::shared_ptr<XMLElement> > XMLElementList;
|
||||
typedef map<string, string> XMLElementAttributeList;
|
||||
|
||||
/** Encapsulates an XML element
|
||||
@@ -62,7 +63,7 @@ class XMLElement {
|
||||
*/
|
||||
pair<string, bool> getAttribute(const string& key);
|
||||
/// Add an element to the list of contained subelements
|
||||
- XMLElementList::iterator addElement(const XMLElement& element);
|
||||
+ XMLElementList::iterator addElement(std::shared_ptr<XMLElement> element);
|
||||
XMLElementAttributeList& getAttributeList() { return _attributes; }
|
||||
XMLElementList& getElementList() { return _elements; }
|
||||
/// Parse an XML file and add its element tree to this element
|
||||
@@ -134,8 +135,8 @@ XMLElement::setAttribute(const string& k
|
||||
}
|
||||
|
||||
inline XMLElementList::iterator
|
||||
-XMLElement::addElement(const XMLElement& element) {
|
||||
- XMLElementList::iterator it = _elements.insert(make_pair(element.getElementName(), element));
|
||||
+XMLElement::addElement(std::shared_ptr<XMLElement> element) {
|
||||
+ XMLElementList::iterator it = _elements.insert(make_pair(element->getElementName(), element));
|
||||
return it;
|
||||
}
|
||||
|
||||
@@ -158,9 +159,9 @@ inline bool
|
||||
XMLElement::getNextElement(XMLElement& element) {
|
||||
if (_iter == _elements.end())
|
||||
return false;
|
||||
- if (_iterByName && _iter->second.getElementName() != _iterName)
|
||||
+ if (_iterByName && _iter->second->getElementName() != _iterName)
|
||||
return false;
|
||||
- element = _iter->second;
|
||||
+ element = *_iter->second;
|
||||
++_iter;
|
||||
return true;
|
||||
}
|
||||
@@ -111,6 +111,7 @@ share/TrustedQSL/help/tqslapp/stnloc1.bmp
|
||||
share/TrustedQSL/help/tqslapp/stnloc1.htm
|
||||
share/TrustedQSL/help/tqslapp/stnloc2.bmp
|
||||
share/TrustedQSL/help/tqslapp/stnloc2.htm
|
||||
share/TrustedQSL/help/tqslapp/stnloc2park.bmp
|
||||
share/TrustedQSL/help/tqslapp/stnloc3.bmp
|
||||
share/TrustedQSL/help/tqslapp/stnloc4.bmp
|
||||
share/TrustedQSL/help/tqslapp/stnloc5.bmp
|
||||
|
||||
Reference in New Issue
Block a user