cleanup some stuff: whitespace fixes, add some q_disable_copy macros, add some
initialisations to class headers svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=1046678
This commit is contained in:
parent
0695f3fe05
commit
5036af3e5d
|
@ -38,6 +38,7 @@ class KPushButton;
|
|||
class FileSystemSupportDialog : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(FileSystemSupportDialog)
|
||||
|
||||
private:
|
||||
class FileSystemSupportDialogWidget : public QWidget, public Ui::FileSystemSupportDialogWidgetBase
|
||||
|
|
|
@ -38,6 +38,8 @@ class QString;
|
|||
*/
|
||||
class InfoPane : public QWidget
|
||||
{
|
||||
Q_DISABLE_COPY(InfoPane)
|
||||
|
||||
public:
|
||||
InfoPane(QWidget* parent);
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ class KActionCollection;
|
|||
class LIBPARTITIONMANAGERPRIVATE_EXPORT ListDevices : public QWidget, public Ui::ListDevicesBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ListDevices)
|
||||
|
||||
public:
|
||||
ListDevices(QWidget* parent);
|
||||
|
|
|
@ -41,6 +41,7 @@ class KActionCollection;
|
|||
class LIBPARTITIONMANAGERPRIVATE_EXPORT ListOperations : public QWidget, public Ui::ListOperationsBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ListOperations)
|
||||
|
||||
public:
|
||||
ListOperations(QWidget* parent);
|
||||
|
|
|
@ -42,6 +42,7 @@ class KActionCollection;
|
|||
class LIBPARTITIONMANAGERPRIVATE_EXPORT MainWindow : public KXmlGuiWindow, public Ui::MainWindowBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(MainWindow)
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = NULL, KActionCollection* coll = NULL);
|
||||
|
|
|
@ -80,6 +80,8 @@
|
|||
|
||||
class PartitionTreeWidgetItem : public QTreeWidgetItem
|
||||
{
|
||||
Q_DISABLE_COPY(PartitionTreeWidgetItem)
|
||||
|
||||
public:
|
||||
PartitionTreeWidgetItem(const Partition* p) : QTreeWidgetItem(), m_Partition(p) {}
|
||||
const Partition* partition() const { return m_Partition; }
|
||||
|
|
|
@ -45,6 +45,7 @@ class ProgressDialog;
|
|||
class LIBPARTITIONMANAGERPRIVATE_EXPORT PartitionManagerWidget : public QWidget, Ui::PartitionManagerWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PartitionManagerWidget)
|
||||
|
||||
public:
|
||||
explicit PartitionManagerWidget(QWidget* parent, KActionCollection* coll = NULL);
|
||||
|
|
|
@ -45,6 +45,7 @@ class QString;
|
|||
class PartPropsDialog : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PartPropsDialog)
|
||||
|
||||
public:
|
||||
PartPropsDialog(QWidget* parent, Device& d, Partition& p);
|
||||
|
@ -68,7 +69,7 @@ class PartPropsDialog : public KDialog
|
|||
|
||||
Device& device() { return m_Device; }
|
||||
const Device& device() const { return m_Device; }
|
||||
|
||||
|
||||
Partition& partition() { return m_Partition; }
|
||||
const Partition& partition() const { return m_Partition; }
|
||||
|
||||
|
|
|
@ -38,38 +38,39 @@ class QMouseEvent;
|
|||
class PartResizerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PartResizerWidget)
|
||||
|
||||
public:
|
||||
PartResizerWidget(QWidget* parent);
|
||||
|
||||
public:
|
||||
void init(Device& d, Partition& p, qint64 sbefore, qint64 safter);
|
||||
|
||||
|
||||
qint64 sectorsBefore() const { return m_SectorsBefore; } /**< @return sectors free before Partition */
|
||||
qint64 sectorsAfter() const { return m_SectorsAfter; } /**< @return sectors free after Partition */
|
||||
qint64 totalSectors() const { return m_TotalSectors; } /**< @return total sectors (free + Partition's length) */
|
||||
|
||||
|
||||
void setMinimumSectors(qint64 s);
|
||||
qint64 minimumSectors() const { return m_MinimumSectors; } /**< @return minimum length for Partition */
|
||||
|
||||
void setMaximumSectors(qint64 s);
|
||||
qint64 maximumSectors() const { return m_MaximumSectors; } /**< @return maximum length for the Partition */
|
||||
|
||||
|
||||
void setMoveAllowed(bool b);
|
||||
bool moveAllowed() const { return m_MoveAllowed; } /**< @return true if moving the Partition is allowed */
|
||||
|
||||
|
||||
qint64 maxFirstSector() const { return m_MaxFirstSector; } /**< @return the highest allowed first sector */
|
||||
void setMaxFirstSector(qint64 s) { m_MaxFirstSector = s; } /**< @param s the new highest allowed first sector */
|
||||
|
||||
|
||||
qint64 minLastSector() const { return m_MinLastSector; } /**< @return the lowest allowed last sector */
|
||||
void setMinLastSector(qint64 s) { m_MinLastSector = s; } /**< @param s the new lowest allowed last sector */
|
||||
|
||||
|
||||
bool readOnly() const { return m_ReadOnly; } /**< @return true if the widget is read only */
|
||||
void setReadOnly(bool b) { m_ReadOnly = b; } /**< @param b the new value for read only */
|
||||
|
||||
static qint32 handleWidth() { return m_HandleWidth; } /**< @return the handle width in pixels */
|
||||
static qint32 handleHeight() { return m_HandleHeight; } /**< @return the handle height in pixels */
|
||||
|
||||
|
||||
signals:
|
||||
void sectorsBeforeChanged(qint64);
|
||||
void sectorsAfterChanged(qint64);
|
||||
|
@ -89,35 +90,35 @@ class PartResizerWidget : public QWidget
|
|||
Device& device() { Q_ASSERT(m_Device); return *m_Device; }
|
||||
const Device& device() const { Q_ASSERT(m_Device); return *m_Device; }
|
||||
void setDevice(Device& d) { m_Device = &d; }
|
||||
|
||||
|
||||
void setSectorsBefore(qint64 s) { m_SectorsBefore = s; }
|
||||
void setSectorsAfter(qint64 s) { m_SectorsAfter = s; }
|
||||
|
||||
|
||||
void paintEvent(QPaintEvent* event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseMoveEvent(QMouseEvent* event);
|
||||
void mouseReleaseEvent(QMouseEvent* event);
|
||||
|
||||
|
||||
PartWidget& partWidget() { Q_ASSERT(m_PartWidget); return *m_PartWidget; }
|
||||
const PartWidget& partWidget() const { Q_ASSERT(m_PartWidget); return *m_PartWidget; }
|
||||
|
||||
|
||||
void updatePositions();
|
||||
|
||||
|
||||
int partWidgetStart() const;
|
||||
int partWidgetWidth() const;
|
||||
|
||||
|
||||
QLabel& leftHandle() { return m_LeftHandle; }
|
||||
QLabel& rightHandle() { return m_RightHandle; }
|
||||
|
||||
|
||||
qint64 sectorsPerPixel() const;
|
||||
|
||||
|
||||
void set(qint64 newCap, qint64 newFreeBefore, qint64 newFreeAfter);
|
||||
|
||||
|
||||
void setTotalSectors(qint64 s) { m_TotalSectors = s; }
|
||||
|
||||
|
||||
void resizeLogicals();
|
||||
|
||||
|
||||
bool checkSnap(const Partition& child, qint64 delta) const;
|
||||
|
||||
QWidget* draggedWidget() { return m_DraggedWidget; }
|
||||
|
@ -127,7 +128,7 @@ class PartResizerWidget : public QWidget
|
|||
Device* m_Device;
|
||||
Partition* m_Partition;
|
||||
PartWidget* m_PartWidget;
|
||||
|
||||
|
||||
qint64 m_SectorsBefore;
|
||||
qint64 m_SectorsAfter;
|
||||
qint64 m_TotalSectors;
|
||||
|
@ -138,13 +139,13 @@ class PartResizerWidget : public QWidget
|
|||
|
||||
QLabel m_LeftHandle;
|
||||
QLabel m_RightHandle;
|
||||
|
||||
|
||||
QWidget* m_DraggedWidget;
|
||||
int m_Hotspot;
|
||||
|
||||
|
||||
bool m_MoveAllowed;
|
||||
bool m_ReadOnly;
|
||||
|
||||
|
||||
static const qint32 m_HandleWidth;
|
||||
static const qint32 m_HandleHeight;
|
||||
};
|
||||
|
|
|
@ -39,16 +39,17 @@ class QMouseEvent;
|
|||
class PartTableWidget : public QWidget, public PartWidgetBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(PartTableWidget)
|
||||
|
||||
public:
|
||||
PartTableWidget(QWidget* parent);
|
||||
|
||||
public:
|
||||
void setPartitionTable(const PartitionTable* ptable);
|
||||
|
||||
|
||||
PartWidget* activeWidget() { return m_ActiveWidget; } /**< @return the active widget or NULL if none */
|
||||
const PartWidget* activeWidget() const { return m_ActiveWidget; } /**< @return the active widget or NULL if none */
|
||||
|
||||
const PartWidget* activeWidget() const { return m_ActiveWidget; } /**< @return the active widget or NULL if none */
|
||||
|
||||
void setActiveWidget(PartWidget* partWidget);
|
||||
void setActivePartition(const Partition* p);
|
||||
void clear();
|
||||
|
@ -61,17 +62,17 @@ class PartTableWidget : public QWidget, public PartWidgetBase
|
|||
void resizeEvent(QResizeEvent* event);
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||
|
||||
|
||||
void drawPartitions() const;
|
||||
|
||||
|
||||
QList<PartWidget*>& widgets() { return m_Widgets; }
|
||||
const QList<PartWidget*>& widgets() const { return m_Widgets; }
|
||||
|
||||
const PartitionTable* partitionTable() const { return m_PartitionTable; }
|
||||
|
||||
|
||||
QLabel& labelEmpty() { return m_LabelEmpty; }
|
||||
const QLabel& labelEmpty() const { return m_LabelEmpty; }
|
||||
|
||||
|
||||
private:
|
||||
const PartitionTable* m_PartitionTable;
|
||||
QList<PartWidget*> m_Widgets;
|
||||
|
|
|
@ -44,6 +44,7 @@ PartWidget::PartWidget(QWidget* parent, const PartTableWidget* ptWidget, const P
|
|||
PartWidgetBase(),
|
||||
m_PartTableWidget(const_cast<PartTableWidget*>(ptWidget)),
|
||||
m_Partition(const_cast<Partition*>(p)),
|
||||
m_Widgets(),
|
||||
m_ShowChildren(show_children)
|
||||
{
|
||||
setFont(KGlobalSettings::smallestReadableFont());
|
||||
|
|
|
@ -34,8 +34,11 @@ class QWidget;
|
|||
*/
|
||||
class PartWidgetBase
|
||||
{
|
||||
Q_DISABLE_COPY(PartWidgetBase)
|
||||
|
||||
protected:
|
||||
PartWidgetBase() {}
|
||||
virtual ~PartWidgetBase() {}
|
||||
|
||||
public:
|
||||
static qint32 borderWidth() { return m_BorderWidth; } /**< @return border width */
|
||||
|
|
|
@ -68,7 +68,8 @@ ProgressDialog::ProgressDialog(QWidget* parent, OperationRunner& orunner) :
|
|||
m_Timer(this),
|
||||
m_Time(),
|
||||
m_CurrentOpItem(NULL),
|
||||
m_CurrentJobItem(NULL)
|
||||
m_CurrentJobItem(NULL),
|
||||
m_LastReportUpdate(0)
|
||||
{
|
||||
setMainWidget(&dialogWidget());
|
||||
setDetailsWidget(&detailsWidget());
|
||||
|
|
|
@ -48,6 +48,7 @@ class QKeyEvent;
|
|||
class ProgressDialog : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(ProgressDialog)
|
||||
|
||||
public:
|
||||
ProgressDialog(QWidget* parent, OperationRunner& orunner);
|
||||
|
@ -78,23 +79,23 @@ class ProgressDialog : public KDialog
|
|||
void keyPressEvent(QKeyEvent* e);
|
||||
|
||||
void setupConnections();
|
||||
|
||||
|
||||
const OperationRunner& operationRunner() const { return m_OperationRunner; }
|
||||
|
||||
ProgressDialogWidget& dialogWidget() { Q_ASSERT(m_ProgressDialogWidget); return *m_ProgressDialogWidget; }
|
||||
const ProgressDialogWidget& dialogWidget() const { Q_ASSERT(m_ProgressDialogWidget); return *m_ProgressDialogWidget; }
|
||||
|
||||
|
||||
ProgressDetailsWidget& detailsWidget() { Q_ASSERT(m_ProgressDetailsWidget); return *m_ProgressDetailsWidget; }
|
||||
const ProgressDetailsWidget& detailsWidget() const { Q_ASSERT(m_ProgressDetailsWidget); return *m_ProgressDetailsWidget; }
|
||||
|
||||
void setStatus(const QString& s);
|
||||
|
||||
|
||||
void setParentTitle(const QString& s);
|
||||
|
||||
void addTaskOutput(int num, const Operation& op);
|
||||
|
||||
|
||||
QString opDesc(int num, const Operation& op) const;
|
||||
|
||||
|
||||
void resetReport();
|
||||
|
||||
void allOpsDone(const QString& msg);
|
||||
|
@ -103,12 +104,12 @@ class ProgressDialog : public KDialog
|
|||
|
||||
QTimer& timer() { return m_Timer; }
|
||||
const QTimer& timer() const { return m_Timer; }
|
||||
|
||||
|
||||
const QString& savedParentTitle() const { return m_SavedParentTitle; }
|
||||
|
||||
|
||||
void setCurrentOpItem(QTreeWidgetItem* item) { m_CurrentOpItem = item; }
|
||||
QTreeWidgetItem* currentOpItem() { return m_CurrentOpItem; }
|
||||
|
||||
|
||||
void setCurrentJobItem(QTreeWidgetItem* item) { m_CurrentJobItem = item; }
|
||||
QTreeWidgetItem* currentJobItem() { return m_CurrentJobItem; }
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ class SizeDialogWidget;
|
|||
class SizeDialogBase : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(SizeDialogBase)
|
||||
|
||||
protected:
|
||||
SizeDialogBase(QWidget* parent, Capacity::Unit preferred, Device& device, Partition& part, qint64 freebefore, qint64 freeafter);
|
||||
|
|
|
@ -41,6 +41,7 @@ class QTreeWidget;
|
|||
class LIBPARTITIONMANAGERPRIVATE_EXPORT TreeLog: public QWidget, public Ui::TreeLogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(TreeLog)
|
||||
|
||||
public:
|
||||
TreeLog(QWidget* parent);
|
||||
|
|
Loading…
Reference in New Issue