int PartitionModel::rowCount( const QModelIndex& parent ) const { Partition* parentPartition = partitionForIndex( parent ); if ( parentPartition ) return parentPartition->children().count(); PartitionTable* table = m_device->partitionTable(); return table ? table->children().count() : 0; }
/** @param other Partition to copy */ Partition::Partition(const Partition& other) : PartitionNode(), m_Children(), m_Parent(other.m_Parent), m_FileSystem(FileSystemFactory::create(other.fileSystem())), m_Roles(other.m_Roles), m_FirstSector(other.m_FirstSector), m_LastSector(other.m_LastSector), m_DevicePath(other.m_DevicePath), m_MountPoint(other.m_MountPoint), m_AvailableFlags(other.m_AvailableFlags), m_ActiveFlags(other.m_ActiveFlags), m_IsMounted(other.m_IsMounted), m_SectorSize(other.m_SectorSize), m_State(other.m_State) { setPartitionPath(other.m_PartitionPath); foreach(const Partition* child, other.children()) { Partition* p = new Partition(*child); p->setParent(this); m_Children.append(p); } }