@ -57,8 +57,8 @@ CItemBase::CItemBase(CMainIndex* mainIndex, const Type type)
m_type ( type ) ,
m_type ( type ) ,
m_sortingEnabled ( true ) { }
m_sortingEnabled ( true ) { }
CItemBase : : CItemBase ( CItemBase * tq parentItem, const Type type )
CItemBase : : CItemBase ( CItemBase * parentItem, const Type type )
: KListViewItem ( tq parentItem) ,
: KListViewItem ( parentItem) ,
m_type ( type ) ,
m_type ( type ) ,
m_sortingEnabled ( true ) { }
m_sortingEnabled ( true ) { }
@ -140,7 +140,7 @@ void CItemBase::sort() {
/* ---------- new class: CModuleItem ------------ */
/* ---------- new class: CModuleItem ------------ */
/* ---------------------------------------------- */
/* ---------------------------------------------- */
CModuleItem : : CModuleItem ( CTreeFolder * tq parentItem, CSwordModuleInfo * module ) : CItemBase ( tq parentItem) , m_module ( module ) { }
CModuleItem : : CModuleItem ( CTreeFolder * parentItem, CSwordModuleInfo * module ) : CItemBase ( parentItem) , m_module ( module ) { }
CModuleItem : : ~ CModuleItem ( ) { }
CModuleItem : : ~ CModuleItem ( ) { }
@ -252,8 +252,8 @@ const bool CModuleItem::enableAction( const MenuAction action ) {
/* ---------- new class: CBookmarkItem ------------*/
/* ---------- new class: CBookmarkItem ------------*/
/* ----------------------------------------------*/
/* ----------------------------------------------*/
CBookmarkItem : : CBookmarkItem ( CFolderBase * tq parentItem, CSwordModuleInfo * module , const TQString & key , const TQString & description )
CBookmarkItem : : CBookmarkItem ( CFolderBase * parentItem, CSwordModuleInfo * module , const TQString & key , const TQString & description )
: CItemBase ( tq parentItem) ,
: CItemBase ( parentItem) ,
m_description ( description ) ,
m_description ( description ) ,
m_moduleName ( module ? module - > name ( ) : TQString ( ) ) {
m_moduleName ( module ? module - > name ( ) : TQString ( ) ) {
if ( ( module & & ( module - > type ( ) = = CSwordModuleInfo : : Bible ) | | ( module - > type ( ) = = CSwordModuleInfo : : Commentary ) ) ) {
if ( ( module & & ( module - > type ( ) = = CSwordModuleInfo : : Bible ) | | ( module - > type ( ) = = CSwordModuleInfo : : Commentary ) ) ) {
@ -269,8 +269,8 @@ m_moduleName(module ? module->name() : TQString()) {
m_startupXML = TQDomElement ( ) ; //empty XML code
m_startupXML = TQDomElement ( ) ; //empty XML code
}
}
CBookmarkItem : : CBookmarkItem ( CFolderBase * tq parentItem, TQDomElement & xml )
CBookmarkItem : : CBookmarkItem ( CFolderBase * parentItem, TQDomElement & xml )
: CItemBase ( tq parentItem) ,
: CItemBase ( parentItem) ,
m_key ( TQString ( ) ) ,
m_key ( TQString ( ) ) ,
m_description ( TQString ( ) ) ,
m_description ( TQString ( ) ) ,
m_moduleName ( TQString ( ) ) {
m_moduleName ( TQString ( ) ) {
@ -445,9 +445,9 @@ bool CBookmarkItem::acceptDrop(const TQMimeSource* /*src*/) const {
CFolderBase : : CFolderBase ( CMainIndex * mainIndex , const Type type ) : CItemBase ( mainIndex , type ) { }
CFolderBase : : CFolderBase ( CMainIndex * mainIndex , const Type type ) : CItemBase ( mainIndex , type ) { }
CFolderBase : : CFolderBase ( CFolderBase * tq parentItem, const Type type ) : CItemBase ( tq parentItem, type ) { }
CFolderBase : : CFolderBase ( CFolderBase * parentItem, const Type type ) : CItemBase ( parentItem, type ) { }
CFolderBase : : CFolderBase ( CFolderBase * tq parentFolder, const TQString & caption ) : CItemBase ( tq parentFolder) {
CFolderBase : : CFolderBase ( CFolderBase * parentFolder, const TQString & caption ) : CItemBase ( parentFolder) {
setText ( 0 , caption ) ;
setText ( 0 , caption ) ;
}
}
@ -715,54 +715,54 @@ namespace Bookmarks {
doc . appendChild ( content ) ;
doc . appendChild ( content ) ;
//first create the bookmark groups in the XML document, then add the bookmarks to each tqparent
//first create the bookmark groups in the XML document, then add the bookmarks to each tqparent
TQMap < int , TQDomElement > tq parentMap; //maps tqparent ids to dom elements
TQMap < int , TQDomElement > parentMap; //maps tqparent ids to dom elements
TQStringList groupList = config - > readListEntry ( " Groups " ) ;
TQStringList groupList = config - > readListEntry ( " Groups " ) ;
TQValueList < int > tq parentList = config - > readIntListEntry ( " Group tq parents" ) ;
TQValueList < int > parentList = config - > readIntListEntry ( " Group parents" ) ;
TQStringList : : Iterator it_groups = groupList . begin ( ) ;
TQStringList : : Iterator it_groups = groupList . begin ( ) ;
TQValueList < int > : : Iterator it_parents = tq parentList. begin ( ) ;
TQValueList < int > : : Iterator it_parents = parentList. begin ( ) ;
int tq parentIDCounter = 0 ;
int parentIDCounter = 0 ;
while ( ( it_groups ! = groupList . end ( ) ) & & ( it_parents ! = tq parentList. end ( ) ) ) {
while ( ( it_groups ! = groupList . end ( ) ) & & ( it_parents ! = parentList. end ( ) ) ) {
TQDomElement tq parentElement = ( * it_parents = = - 1 ) ? content : tq parentMap[ * it_parents ] ;
TQDomElement parentElement = ( * it_parents = = - 1 ) ? content : parentMap[ * it_parents ] ;
if ( tq parentElement. isNull ( ) ) {
if ( parentElement. isNull ( ) ) {
qWarning ( " EMPTY PARENT FOUND! " ) ;
qWarning ( " EMPTY PARENT FOUND! " ) ;
tq parentElement = content ;
parentElement = content ;
} ;
} ;
TQDomElement elem = doc . createElement ( " Folder " ) ;
TQDomElement elem = doc . createElement ( " Folder " ) ;
elem . setAttribute ( " caption " , ( * it_groups ) ) ;
elem . setAttribute ( " caption " , ( * it_groups ) ) ;
tq parentMap. insert ( tq parentIDCounter, elem ) ;
parentMap. insert ( parentIDCounter, elem ) ;
tq parentElement. appendChild ( elem ) ;
parentElement. appendChild ( elem ) ;
+ + it_parents ;
+ + it_parents ;
+ + it_groups ;
+ + it_groups ;
+ + tq parentIDCounter;
+ + parentIDCounter;
}
}
//groups are now read in, create now the bookmarks
//groups are now read in, create now the bookmarks
tq parentList = config - > readIntListEntry ( " Bookmark tq parents" ) ;
parentList = config - > readIntListEntry ( " Bookmark parents" ) ;
TQStringList bookmarkList = config - > readListEntry ( " Bookmarks " ) ;
TQStringList bookmarkList = config - > readListEntry ( " Bookmarks " ) ;
TQStringList bookmarkModulesList = config - > readListEntry ( " Bookmark modules " ) ;
TQStringList bookmarkModulesList = config - > readListEntry ( " Bookmark modules " ) ;
TQStringList bookmarkDescriptionsList = config - > readListEntry ( " Bookmark descriptions " ) ;
TQStringList bookmarkDescriptionsList = config - > readListEntry ( " Bookmark descriptions " ) ;
it_parents = tq parentList. begin ( ) ;
it_parents = parentList. begin ( ) ;
TQStringList : : Iterator it_bookmarks = bookmarkList . begin ( ) ;
TQStringList : : Iterator it_bookmarks = bookmarkList . begin ( ) ;
TQStringList : : Iterator it_modules = bookmarkModulesList . begin ( ) ;
TQStringList : : Iterator it_modules = bookmarkModulesList . begin ( ) ;
TQStringList : : Iterator it_descriptions = bookmarkDescriptionsList . begin ( ) ;
TQStringList : : Iterator it_descriptions = bookmarkDescriptionsList . begin ( ) ;
while ( it_bookmarks ! = bookmarkList . end ( )
while ( it_bookmarks ! = bookmarkList . end ( )
& & it_parents ! = tq parentList. end ( )
& & it_parents ! = parentList. end ( )
& & it_modules ! = bookmarkModulesList . end ( )
& & it_modules ! = bookmarkModulesList . end ( )
) {
) {
TQDomElement tq parentElement = ( ( * it_parents ) = = - 1 ) ? content : tq parentMap[ ( * it_parents ) ] ;
TQDomElement parentElement = ( ( * it_parents ) = = - 1 ) ? content : parentMap[ ( * it_parents ) ] ;
if ( tq parentElement. isNull ( ) ) {
if ( parentElement. isNull ( ) ) {
qWarning ( " EMPTY PARENT FOUND! " ) ;
qWarning ( " EMPTY PARENT FOUND! " ) ;
tq parentElement = content ;
parentElement = content ;
} ;
} ;
TQDomElement elem = doc . createElement ( " Bookmark " ) ;
TQDomElement elem = doc . createElement ( " Bookmark " ) ;
@ -773,7 +773,7 @@ namespace Bookmarks {
CSwordModuleInfo * m = CPointers : : backend ( ) - > findModuleByName ( * it_modules ) ;
CSwordModuleInfo * m = CPointers : : backend ( ) - > findModuleByName ( * it_modules ) ;
elem . setAttribute ( " moduledescription " , m ? m - > config ( CSwordModuleInfo : : Description ) : TQString ( ) ) ;
elem . setAttribute ( " moduledescription " , m ? m - > config ( CSwordModuleInfo : : Description ) : TQString ( ) ) ;
tq parentElement. appendChild ( elem ) ;
parentElement. appendChild ( elem ) ;
+ + it_parents ;
+ + it_parents ;
@ -833,12 +833,12 @@ OldBookmarksFolder::OldBookmarksFolder(CTreeFolder* folder) : CBookmarkFolder(fo
// New class SubFolder
// New class SubFolder
SubFolder : : SubFolder ( CFolderBase * tq parentItem, const TQString & caption ) : CBookmarkFolder ( tq parentItem, BookmarkFolder ) {
SubFolder : : SubFolder ( CFolderBase * parentItem, const TQString & caption ) : CBookmarkFolder ( parentItem, BookmarkFolder ) {
m_startupXML = TQDomElement ( ) ;
m_startupXML = TQDomElement ( ) ;
setText ( 0 , caption ) ;
setText ( 0 , caption ) ;
}
}
SubFolder : : SubFolder ( CFolderBase * tq parentItem, TQDomElement & xml ) : CBookmarkFolder ( tq parentItem, BookmarkFolder ) {
SubFolder : : SubFolder ( CFolderBase * parentItem, TQDomElement & xml ) : CBookmarkFolder ( parentItem, BookmarkFolder ) {
m_startupXML = xml ;
m_startupXML = xml ;
}
}
@ -912,7 +912,7 @@ SubFolder::SubFolder(CFolderBase* tqparentItem, TQDomElement& xml ) : CBookmarkF
//restore all child items
//restore all child items
TQDomElement child = elem . firstChild ( ) . toElement ( ) ;
TQDomElement child = elem . firstChild ( ) . toElement ( ) ;
CItemBase * oldItem = 0 ;
CItemBase * oldItem = 0 ;
while ( ! child . isNull ( ) & & child . tq parentNode( ) = = elem ) {
while ( ! child . isNull ( ) & & child . parentNode( ) = = elem ) {
CItemBase * i = 0 ;
CItemBase * i = 0 ;
if ( child . tagName ( ) = = " Folder " ) {
if ( child . tagName ( ) = = " Folder " ) {
i = new Bookmarks : : SubFolder ( this , child ) ;
i = new Bookmarks : : SubFolder ( this , child ) ;
@ -939,7 +939,7 @@ CBookmarkFolder::CBookmarkFolder(CMainIndex* mainIndex, const Type type) : CTree
setSortingEnabled ( false ) ;
setSortingEnabled ( false ) ;
}
}
CBookmarkFolder : : CBookmarkFolder ( CFolderBase * tq parentItem, const Type type ) : CTreeFolder ( tq parentItem, type , " * " ) {
CBookmarkFolder : : CBookmarkFolder ( CFolderBase * parentItem, const Type type ) : CTreeFolder ( parentItem, type , " * " ) {
setSortingEnabled ( false ) ;
setSortingEnabled ( false ) ;
}
}
@ -1059,7 +1059,7 @@ const bool CBookmarkFolder::loadBookmarksFromXML( const TQString& xml ) {
CItemBase * oldItem = 0 ;
CItemBase * oldItem = 0 ;
//restore all child items
//restore all child items
TQDomElement child = document . firstChild ( ) . toElement ( ) ;
TQDomElement child = document . firstChild ( ) . toElement ( ) ;
while ( ! child . isNull ( ) & & child . tq parentNode( ) = = document ) {
while ( ! child . isNull ( ) & & child . parentNode( ) = = document ) {
CItemBase * i = 0 ;
CItemBase * i = 0 ;
if ( child . tagName ( ) = = " Folder " ) {
if ( child . tagName ( ) = = " Folder " ) {
i = new Bookmarks : : SubFolder ( this , child ) ;
i = new Bookmarks : : SubFolder ( this , child ) ;