[sword-cvs] sword/src/mgr swmgr.cpp,1.86,1.87

sword@www.crosswire.org sword@www.crosswire.org
Tue, 22 Apr 2003 15:00:04 -0700


Update of /usr/local/cvsroot/sword/src/mgr
In directory www:/tmp/cvs-serv13255

Modified Files:
	swmgr.cpp 
Log Message:
AbsoluteDataPath fix for LD/GenBook

Index: swmgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/swmgr.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** swmgr.cpp	16 Feb 2003 06:54:52 -0000	1.86
--- swmgr.cpp	22 Apr 2003 22:00:02 -0000	1.87
***************
*** 769,777 ****
  	}
  
! 	if (!stricmp(driver.c_str(), "RawLD"))
  		newmod = new RawLD(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
  
! 	if (!stricmp(driver.c_str(), "RawLD4"))
  		newmod = new RawLD4(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
  
  	if (!stricmp(driver.c_str(), "zLD")) {
--- 769,782 ----
  	}
  
!         string::size_type pos;  //used for position of final / in AbsoluteDataPath, but also set to 1 for modules types that need to strip module name
! 	if (!stricmp(driver.c_str(), "RawLD")) {
  		newmod = new RawLD(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
+                 pos = 1;
+         }
  
! 	if (!stricmp(driver.c_str(), "RawLD4")) {
  		newmod = new RawLD4(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
+                 pos = 1;
+         }
  
  	if (!stricmp(driver.c_str(), "zLD")) {
***************
*** 794,808 ****
  			newmod = new zLD(datapath.c_str(), name.c_str(), description.c_str(), blockCount, compress, 0, enc, direction, markup, lang.c_str());
  		}
  	}
  
  	if (!stricmp(driver.c_str(), "RawGenBook")) {
  		newmod = new RawGenBook(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
  	}
-     // if a specific module type is set in the config, use this
-     if ((entry = section.find("Type")) != section.end())
-         newmod->Type(entry->second.c_str());
  
!      newmod->setConfig(&section);
! 	return newmod;
  }
  
--- 799,821 ----
  			newmod = new zLD(datapath.c_str(), name.c_str(), description.c_str(), blockCount, compress, 0, enc, direction, markup, lang.c_str());
  		}
+                 pos = 1;
  	}
  
  	if (!stricmp(driver.c_str(), "RawGenBook")) {
  		newmod = new RawGenBook(datapath.c_str(), name.c_str(), description.c_str(), 0, enc, direction, markup, lang.c_str());
+                 pos = 1;
  	}
  
!         if (pos == 1) {
!                 pos = section["AbsoluteDataPath"].rfind("/");
!                 section["AbsoluteDataPath"].erase(pos, section["AbsoluteDataPath"].length() - pos);
!         }
! 
!         // if a specific module type is set in the config, use this
!         if ((entry = section.find("Type")) != section.end())
!                 newmod->Type(entry->second.c_str());
! 
!         newmod->setConfig(&section);
!                 return newmod;
  }