• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KFile

  • sources
  • kde-4.14
  • kdelibs
  • kfile
kfileplacesitem_p.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
3 
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.
7 
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.
12 
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.
17 
18 */
19 
20 #ifndef KFILEPLACESITEM_P_H
21 #define KFILEPLACESITEM_P_H
22 
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QPointer>
26 #include <QtCore/QModelIndex>
27 #include <QtCore/QStringList>
28 #include <kbookmark.h>
29 #include <solid/device.h>
30 
31 class KDirLister;
32 namespace Solid
33 {
34 class StorageAccess;
35 class StorageVolume;
36 class OpticalDisc;
37 class PortableMediaPlayer;
38 }
39 
40 class KFilePlacesItem : public QObject
41 {
42  Q_OBJECT
43 public:
44  KFilePlacesItem(KBookmarkManager *manager,
45  const QString &address,
46  const QString &udi = QString());
47  ~KFilePlacesItem();
48 
49  QString id() const;
50 
51  bool isDevice() const;
52  KBookmark bookmark() const;
53  void setBookmark(const KBookmark &bookmark);
54  Solid::Device device() const;
55  QVariant data(int role) const;
56 
57  static KBookmark createBookmark(KBookmarkManager *manager,
58  const QString &label,
59  const KUrl &url,
60  const QString &iconName,
61  KFilePlacesItem *after = 0);
62  static KBookmark createSystemBookmark(KBookmarkManager *manager,
63  const QString &untranslatedLabel,
64  const QString &translatedLabel,
65  const KUrl &url,
66  const QString &iconName);
67  static KBookmark createDeviceBookmark(KBookmarkManager *manager,
68  const QString &udi);
69 
70 Q_SIGNALS:
71  void itemChanged(const QString &id);
72 
73 private Q_SLOTS:
74  void onAccessibilityChanged(bool);
75  void onListerCompleted();
76 
77 private:
78  QVariant bookmarkData(int role) const;
79  QVariant deviceData(int role) const;
80 
81  bool hasFullIcon(const KBookmark &bookmark) const;
82  QString iconNameForBookmark(const KBookmark &bookmark) const;
83 
84  static QString generateNewId();
85 
86  KBookmarkManager *m_manager;
87  KBookmark m_bookmark;
88  KDirLister *m_lister;
89  bool m_folderIsEmpty;
90  bool m_isCdrom;
91  bool m_isAccessible;
92  QString m_text;
93  mutable Solid::Device m_device;
94  mutable QPointer<Solid::StorageAccess> m_access;
95  mutable QPointer<Solid::StorageVolume> m_volume;
96  mutable QPointer<Solid::OpticalDisc> m_disc;
97  mutable QPointer<Solid::PortableMediaPlayer> m_mtp;
98  QString m_iconPath;
99  QStringList m_emblems;
100 };
101 
102 #endif
KFilePlacesItem::KFilePlacesItem
KFilePlacesItem(KBookmarkManager *manager, const QString &address, const QString &udi=QString())
Definition: kfileplacesitem.cpp:38
KFilePlacesItem::createBookmark
static KBookmark createBookmark(KBookmarkManager *manager, const QString &label, const KUrl &url, const QString &iconName, KFilePlacesItem *after=0)
Definition: kfileplacesitem.cpp:234
label
QString label(StandardShortcut id)
KFilePlacesItem::createSystemBookmark
static KBookmark createSystemBookmark(KBookmarkManager *manager, const QString &untranslatedLabel, const QString &translatedLabel, const KUrl &url, const QString &iconName)
Definition: kfileplacesitem.cpp:261
QPointer< Solid::StorageAccess >
Solid::Device
KBookmarkManager
KBookmark
KUrl
KFilePlacesItem::device
Solid::Device device() const
Definition: kfileplacesitem.cpp:112
KFilePlacesItem::isDevice
bool isDevice() const
Definition: kfileplacesitem.cpp:86
KFilePlacesItem::setBookmark
void setBookmark(const KBookmark &bookmark)
Definition: kfileplacesitem.cpp:96
KFilePlacesItem::bookmark
KBookmark bookmark() const
Definition: kfileplacesitem.cpp:91
QObject
KFilePlacesItem
Definition: kfileplacesitem_p.h:40
QString
QStringList
KFilePlacesItem::id
QString id() const
Definition: kfileplacesitem.cpp:77
kbookmark.h
KFilePlacesItem::data
QVariant data(int role) const
Definition: kfileplacesitem.cpp:131
KFilePlacesItem::itemChanged
void itemChanged(const QString &id)
KFilePlacesItem::createDeviceBookmark
static KBookmark createDeviceBookmark(KBookmarkManager *manager, const QString &udi)
Definition: kfileplacesitem.cpp:277
device.h
KDirLister
KFilePlacesItem::~KFilePlacesItem
~KFilePlacesItem()
Definition: kfileplacesitem.cpp:73
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KFile

Skip menu "KFile"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal