~ubuntu-branches/ubuntu/wily/kid3/wily-proposed

« back to all changes in this revision

Viewing changes to src/core/model/frametablemodel.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2012-05-14 18:27:44 UTC
  • mfrom: (1.1.14) (2.1.16 sid)
  • Revision ID: package-import@ubuntu.com-20120514182744-4tul4661q4rao8vm
Tags: 2.1-2
Remove patch 01-gcc4.7-ftbfs, it was merged with 2.1 to another location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * \author Urs Fleisch
7
7
 * \date 01 May 2011
8
8
 *
9
 
 * Copyright (C) 2011  Urs Fleisch
 
9
 * Copyright (C) 2011-2012  Urs Fleisch
10
10
 *
11
11
 * This file is part of Kid3.
12
12
 *
316
316
const Frame* FrameTableModel::getFrameOfIndex(const QModelIndex& index) const
317
317
{
318
318
  if (index.isValid() && index.row() < static_cast<int>(m_frames.size())) {
319
 
    FrameCollection::iterator it = frameAt(index.row());
 
319
    FrameCollection::const_iterator it = frameAt(index.row());
320
320
    return &(*it);
321
321
  }
322
322
  return 0;
576
576
    bool id3v1 = ftModel && ftModel->isId3v1();
577
577
    if (type == Frame::FT_Genre) {
578
578
      QComboBox* cb = new QComboBox(parent);
579
 
      if (cb) {
580
 
        if (!id3v1) {
581
 
          cb->setEditable(true);
582
 
          cb->setAutoCompletion(true);
583
 
          cb->setDuplicatesEnabled(false);
584
 
        }
 
579
      if (!id3v1) {
 
580
        cb->setEditable(true);
 
581
        cb->setAutoCompletion(true);
 
582
        cb->setDuplicatesEnabled(false);
 
583
      }
585
584
 
586
 
        QStringList strList;
587
 
        for (const char** sl = Genres::s_strList; *sl != 0; ++sl) {
588
 
          strList += *sl;
589
 
        }
590
 
        if (ConfigStore::s_miscCfg.m_onlyCustomGenres) {
591
 
          cb->addItem("");
592
 
        } else {
593
 
          cb->addItems(strList);
594
 
        }
595
 
        if (id3v1) {
596
 
          for (QStringList::const_iterator it =
597
 
                 ConfigStore::s_miscCfg.m_customGenres.begin();
598
 
               it != ConfigStore::s_miscCfg.m_customGenres.end();
599
 
               ++it) {
600
 
            if (Genres::getNumber(*it) != 255) {
601
 
              cb->addItem(*it);
602
 
            }
 
585
      QStringList strList;
 
586
      for (const char** sl = Genres::s_strList; *sl != 0; ++sl) {
 
587
        strList += *sl;
 
588
      }
 
589
      if (ConfigStore::s_miscCfg.m_onlyCustomGenres) {
 
590
        cb->addItem("");
 
591
      } else {
 
592
        cb->addItems(strList);
 
593
      }
 
594
      if (id3v1) {
 
595
        for (QStringList::const_iterator it =
 
596
               ConfigStore::s_miscCfg.m_customGenres.begin();
 
597
             it != ConfigStore::s_miscCfg.m_customGenres.end();
 
598
             ++it) {
 
599
          if (Genres::getNumber(*it) != 255) {
 
600
            cb->addItem(*it);
603
601
          }
604
 
        } else {
605
 
          cb->addItems(ConfigStore::s_miscCfg.m_customGenres);
606
602
        }
 
603
      } else {
 
604
        cb->addItems(ConfigStore::s_miscCfg.m_customGenres);
607
605
      }
608
606
      return cb;
609
607
    } else if (id3v1 &&