PageRenderTime 132ms CodeModel.GetById 72ms app.highlight 3ms RepoModel.GetById 41ms app.codeStats 0ms

/src/libtomahawk/database/DatabaseCommand_SourceOffline.cpp

http://github.com/tomahawk-player/tomahawk
C++ | 41 lines | 18 code | 6 blank | 17 comment | 0 complexity | 712921a9207a0c401125c7b8d4359abd MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 4 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "DatabaseCommand_SourceOffline.h"
20
21#include "DatabaseImpl.h"
22#include "TomahawkSqlQuery.h"
23#include "utils/Logger.h"
24#include "Source.h"
25
26using namespace Tomahawk;
27
28DatabaseCommand_SourceOffline::DatabaseCommand_SourceOffline( int id )
29    : DatabaseCommand()
30    , m_id( id )
31{
32}
33
34
35void
36DatabaseCommand_SourceOffline::exec( DatabaseImpl* lib )
37{
38    TomahawkSqlQuery q = lib->newquery();
39    q.exec( QString( "UPDATE source SET isonline = 'false' WHERE id = %1" )
40            .arg( m_id ) );
41}