summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/opentextdlg.cpp35
1 files changed, 19 insertions, 16 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,42 +52,45 @@ OpenTextDlg::OpenTextDlg( QWidget *parent, sword::SWMgr *swordMgr, QPixmap *bibl
m_textList.insertItem( m_bibles );
connect( &m_textList, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotItemClicked(QListViewItem*)) );
if ( swordMgr )
{
sword::ModMap::iterator it;
QString type;
QPixmap *icon = 0x0;
QListViewItem *parent = 0x0;
for ( it = swordMgr->Modules.begin(); it != swordMgr->Modules.end(); it++ )
{
- type = it->second->Type();
- if ( type == "Biblical Texts" )
+ if ( it->second )
{
- icon = bibleIcon;
- parent = m_bibles;
+ type = it->second->Type();
+ if ( type == "Biblical Texts" )
+ {
+ icon = bibleIcon;
+ parent = m_bibles;
+ }
+ else if ( type == "Commentaries" )
+ {
+ icon = commentaryIcon;
+ parent = m_commentaries;
+ }
+ else if ( type == "Lexicons / Dictionaries" )
+ {
+ icon = lexiconIcon;
+ parent = m_lexicons;
+ }
+
+ parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) );
}
- else if ( type == "Commentaries" )
- {
- icon = commentaryIcon;
- parent = m_commentaries;
- }
- else if ( type == "Lexicons / Dictionaries" )
- {
- icon = lexiconIcon;
- parent = m_lexicons;
- }
-
- parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) );
}
}
m_textList.sort();
}
void OpenTextDlg::slotItemClicked( QListViewItem *item )
{
if ( item == m_bibles || item == m_lexicons || item == m_commentaries )
{
m_textList.clearSelection();
if ( item->childCount() > 0 )