~daschuer/mixxx/autodj

« back to all changes in this revision

Viewing changes to mixxx/src/library/rhythmbox/rhythmboxplaylistmodel.cpp

  • Committer: Daniel Schürmann
  • Date: 2012-03-01 22:34:57 UTC
  • mfrom: (2793.1.194 trunk)
  • Revision ID: daschuer@gmx.de-20120301223457-t5oj4r3ceua8uzd5
merged with lp:mixxx

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
void RhythmboxPlaylistModel::setPlaylist(QString playlist_path) {
104
104
    int playlistId = -1;
105
105
    QSqlQuery finder_query(m_database);
106
 
    finder_query.prepare(
107
 
        "SELECT id from rhythmbox_playlists where name='"+playlist_path+"'");
 
106
    finder_query.prepare("SELECT id from rhythmbox_playlists where name=:name");
 
107
    finder_query.bindValue(":name", playlist_path);
 
108
 
108
109
    if (!finder_query.exec()) {
109
110
        qDebug() << "SQL Error in RhythmboxPlaylistModel.cpp: line"
110
111
                 << __LINE__ << " " << finder_query.lastError();
130
131
    QString queryString = QString(
131
132
        "CREATE TEMPORARY VIEW IF NOT EXISTS %1 AS "
132
133
        "SELECT %2 FROM %3 WHERE playlist_id = %4")
133
 
            .arg(driver->formatValue(playlistNameField))
134
 
            .arg(columns.join(","))
135
 
            .arg("rhythmbox_playlist_tracks")
136
 
            .arg(playlistId);
 
134
            .arg(driver->formatValue(playlistNameField),
 
135
                 columns.join(","),
 
136
                 "rhythmbox_playlist_tracks",
 
137
                 QString::number(playlistId));
137
138
    query.prepare(queryString);
138
139
 
139
140
    if (!query.exec()) {