~ubuntu-branches/ubuntu/saucy/clementine/saucy

« back to all changes in this revision

Viewing changes to src/globalsearch/common.cpp

  • Committer: Package Import Robot
  • Author(s): Thomas PIERSON
  • Date: 2012-01-01 20:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120101204339-lsb6nndwhfy05sde
Tags: 1.0.1+dfsg-1
New upstream release. (Closes: #653926, #651611, #657391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of Clementine.
 
2
   Copyright 2011, David Sansome <me@davidsansome.com>
 
3
 
 
4
   Clementine is free software: you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation, either version 3 of the License, or
 
7
   (at your option) any later version.
 
8
 
 
9
   Clementine is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
   GNU General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License
 
15
   along with Clementine.  If not, see <http://www.gnu.org/licenses/>.
 
16
*/
 
17
 
 
18
#include "common.h"
 
19
 
 
20
#ifdef HAVE_DBUS
 
21
 
 
22
QDBusArgument& operator <<(QDBusArgument& arg, const GlobalSearchServiceResult& result) {
 
23
  arg.beginStructure();
 
24
  arg << result.result_id_
 
25
      << result.art_on_the_way_
 
26
      << result.provider_name_
 
27
      << result.type_
 
28
      << result.match_quality_
 
29
      << result.album_size_
 
30
      << result.title_
 
31
      << result.artist_
 
32
      << result.album_
 
33
      << result.album_artist_
 
34
      << result.is_compilation_
 
35
      << result.track_;
 
36
  arg.endStructure();
 
37
 
 
38
  return arg;
 
39
}
 
40
 
 
41
const QDBusArgument& operator >>(const QDBusArgument& arg, GlobalSearchServiceResult& result) {
 
42
  int type;
 
43
  int match_quality;
 
44
 
 
45
  arg.beginStructure();
 
46
  arg >> result.result_id_
 
47
      >> result.art_on_the_way_
 
48
      >> result.provider_name_
 
49
      >> type
 
50
      >> match_quality
 
51
      >> result.album_size_
 
52
      >> result.title_
 
53
      >> result.artist_
 
54
      >> result.album_
 
55
      >> result.album_artist_
 
56
      >> result.is_compilation_
 
57
      >> result.track_;
 
58
  arg.endStructure();
 
59
 
 
60
  result.type_ = static_cast<globalsearch::Type>(type);
 
61
  result.match_quality_ = static_cast<globalsearch::MatchQuality>(match_quality);
 
62
 
 
63
  return arg;
 
64
}
 
65
 
 
66
#endif // HAVE_DBUS