[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/kwordquiz/src
From:       Frederik Gladhorn <gladhorn () kde ! org>
Date:       2010-01-13 22:02:24
Message-ID: 1263420144.639180.11024.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1074340 by gladhorn:

don't crash when opening documents with < 2 identifiers
Patch by: Aleks 


 M  +4 -0      kwordquiz.cpp  


--- trunk/KDE/kdeedu/kwordquiz/src/kwordquiz.cpp #1074339:1074340
@@ -585,6 +585,10 @@
   if (!url.isEmpty() && KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, this)) {
     int result = m_doc->open(url);
     if (result == KEduVocDocument::NoError) {
+      while (m_doc->identifierCount() < 2) { //if we opened a TAB-less CSV, there
+        m_doc->appendIdentifier(); //may be 0 or 1 identifiers, we need at least 2  
+      }
+ 
       m_tableModel->reset();
       m_dirWatch->addFile(url.path());
       setCaption(m_doc->url().fileName(), false);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic