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

KFile

  • 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
31class KDirLister;
32namespace Solid
33{
34class StorageAccess;
35class StorageVolume;
36class OpticalDisc;
37class PortableMediaPlayer;
38}
39
40class KFilePlacesItem : public QObject
41{
42 Q_OBJECT
43public:
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
70Q_SIGNALS:
71 void itemChanged(const QString &id);
72
73private Q_SLOTS:
74 void onAccessibilityChanged(bool);
75 void onListerCompleted();
76
77private:
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
KBookmarkManager
KBookmark
KDirLister
KFilePlacesItem
Definition: kfileplacesitem_p.h:41
KFilePlacesItem::createDeviceBookmark
static KBookmark createDeviceBookmark(KBookmarkManager *manager, const QString &udi)
Definition: kfileplacesitem.cpp:277
KFilePlacesItem::setBookmark
void setBookmark(const KBookmark &bookmark)
Definition: kfileplacesitem.cpp:96
KFilePlacesItem::id
QString id() const
Definition: kfileplacesitem.cpp:77
KFilePlacesItem::createSystemBookmark
static KBookmark createSystemBookmark(KBookmarkManager *manager, const QString &untranslatedLabel, const QString &translatedLabel, const KUrl &url, const QString &iconName)
Definition: kfileplacesitem.cpp:261
KFilePlacesItem::bookmark
KBookmark bookmark() const
Definition: kfileplacesitem.cpp:91
KFilePlacesItem::isDevice
bool isDevice() const
Definition: kfileplacesitem.cpp:86
KFilePlacesItem::device
Solid::Device device() const
Definition: kfileplacesitem.cpp:112
KFilePlacesItem::itemChanged
void itemChanged(const QString &id)
KFilePlacesItem::createBookmark
static KBookmark createBookmark(KBookmarkManager *manager, const QString &label, const KUrl &url, const QString &iconName, KFilePlacesItem *after=0)
Definition: kfileplacesitem.cpp:234
KFilePlacesItem::~KFilePlacesItem
~KFilePlacesItem()
Definition: kfileplacesitem.cpp:73
KFilePlacesItem::data
QVariant data(int role) const
Definition: kfileplacesitem.cpp:131
KUrl
QObject
Solid::Device
device.h
kbookmark.h
label
QString label(StandardShortcut id)
Solid
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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