fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kfile / kfileplacesitem_p.h
blob30b5e542968ce7a4225a2ef845c91449638dd30a
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef KFILEPLACESITEM_P_H
21 #define KFILEPLACESITEM_P_H
24 #include <QtCore/QObject>
25 #include <QtCore/QModelIndex>
26 #include <kbookmark.h>
27 #include <solid/device.h>
29 class KDirLister;
31 class KFilePlacesItem : public QObject
33 Q_OBJECT
34 public:
35 KFilePlacesItem(KBookmarkManager *manager,
36 const QString &address,
37 const QString &udi = QString());
38 ~KFilePlacesItem();
40 QString id() const;
42 bool isDevice() const;
43 KBookmark bookmark() const;
44 void setBookmark(const KBookmark &bookmark);
45 Solid::Device device() const;
46 QVariant data(int role) const;
48 static KBookmark createBookmark(KBookmarkManager *manager,
49 const QString &label,
50 const KUrl &url,
51 const QString &iconName);
52 static KBookmark createSystemBookmark(KBookmarkManager *manager,
53 const QString &label,
54 const KUrl &url,
55 const QString &iconName);
56 static KBookmark createDeviceBookmark(KBookmarkManager *manager,
57 const QString &udi);
59 Q_SIGNALS:
60 void itemChanged(const QString &id);
62 private Q_SLOTS:
63 void onAccessibilityChanged();
64 void onListerCompleted();
66 private:
67 QVariant bookmarkData(int role) const;
68 QVariant deviceData(int role) const;
70 bool hasFullIcon(const KBookmark &bookmark) const;
71 QString iconNameForBookmark(const KBookmark &bookmark) const;
73 static QString generateNewId();
75 KBookmarkManager *m_manager;
76 KBookmark m_bookmark;
77 KDirLister *m_lister;
78 bool m_folderIsEmpty;
81 #endif