summaryrefslogtreecommitdiff
authordrw <drw>2005-01-03 21:04:08 (UTC)
committer drw <drw>2005-01-03 21:04:08 (UTC)
commit3344a34b7c5aadeb82fc7151bb6b2677ebd2f732 (patch) (unidiff)
tree14fb68ead17d159a03f7935fb335068ef16917d5
parent310c7dce0c9043f66725bc79449fe958a12ad459 (diff)
downloadopie-3344a34b7c5aadeb82fc7151bb6b2677ebd2f732.zip
opie-3344a34b7c5aadeb82fc7151bb6b2677ebd2f732.tar.gz
opie-3344a34b7c5aadeb82fc7151bb6b2677ebd2f732.tar.bz2
Fix crash when trying to display open text dialog when there are no modules in configured directory
Diffstat (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
@@ -61,24 +61,27 @@ OpenTextDlg::OpenTextDlg( QWidget *parent, sword::SWMgr *swordMgr, QPixmap *bibl
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 type = it->second->Type(); 64 if ( it->second )
65 if ( type == "Biblical Texts" )
66 { 65 {
67 icon = bibleIcon; 66 type = it->second->Type();
68 parent = m_bibles; 67 if ( type == "Biblical Texts" )
68 {
69 icon = bibleIcon;
70 parent = m_bibles;
71 }
72 else if ( type == "Commentaries" )
73 {
74 icon = commentaryIcon;
75 parent = m_commentaries;
76 }
77 else if ( type == "Lexicons / Dictionaries" )
78 {
79 icon = lexiconIcon;
80 parent = m_lexicons;
81 }
82
83 parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) );
69 } 84 }
70 else if ( type == "Commentaries" )
71 {
72 icon = commentaryIcon;
73 parent = m_commentaries;
74 }
75 else if ( type == "Lexicons / Dictionaries" )
76 {
77 icon = lexiconIcon;
78 parent = m_lexicons;
79 }
80
81 parent->insertItem( new QListViewItem( parent, QString::null, it->first.c_str() ) );
82 } 85 }
83 } 86 }
84 87