~mixxxdevelopers/mixxx/mixxx-buildserver

« back to all changes in this revision

Viewing changes to mixxx/src/library/missingtablemodel.cpp

  • Committer: Albert Santoni
  • Date: 2011-03-20 00:27:15 UTC
  • mfrom: (2607.1.162 mixxx-1.9)
  • Revision ID: alberts@mixxx.org-20110320002715-sa2d88zbuc5kkyya
MergedĀ fromĀ 1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    return false;
82
82
}
83
83
 
 
84
int MissingTableModel::getTrackId(const QModelIndex& index) const
 
85
{
 
86
    if (!index.isValid()) {
 
87
        return -1;
 
88
    }
 
89
    return index.sibling(index.row(), fieldIndex(LIBRARYTABLE_ID)).data().toInt();
 
90
}
 
91
 
 
92
int MissingTableModel::getTrackRow(int trackId) const {
 
93
    return BaseSqlTableModel::getTrackRow(trackId);
 
94
}
 
95
 
84
96
TrackPointer MissingTableModel::getTrack(const QModelIndex& index) const
85
97
{
86
98
    //FIXME: use position instead of location for playlist tracks?
87
99
 
88
100
    //const int locationColumnIndex = this->fieldIndex(LIBRARYTABLE_LOCATION);
89
101
    //QString location = index.sibling(index.row(), locationColumnIndex).data().toString();
90
 
    int trackId = index.sibling(index.row(), fieldIndex(LIBRARYTABLE_ID)).data().toInt();
 
102
    int trackId = getTrackId(index);
91
103
    return m_trackDao.getTrack(trackId);
92
104
}
93
105
 
94
106
QString MissingTableModel::getTrackLocation(const QModelIndex& index) const
95
107
{
96
 
    int trackId = index.sibling(index.row(), fieldIndex(LIBRARYTABLE_ID)).data().toInt();
 
108
    int trackId = getTrackId(index);
97
109
    QString location = m_trackDao.getTrackLocation(trackId);
98
110
    return location;
99
111
}
151
163
        return false;
152
164
}
153
165
bool MissingTableModel::isColumnHiddenByDefault(int column) {
154
 
    if (column == fieldIndex(LIBRARYTABLE_KEY))    
 
166
    if (column == fieldIndex(LIBRARYTABLE_KEY))
155
167
        return true;
156
168
    return false;
157
169
}