/usr/include/k3bdiritem.h is in libk3b-dev 2.0.3-0ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | /*
*
* Copyright (C) 2003-2008 Sebastian Trueg <trueg@k3b.org>
*
* This file is part of the K3b project.
* Copyright (C) 1998-2008 Sebastian Trueg <trueg@k3b.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* See the file "COPYING" for the exact licensing terms.
*/
#ifndef K3BDIRITEM_H
#define K3BDIRITEM_H
#include <qstring.h>
#include <qlist.h>
#include <kio/global.h>
#include "k3bdataitem.h"
#include "k3b_export.h"
namespace K3b {
class DataDoc;
class LIBK3B_EXPORT DirItem : public DataItem
{
public:
DirItem( const QString& name, DataDoc*, DirItem* parentDir = 0, const ItemFlags& flags = ItemFlags() );
/**
* Default copy constructor. Copies the dir including all children. However, none of the
* children will have set a doc and the copy dir will not have set a parent dir.
*/
DirItem( const DirItem& );
virtual ~DirItem();
DataItem* copy() const;
DirItem* getDirItem() const;
QList<DataItem*> children() const { return m_children; }
DirItem* addDataItem( DataItem* item );
DataItem* takeDataItem( DataItem* item );
DataItem* nextSibling() const;
DataItem* nextChild( DataItem* ) const;
bool alreadyInDirectory( const QString& fileName ) const;
DataItem* find( const QString& filename ) const;
DataItem* findByPath( const QString& );
long numFiles() const;
long numDirs() const;
bool isEmpty() const { return ( numDirs() + numFiles() == 0 ); }
/**
* returns true if item is a subItem of
* this dir item
* (returns also true if item == this
*/
bool isSubItem( DataItem* item ) const;
virtual bool isRemoveable() const;
/**
* Recursively creates a directory.
*/
bool mkdir( const QString& dir );
void setLocalPath( const QString& p ) { m_localPath = p; }
QString localPath() const { return m_localPath; }
KMimeType::Ptr mimeType() const;
/**
* \reimplemented
*/
bool writeToCd() const;
protected:
/**
* Normally one does not use this method but DataItem::size()
*
* This method does not take into account the possibility to share the data
* between files with the same inode in an iso9660 filesystem.
* For that one has to use FileCompilationSizeHandler.
*/
KIO::filesize_t itemSize( bool followSymlinks ) const;
/*
* Normally one does not use this method but DataItem::blocks()
*/
Msf itemBlocks( bool followSymlinks ) const;
private:
/**
* this recursivly updates the size of the directories.
* The size of this dir and the parent dir is updated.
* These values are just used for user information.
*/
void updateSize( DataItem*, bool removed = false );
/**
* Updates the number of files and directories. These values are
* just used for user information.
*/
void updateFiles( long files, long dirs );
/**
* Unsets OLD_SESSION flag when directory no longer has
* children from previous sessions
*/
void updateOldSessionFlag();
mutable QList<DataItem*> m_children;
// size of the items simply added
KIO::filesize_t m_size;
KIO::filesize_t m_followSymlinksSize;
// number of blocks (2048 bytes) used by all the items
long m_blocks;
long m_followSymlinksBlocks;
long m_files;
long m_dirs;
// HACK: store the original path to be able to use it's permissions
// remove this once we have a backup project
QString m_localPath;
};
class RootItem : public DirItem
{
public:
RootItem( DataDoc* );
~RootItem();
QString k3bName() const;
void setK3bName( const QString& );
bool isMoveable() const { return false; }
bool isRemoveable() const { return false; }
};
}
#endif
|