-rw-r--r-- | noncore/apps/dagger/opentextdlg.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/dagger/opentextdlg.cpp b/noncore/apps/dagger/opentextdlg.cpp index f7893a9..8c94a4b 100644 --- a/noncore/apps/dagger/opentextdlg.cpp +++ b/noncore/apps/dagger/opentextdlg.cpp | |||
@@ -52,44 +52,47 @@ OpenTextDlg::OpenTextDlg( QWidget *parent, sword::SWMgr *swordMgr, QPixmap *bibl | |||
52 | m_textList.insertItem( m_bibles ); | 52 | m_textList.insertItem( m_bibles ); |
53 | connect( &m_textList, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotItemClicked(QListViewItem*)) ); | 53 | connect( &m_textList, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotItemClicked(QListViewItem*)) ); |
54 | 54 | ||
55 | if ( swordMgr ) | 55 | if ( swordMgr ) |
56 | { | 56 | { |
57 | sword::ModMap::iterator it; | 57 | sword::ModMap::iterator it; |
58 | QString type; | 58 | QString type; |
59 | QPixmap *icon = 0x0; | 59 | QPixmap *icon = 0x0; |
60 | QListViewItem *parent = 0x0; | 60 | QListViewItem *parent = 0x0; |
61 | 61 | ||
62 | for ( it = swordMgr->Modules.begin(); it != swordMgr->Modules.end(); it++ ) | 62 | for ( it = swordMgr->Modules.begin(); it != swordMgr->Modules.end(); it++ ) |
63 | { | 63 | { |
64 | if ( it->second ) | ||
65 | { | ||
64 | type = it->second->Type(); | 66 | type = it->second->Type(); |
65 | if ( type == "Biblical Texts" ) | 67 | if ( type == "Biblical Texts" ) |
66 | { | 68 | { |
67 | icon = bibleIcon; | 69 | icon = bibleIcon; |
68 | parent = m_bibles; | 70 | parent = m_bibles; |
69 | } | 71 | } |
70 | else if ( type == "Commentaries" ) | 72 | else if ( type == "Commentaries" ) |
71 | { | 73 | { |
72 | icon = commentaryIcon; | 74 | icon = commentaryIcon; |
73 | parent = m_commentaries; | 75 | parent = m_commentaries; |
74 | } | 76 | } |
75 | else if ( type == "Lexicons / Dictionaries" ) | 77 | else if ( type == "Lexicons / Dictionaries" ) |
76 | { | 78 | { |
77 | icon = lexiconIcon; | 79 | icon = lexiconIcon; |
78 | parent = m_lexicons; | 80 | parent = m_lexicons; |
79 | } | 81 | } |
80 | 82 | ||
81 | parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) ); | 83 | parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) ); |
82 | } | 84 | } |
83 | } | 85 | } |
86 | } | ||
84 | 87 | ||
85 | m_textList.sort(); | 88 | m_textList.sort(); |
86 | } | 89 | } |
87 | 90 | ||
88 | void OpenTextDlg::slotItemClicked( QListViewItem *item ) | 91 | void OpenTextDlg::slotItemClicked( QListViewItem *item ) |
89 | { | 92 | { |
90 | if ( item == m_bibles || item == m_lexicons || item == m_commentaries ) | 93 | if ( item == m_bibles || item == m_lexicons || item == m_commentaries ) |
91 | { | 94 | { |
92 | m_textList.clearSelection(); | 95 | m_textList.clearSelection(); |
93 | if ( item->childCount() > 0 ) | 96 | if ( item->childCount() > 0 ) |
94 | { | 97 | { |
95 | item->setOpen( !item->isOpen() ); | 98 | item->setOpen( !item->isOpen() ); |