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

List:       kde-commits
Subject:    KDE/kdeedu/kwordquiz/src
From:       Peter Hedlund <peter () peterandlinda ! com>
Date:       2010-03-17 17:22:23
Message-ID: 1268846543.231961.22853.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1104431 by hedlund:

Simplification/cleanup. Written before we had translations.

 M  +3 -13     kwqtablemodel.cpp  


--- trunk/KDE/kdeedu/kwordquiz/src/kwqtablemodel.cpp #1104430:1104431
@@ -27,7 +27,6 @@
 #include "prefs.h"
 #include "documentsettings.h"
 #include "keduvocexpression.h"
-#include "kdebug.h"
 
 KWQTableModel::KWQTableModel(QObject * parent) : QAbstractTableModel(parent)
 {
@@ -161,24 +160,15 @@
 
   switch (role) {
     case Qt::EditRole:
-      if (index.column() == 0)
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->setTranslation(0, \
                value.toString());
-      else
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->setTranslation(1, \
value.toString()); +      \
m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->setTranslation(index.column(), \
value.toString());  break;
 
     case KWQTableModel::ImageRole:
-      if (index.column() == 0)
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(0)->setImageUrl(value.toUrl());
                
-      else
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(1)->setImageUrl(value.toUrl());
 +      m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(index.column())->setImageUrl(value.toUrl());
  break;
 
     case KWQTableModel::SoundRole:
-      if (index.column() == 0)
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(0)->setSoundUrl(value.toUrl());
                
-      else
-        m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(1)->setSoundUrl(value.toUrl());
 +      m_doc->lesson()->entries(KEduVocLesson::Recursive).value(index.row())->translation(index.column())->setSoundUrl(value.toUrl());
  break;
   }
 


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

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