2010-03-01 21:32:19 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2010 by Volker Lanz <vl@fidra.de *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2010-03-01 23:08:53 +00:00
|
|
|
#include "plugins/dummy/dummypartitiontable.h"
|
|
|
|
#include "plugins/dummy/dummypartition.h"
|
|
|
|
#include "plugins/dummy/dummybackend.h"
|
2010-03-01 21:32:19 +00:00
|
|
|
|
|
|
|
#include "core/partition.h"
|
|
|
|
#include "core/device.h"
|
|
|
|
|
|
|
|
#include "fs/filesystem.h"
|
|
|
|
|
|
|
|
#include "util/report.h"
|
|
|
|
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
DummyPartitionTable::DummyPartitionTable() :
|
|
|
|
CoreBackendPartitionTable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
DummyPartitionTable::~DummyPartitionTable()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::open()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool DummyPartitionTable::commit(quint32 timeout)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(timeout);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
CoreBackendPartition* DummyPartitionTable::getExtendedPartition()
|
|
|
|
{
|
|
|
|
return new DummyPartition();
|
|
|
|
}
|
|
|
|
|
|
|
|
CoreBackendPartition* DummyPartitionTable::getPartitionBySector(qint64 sector)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(sector);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return new DummyPartition();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::createPartition(Report& report, const Partition& partition, quint32& new_number)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(partition);
|
|
|
|
Q_UNUSED(new_number);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::deletePartition(Report& report, const Partition& partition)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(partition);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::updateGeometry(Report& report, const Partition& partition, qint64 sector_start, qint64 sector_end)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(partition);
|
|
|
|
Q_UNUSED(sector_start);
|
|
|
|
Q_UNUSED(sector_end);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::clobberFileSystem(Report& report, const Partition& partition)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(partition);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool DummyPartitionTable::resizeFileSystem(Report& report, const Partition& partition, qint64 newLength)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(partition);
|
|
|
|
Q_UNUSED(newLength);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
FileSystem::Type DummyPartitionTable::detectFileSystemBySector(Report& report, const Device& device, qint64 sector)
|
|
|
|
{
|
2010-03-01 23:08:53 +00:00
|
|
|
Q_UNUSED(report);
|
|
|
|
Q_UNUSED(device);
|
|
|
|
Q_UNUSED(sector);
|
|
|
|
|
2010-03-01 21:32:19 +00:00
|
|
|
FileSystem::Type rval = FileSystem::Unknown;
|
|
|
|
return rval;
|
|
|
|
}
|