summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/dub/dub/dubplaylistitem.cpp
blob: 50405b36db7db3ba217b0d93ad75292db540106a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
//
// C++ Implementation: dubplaylistitem.cpp
//
// Description: 
//
//
// Author: Eray Ozkural (exa) <[email protected]>, (C) 2001
//
// Copyright: See COPYING file that comes with this distribution
//
//

//#include dubplaylistitem.cpp


#include "dubplaylistitem.h"
#include <tdefile.h>
#include <tdefileitem.h>
#include <kdebug.h>
#include <tdemessagebox.h>
#include <tdelocale.h>

DubPlaylistItem::DubPlaylistItem(const KFileItem& fItem)
 : fileItem(fItem)
{
//   kdDebug(90010) << "construct playlist item " << fItem.url().prettyURL() << endl;

//  PlaylistItemData::addRef();
  PlaylistItemData::added();
}

DubPlaylistItem::~DubPlaylistItem(){
//   kdDebug(90010) << "destruct playlist item " << fileItem.url().prettyURL() << endl;

//  PlaylistItemData::removed();
  PlaylistItemData::removeRef();
}

TQString DubPlaylistItem::property(const TQString &key, const TQString &def) const {
//   kdDebug(90010) << "property " << key << endl;
  if (isProperty(key)) {
    kdDebug(90010) << key << " -> " << property_map.find(key).data() << endl;
    return property_map.find(key).data();
  }
  else
    return def;
}

void DubPlaylistItem::setProperty(const TQString &key, const TQString &val) {
//   kdDebug(90010) << "set property" << endl;
  property_map[key] = val;
}

void DubPlaylistItem::clearProperty(const TQString &key) {
//   kdDebug(90010) << "clear property" << endl;
  property_map.remove(key);
}

TQStringList DubPlaylistItem::properties() const {
//   kdDebug(90010) << "properties" << endl;
  TQStringList list;
  for (Properties::const_iterator i=property_map.begin();
       i!=property_map.end(); i++) {
    list.append(i.data());
  }
  return list;
}

bool DubPlaylistItem::isProperty(const TQString &key) const {
//   kdDebug(90010) << "is property? " << key << endl;
  return (property_map.find(key) != property_map.end());
}

KURL DubPlaylistItem::url() const {
//   kdDebug(90010) << "item url" << endl;

  return fileItem.url();
}
/** No descriptions */
void DubPlaylistItem::remove() {
  KMessageBox::information(0, i18n("Do you really want to delete this file?"));
}