本文整理汇总了C++中Partition::available方法的典型用法代码示例。如果您正苦于以下问题:C++ Partition::available方法的具体用法?C++ Partition::available怎么用?C++ Partition::available使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partition
的用法示例。
在下文中一共展示了Partition::available方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showPartition
/** Shows information about a Partition in the InfoPane
@param area the current area the widget's dock is in
@param p the Partition to show information about
*/
void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p)
{
clear();
parentWidget()->parentWidget()->setWindowTitle(i18nc("@title:window", "Partition Information"));
int x = 0;
int y = createHeader(p.deviceNode(), cols(area));
if (p.fileSystem().type() == FileSystem::Luks)
{
QString deviceNode = p.partitionPath();
createLabels(i18nc("@label partition", "File system:"), p.fileSystem().name(), cols(area), x, y);
createLabels(i18nc("@label partition", "Capacity:"), Capacity::formatByteSize(p.capacity()), cols(area), x, y);
createLabels(i18nc("@label partition", "Cipher name:"), FS::luks::getCipherName(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Cipher mode:"), FS::luks::getCipherMode(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Hash:"), FS::luks::getHashName(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Key size:"), FS::luks::getKeySize(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "Payload offset:"), FS::luks::getPayloadOffset(deviceNode), cols(area), x, y);
createLabels(i18nc("@label partition", "First sector:"), QLocale().toString(p.firstSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Last sector:"), QLocale().toString(p.lastSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Number of sectors:"), QLocale().toString(p.length()), cols(area), x, y);
}
else
{
createLabels(i18nc("@label partition", "File system:"), p.fileSystem().name(), cols(area), x, y);
createLabels(i18nc("@label partition", "Capacity:"), Capacity::formatByteSize(p.capacity()), cols(area), x, y);
createLabels(i18nc("@label partition", "Available:"), Capacity::formatByteSize(p.available()), cols(area), x, y);
createLabels(i18nc("@label partition", "Used:"), Capacity::formatByteSize(p.used()), cols(area), x, y);
createLabels(i18nc("@label partition", "First sector:"), QLocale().toString(p.firstSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Last sector:"), QLocale().toString(p.lastSector()), cols(area), x, y);
createLabels(i18nc("@label partition", "Number of sectors:"), QLocale().toString(p.length()), cols(area), x, y);
}
}
示例2:
/** Creates a new Capacity instance.
@param p the Partition
@param t type of Capacity
*/
Capacity::Capacity(const Partition& p, Type t) :
m_Size(-1)
{
switch(t)
{
case Used: m_Size = p.used(); break;
case Available: m_Size = p.available(); break;
case Total: m_Size = p.capacity(); break;
default: break;
}
}