diff --git a/CMakeLists.txt b/CMakeLists.txt index 016d3d9..1dc84b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,8 @@ set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "Install mkspecs files, Plugins a set(QT_MIN_VERSION "5.4.1") set(VERSION_MAJOR "1") -set(VERSION_MINOR "9") -set(VERSION_RELEASE "50") +set(VERSION_MINOR "2") +set(VERSION_RELEASE "1") set(VERSION_SUFFIX "") set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}${VERSION_SUFFIX}) add_definitions(-D'VERSION="${VERSION}"') #" diff --git a/src/gui/editmountpointdialog.cpp b/src/gui/editmountpointdialog.cpp index 25d0568..3de9229 100644 --- a/src/gui/editmountpointdialog.cpp +++ b/src/gui/editmountpointdialog.cpp @@ -1,6 +1,5 @@ /************************************************************************* * Copyright (C) 2009, 2010 by Volker Lanz * - * Copyright (C) 2015 by Teo Mrnjavac * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -28,8 +27,6 @@ #include #include -#include - EditMountPointDialog::EditMountPointDialog(QWidget* parent, Partition& p) : QDialog(parent), m_Partition(p), @@ -42,15 +39,6 @@ EditMountPointDialog::EditMountPointDialog(QWidget* parent, Partition& p) : KConfigGroup kcg(KSharedConfig::openConfig(), "editMountPointDialog"); restoreGeometry(kcg.readEntry("Geometry", QByteArray())); - - QDialogButtonBox* dbb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, - Qt::Horizontal, - this ); - mainLayout->addWidget(dbb); - connect(dbb, &QDialogButtonBox::accepted, - this, &EditMountPointDialog::accept); - connect(dbb, &QDialogButtonBox::rejected, - this, &EditMountPointDialog::reject); } /** Destroys an EditMOuntOptionsDialog instance */ diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 13cee4f..9902837 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1,6 +1,5 @@ /************************************************************************* * Copyright (C) 2008, 2009, 2010, 2012 by Volker Lanz * - * Copyright (C) 2015 by Teo Mrnjavac * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -47,7 +46,6 @@ #include #include -#include #include #include "util/guihelpers.h" @@ -156,14 +154,14 @@ void MainWindow::closeEvent(QCloseEvent* event) void MainWindow::changeEvent(QEvent* event) { if ((event->type() == QEvent::ActivationChange || event->type() == QEvent::WindowStateChange) && event->spontaneous() && isActiveWindow()) { - QWidget* w = nullptr; + QWidget* w = NULL; if (applyProgressDialog().isVisible()) w = &applyProgressDialog(); else if (scanProgressDialog().isVisible()) w = &scanProgressDialog(); - if (w != nullptr) { + if (w != NULL) { w->activateWindow(); w->raise(); w->setFocus(); @@ -305,12 +303,6 @@ void MainWindow::setupActions() mountPartition->setToolTip(i18nc("@info:tooltip", "Mount or unmount partition")); mountPartition->setStatusTip(i18nc("@info:status", "Mount or unmount a partition.")); - QAction* decryptPartition = actionCollection()->addAction(QStringLiteral("decryptPartition"), &pmWidget(), SLOT(onDecryptPartition())); - decryptPartition->setEnabled(false); - decryptPartition->setText(i18nc("@action:inmenu", "Unlock")); - decryptPartition->setToolTip(i18nc("@info:tooltip", "Unlock or lock encrypted partition")); - decryptPartition->setStatusTip(i18nc("@info:status", "Unlock or lock encrypted partition.")); - QAction* checkPartition = actionCollection()->addAction(QStringLiteral("checkPartition"), &pmWidget(), SLOT(onCheckPartition())); checkPartition->setEnabled(false); checkPartition->setText(i18nc("@action:inmenu", "Check")); @@ -395,87 +387,41 @@ void MainWindow::saveConfig() const void MainWindow::enableActions() { - actionCollection()->action(QStringLiteral("createNewPartitionTable")) - ->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice())); - actionCollection()->action(QStringLiteral("exportPartitionTable")) - ->setEnabled(pmWidget().selectedDevice() && - pmWidget().selectedDevice()->partitionTable() && - operationStack().size() == 0); - actionCollection()->action(QStringLiteral("importPartitionTable")) - ->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice())); - actionCollection()->action(QStringLiteral("smartStatusDevice")) - ->setEnabled(pmWidget().selectedDevice() != nullptr && - pmWidget().selectedDevice()->smartStatus().isValid()); - actionCollection()->action(QStringLiteral("propertiesDevice")) - ->setEnabled(pmWidget().selectedDevice() != nullptr); + actionCollection()->action(QStringLiteral("createNewPartitionTable"))->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice())); + actionCollection()->action(QStringLiteral("exportPartitionTable"))->setEnabled(pmWidget().selectedDevice() && pmWidget().selectedDevice()->partitionTable() && operationStack().size() == 0); + actionCollection()->action(QStringLiteral("importPartitionTable"))->setEnabled(CreatePartitionTableOperation::canCreate(pmWidget().selectedDevice())); + actionCollection()->action(QStringLiteral("smartStatusDevice"))->setEnabled(pmWidget().selectedDevice() != NULL && pmWidget().selectedDevice()->smartStatus().isValid()); + actionCollection()->action(QStringLiteral("propertiesDevice"))->setEnabled(pmWidget().selectedDevice() != NULL); - actionCollection()->action(QStringLiteral("undoOperation")) - ->setEnabled(operationStack().size() > 0); - actionCollection()->action(QStringLiteral("clearAllOperations")) - ->setEnabled(operationStack().size() > 0); - actionCollection()->action(QStringLiteral("applyAllOperations")) - ->setEnabled(operationStack().size() > 0 && (geteuid() == 0 || - Config::allowApplyOperationsAsNonRoot())); + actionCollection()->action(QStringLiteral("undoOperation"))->setEnabled(operationStack().size() > 0); + actionCollection()->action(QStringLiteral("clearAllOperations"))->setEnabled(operationStack().size() > 0); + actionCollection()->action(QStringLiteral("applyAllOperations"))->setEnabled(operationStack().size() > 0 && (geteuid() == 0 || Config::allowApplyOperationsAsNonRoot())); - const bool readOnly = pmWidget().selectedDevice() == nullptr || - pmWidget().selectedDevice()->partitionTable() == nullptr || + const bool readOnly = pmWidget().selectedDevice() == NULL || + pmWidget().selectedDevice()->partitionTable() == NULL || pmWidget().selectedDevice()->partitionTable()->isReadOnly(); const Partition* part = pmWidget().selectedPartition(); - actionCollection()->action(QStringLiteral("newPartition")) - ->setEnabled(!readOnly && NewOperation::canCreateNew(part)); + actionCollection()->action(QStringLiteral("newPartition"))->setEnabled(!readOnly && NewOperation::canCreateNew(part)); + const bool canResize = ResizeOperation::canGrow(part) || ResizeOperation::canShrink(part) || ResizeOperation::canMove(part); + actionCollection()->action(QStringLiteral("resizePartition"))->setEnabled(!readOnly && canResize); + actionCollection()->action(QStringLiteral("copyPartition"))->setEnabled(CopyOperation::canCopy(part)); + actionCollection()->action(QStringLiteral("deletePartition"))->setEnabled(!readOnly && DeleteOperation::canDelete(part)); + actionCollection()->action(QStringLiteral("shredPartition"))->setEnabled(!readOnly && DeleteOperation::canDelete(part)); + actionCollection()->action(QStringLiteral("pastePartition"))->setEnabled(!readOnly && CopyOperation::canPaste(part, pmWidget().clipboardPartition())); + actionCollection()->action(QStringLiteral("propertiesPartition"))->setEnabled(part != NULL); - const bool canResize = ResizeOperation::canGrow(part) || - ResizeOperation::canShrink(part) || - ResizeOperation::canMove(part); - actionCollection()->action(QStringLiteral("resizePartition")) - ->setEnabled(!readOnly && canResize); + actionCollection()->action(QStringLiteral("editMountPoint"))->setEnabled(part && !part->isMounted()); + actionCollection()->action(QStringLiteral("mountPartition"))->setEnabled(part && (part->canMount() || part->canUnmount())); - actionCollection()->action(QStringLiteral("copyPartition")) - ->setEnabled(CopyOperation::canCopy(part)); - actionCollection()->action(QStringLiteral("deletePartition")) - ->setEnabled(!readOnly && DeleteOperation::canDelete(part)); - actionCollection()->action(QStringLiteral("shredPartition")) - ->setEnabled(!readOnly && DeleteOperation::canDelete(part)); - actionCollection()->action(QStringLiteral("pastePartition")) - ->setEnabled(!readOnly && CopyOperation::canPaste(part, pmWidget().clipboardPartition())); - actionCollection()->action(QStringLiteral("propertiesPartition")) - ->setEnabled(part != nullptr); + if (part != NULL) + actionCollection()->action(QStringLiteral("mountPartition"))->setText(part->isMounted() ? part->fileSystem().unmountTitle() : part->fileSystem().mountTitle()); - actionCollection()->action(QStringLiteral("editMountPoint")) - ->setEnabled(part && !part->isMounted()); + actionCollection()->action(QStringLiteral("checkPartition"))->setEnabled(!readOnly && CheckOperation::canCheck(part)); - actionCollection()->action(QStringLiteral("mountPartition")) - ->setEnabled(part && - (part->canMount() || part->canUnmount())); - if (part != nullptr) - actionCollection()->action(QStringLiteral("mountPartition")) - ->setText(part->isMounted() ? - part->fileSystem().unmountTitle() : - part->fileSystem().mountTitle()); - - actionCollection()->action(QStringLiteral("decryptPartition")) - ->setEnabled(part && - (part->fileSystem().type() == FileSystem::Luks) && - (dynamic_cast(part->fileSystem()).canCryptOpen(part->partitionPath()) || - dynamic_cast(part->fileSystem()).canCryptClose(part->partitionPath()))); - if (part && part->fileSystem().type() == FileSystem::Luks) - { - const FS::luks& luksFs = dynamic_cast(part->fileSystem()); - actionCollection()->action(QStringLiteral("decryptPartition")) - ->setText(luksFs.isCryptOpen() ? - luksFs.cryptCloseTitle() : - luksFs.cryptOpenTitle()); - } - - actionCollection()->action(QStringLiteral("checkPartition")) - ->setEnabled(!readOnly && CheckOperation::canCheck(part)); - - actionCollection()->action(QStringLiteral("backupPartition")) - ->setEnabled(BackupOperation::canBackup(part)); - actionCollection()->action(QStringLiteral("restorePartition")) - ->setEnabled(RestoreOperation::canRestore(part)); + actionCollection()->action(QStringLiteral("backupPartition"))->setEnabled(BackupOperation::canBackup(part)); + actionCollection()->action(QStringLiteral("restorePartition"))->setEnabled(RestoreOperation::canRestore(part)); } void MainWindow::on_m_ApplyProgressDialog_finished() @@ -550,10 +496,10 @@ void MainWindow::on_m_ListDevices_contextMenuRequested(const QPoint& pos) void MainWindow::on_m_PartitionManagerWidget_contextMenuRequested(const QPoint& pos) { - QMenu* menu = nullptr; + QMenu* menu = NULL; - if (pmWidget().selectedPartition() == nullptr) { - if (pmWidget().selectedDevice() != nullptr) + if (pmWidget().selectedPartition() == NULL) { + if (pmWidget().selectedDevice() != NULL) menu = static_cast(guiFactory()->container(QStringLiteral("device"), this)); } else menu = static_cast(guiFactory()->container(QStringLiteral("partition"), this)); @@ -657,7 +603,7 @@ void MainWindow::onSelectedDeviceMenuTriggered(bool) QAction* action = qobject_cast(sender()); QMenu* devicesMenu = static_cast(guiFactory()->container(QStringLiteral("selectedDevice"), this)); - if (action == nullptr || action->parent() != devicesMenu) + if (action == NULL || action->parent() != devicesMenu) return; foreach(QAction * entry, devicesMenu->findChildren()) @@ -732,8 +678,8 @@ void MainWindow::onUndoOperation() // it's possible the undo killed the partition in the clipboard. if there's a partition in the clipboard, try // to find a device for it (OperationStack::findDeviceForPartition() only compares pointers, so an invalid // pointer is not a problem). if no device is found, the pointer must be dangling, so clear the clipboard. - if (pmWidget().clipboardPartition() != nullptr && operationStack().findDeviceForPartition(pmWidget().clipboardPartition()) == nullptr) - pmWidget().setClipboardPartition(nullptr); + if (pmWidget().clipboardPartition() != NULL && operationStack().findDeviceForPartition(pmWidget().clipboardPartition()) == NULL) + pmWidget().setClipboardPartition(NULL); pmWidget().updatePartitions(); enableActions(); @@ -758,7 +704,7 @@ void MainWindow::onCreateNewPartitionTable() { Q_ASSERT(pmWidget().selectedDevice()); - if (pmWidget().selectedDevice() == nullptr) { + if (pmWidget().selectedDevice() == NULL) { qWarning() << "selected device is null."; return; } @@ -805,7 +751,7 @@ void MainWindow::onImportPartitionTable() QRegExp rxMagic(QStringLiteral("^##|v(\\d+)|##")); quint32 lineNo = 0; bool haveMagic = false; - PartitionTable* ptable = nullptr; + PartitionTable* ptable = NULL; PartitionTable::TableType tableType = PartitionTable::unknownTableType; while (!(line = file.readLine()).isEmpty()) { @@ -825,7 +771,7 @@ void MainWindow::onImportPartitionTable() continue; if (rxType.indexIn(QString::fromUtf8(line.constData())) != -1) { - if (ptable != nullptr) { + if (ptable != NULL) { KMessageBox::error(this, i18nc("@info", "Found more than one partition table type in import file (line %1).", lineNo), i18nc("@title:window", "Error While Importing Partition Table")); return; } @@ -847,7 +793,7 @@ void MainWindow::onImportPartitionTable() } else if (rxAlign.indexIn(QString::fromUtf8(line.constData())) != -1) { // currently ignored } else if (rxPartition.indexIn(QString::fromUtf8(line.constData())) != -1) { - if (ptable == nullptr) { + if (ptable == NULL) { KMessageBox::error(this, i18nc("@info", "Found partition but no partition table type (line %1).", lineNo), i18nc("@title:window", "Error While Importing Partition Table")); return; } @@ -889,7 +835,7 @@ void MainWindow::onImportPartitionTable() return; } - if (parent == nullptr) { + if (parent == NULL) { KMessageBox::error(this, i18nc("@info the partition is NOT a device path, just a number", "No parent partition or partition table found for partition %1 (line %2).", num, lineNo), i18nc("@title:window", "Error While Importing Partition Table")); return; } @@ -901,7 +847,7 @@ void MainWindow::onImportPartitionTable() FileSystem* fs = FileSystemFactory::create(FileSystem::typeForName(fsName), firstSector, lastSector); - if (fs == nullptr) { + if (fs == NULL) { KMessageBox::error(this, i18nc("@info the partition is NOT a device path, just a number", "Could not create file system \"%1\" for partition %2 (line %3).", fsName, num, lineNo), i18nc("@title:window", "Error While Importing Partition Table")); return; } @@ -1031,7 +977,7 @@ void MainWindow::onPropertiesDevice(const QString&) static QStringList checkSupportInNode(const PartitionNode* parent) { - if (parent == nullptr) + if (parent == NULL) return QStringList(); QStringList rval; @@ -1039,7 +985,7 @@ static QStringList checkSupportInNode(const PartitionNode* parent) foreach(const PartitionNode * node, parent->children()) { const Partition* p = dynamic_cast(node); - if (p == nullptr) + if (p == NULL) continue; if (node->children().size() > 0) diff --git a/src/gui/partitionmanagerui.rc b/src/gui/partitionmanagerui.rc index e6ee636..8cfbc1f 100644 --- a/src/gui/partitionmanagerui.rc +++ b/src/gui/partitionmanagerui.rc @@ -62,7 +62,6 @@ - diff --git a/src/gui/partitionmanagerwidget.cpp b/src/gui/partitionmanagerwidget.cpp index efe2727..4368ffd 100644 --- a/src/gui/partitionmanagerwidget.cpp +++ b/src/gui/partitionmanagerwidget.cpp @@ -1,6 +1,5 @@ /************************************************************************* * Copyright (C) 2008-2010 by Volker Lanz * - * Copyright (C) 2015 by Teo Mrnjavac * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -30,7 +29,6 @@ #include #include -#include #include @@ -83,9 +81,9 @@ private: PartitionManagerWidget::PartitionManagerWidget(QWidget* parent) : QWidget(parent), Ui::PartitionManagerWidgetBase(), - m_OperationStack(nullptr), - m_SelectedDevice(nullptr), - m_ClipboardPartition(nullptr) + m_OperationStack(NULL), + m_SelectedDevice(NULL), + m_ClipboardPartition(NULL) { setupUi(this); @@ -154,17 +152,17 @@ void PartitionManagerWidget::setupConnections() void PartitionManagerWidget::clear() { - setSelectedDevice(nullptr); - setClipboardPartition(nullptr); + setSelectedDevice(NULL); + setClipboardPartition(NULL); treePartitions().clear(); partTableWidget().clear(); } void PartitionManagerWidget::setSelectedPartition(const Partition* p) { - if (p == nullptr) { - treePartitions().setCurrentItem(nullptr); - emit selectedPartitionChanged(nullptr); + if (p == NULL) { + treePartitions().setCurrentItem(NULL); + emit selectedPartitionChanged(NULL); updatePartitions(); } else partTableWidget().setActivePartition(p); @@ -172,8 +170,8 @@ void PartitionManagerWidget::setSelectedPartition(const Partition* p) Partition* PartitionManagerWidget::selectedPartition() { - if (selectedDevice() == nullptr || selectedDevice()->partitionTable() == nullptr || partTableWidget().activeWidget() == nullptr) - return nullptr; + if (selectedDevice() == NULL || selectedDevice()->partitionTable() == NULL || partTableWidget().activeWidget() == NULL) + return NULL; // The active partition we get from the part table widget is const; we need non-const. // So take the first sector and find the partition in the selected device's @@ -192,13 +190,13 @@ void PartitionManagerWidget::setSelectedDevice(const QString& device_node) return; } - setSelectedDevice(nullptr); + setSelectedDevice(NULL); } void PartitionManagerWidget::setSelectedDevice(Device* d) { m_SelectedDevice = d; - setSelectedPartition(nullptr); + setSelectedPartition(NULL); } static QTreeWidgetItem* createTreeWidgetItem(const Partition& p) @@ -236,7 +234,7 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p) void PartitionManagerWidget::updatePartitions() { - if (selectedDevice() == nullptr) + if (selectedDevice() == NULL) return; treePartitions().clear(); @@ -258,7 +256,7 @@ void PartitionManagerWidget::updatePartitions() treePartitions().addTopLevelItem(deviceItem); - if (selectedDevice()->partitionTable() != nullptr) { + if (selectedDevice()->partitionTable() != NULL) { foreach(const Partition * p, selectedDevice()->partitionTable()->children()) { QTreeWidgetItem* item = createTreeWidgetItem(*p); @@ -283,18 +281,18 @@ void PartitionManagerWidget::on_m_TreePartitions_currentItemChanged(QTreeWidgetI { if (current) { const PartitionTreeWidgetItem* ptwItem = dynamic_cast(current); - partTableWidget().setActivePartition(ptwItem ? ptwItem->partition() : nullptr); + partTableWidget().setActivePartition(ptwItem ? ptwItem->partition() : NULL); } else - partTableWidget().setActiveWidget(nullptr); + partTableWidget().setActiveWidget(NULL); } void PartitionManagerWidget::on_m_TreePartitions_itemDoubleClicked(QTreeWidgetItem* item, int) { if (item == treePartitions().topLevelItem(0)) { - if (selectedDevice() != nullptr) + if (selectedDevice() != NULL) emit deviceDoubleClicked(selectedDevice()); } else { - if (selectedPartition() != nullptr) + if (selectedPartition() != NULL) emit partitionDoubleClicked(selectedPartition()); } } @@ -306,9 +304,9 @@ void PartitionManagerWidget::onHeaderContextMenu(const QPoint& p) void PartitionManagerWidget::on_m_PartTableWidget_itemSelectionChanged(PartWidget* item) { - if (item == nullptr) { - treePartitions().setCurrentItem(nullptr); - emit selectedPartitionChanged(nullptr); + if (item == NULL) { + treePartitions().setCurrentItem(NULL); + emit selectedPartitionChanged(NULL); return; } @@ -378,12 +376,12 @@ void PartitionManagerWidget::onMountPartition() Q_ASSERT(p); - if (p == nullptr) { + if (p == NULL) { qWarning() << "no partition selected"; return; } - Report report(nullptr); + Report report(NULL); if (p->canMount()) { if (!p->mount(report)) @@ -398,7 +396,7 @@ void PartitionManagerWidget::onMountPartition() Q_ASSERT(parent); - if (parent != nullptr) + if (parent != NULL) parent->checkChildrenMounted(); else qWarning() << "parent is null"; @@ -407,40 +405,13 @@ void PartitionManagerWidget::onMountPartition() updatePartitions(); } -void PartitionManagerWidget::onDecryptPartition() -{ - Partition* p = selectedPartition(); - - Q_ASSERT(p); - - if (p == nullptr) { - qWarning() << "no partition selected"; - return; - } - - if (p->fileSystem().type() != FileSystem::Luks) - return; - - FS::luks& luksFs = dynamic_cast(p->fileSystem()); - - if (luksFs.canCryptOpen(p->partitionPath())) { - if (!luksFs.cryptOpen(p->partitionPath())) - KMessageBox::detailedSorry(this, xi18nc("@info", "The encrypted file system on partition %1 could not be unlocked.", p->deviceNode()), QString(), i18nc("@title:window", "Could Not Unlock Encrypted File System.")); - } else if (luksFs.canCryptClose(p->partitionPath())) { - if (!luksFs.cryptClose(p->partitionPath())) - KMessageBox::detailedSorry(this, xi18nc("@info", "The encrypted file system on partition %1 could not be locked.", p->deviceNode()), QString(), i18nc("@title:window", "Could Not Lock Encrypted File System.")); - } - - updatePartitions(); -} - void PartitionManagerWidget::onEditMountPoint() { Partition* p = selectedPartition(); Q_ASSERT(p); - if (p == nullptr) + if (p == NULL) return; QPointer dlg = new EditMountPointDialog(this, *p); @@ -473,14 +444,14 @@ void PartitionManagerWidget::onNewPartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } Q_ASSERT(selectedDevice()->partitionTable()); - if (selectedDevice()->partitionTable() == nullptr) { + if (selectedDevice()->partitionTable() == NULL) { qWarning() << "partition table on selected device is null"; return; } @@ -504,7 +475,7 @@ void PartitionManagerWidget::onDeletePartition(bool shred) Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } @@ -512,7 +483,7 @@ void PartitionManagerWidget::onDeletePartition(bool shred) if (selectedPartition()->roles().has(PartitionRole::Logical)) { Q_ASSERT(selectedPartition()->parent()); - if (selectedPartition()->parent() == nullptr) { + if (selectedPartition()->parent() == NULL) { qWarning() << "parent of selected partition is null."; return; } @@ -539,7 +510,7 @@ void PartitionManagerWidget::onDeletePartition(bool shred) KStandardGuiItem::cancel(), QStringLiteral("reallyDeleteClipboardPartition")) == KMessageBox::Cancel) return; - setClipboardPartition(nullptr); + setClipboardPartition(NULL); } if (shred && Config::shredSource() == Config::EnumShredSource::random) @@ -560,14 +531,14 @@ void PartitionManagerWidget::onResizePartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } Q_ASSERT(selectedDevice()->partitionTable()); - if (selectedDevice()->partitionTable() == nullptr) { + if (selectedDevice()->partitionTable() == NULL) { qWarning() << "partition table on selected device is null"; return; } @@ -605,7 +576,7 @@ void PartitionManagerWidget::onCopyPartition() { Q_ASSERT(selectedPartition()); - if (selectedPartition() == nullptr) { + if (selectedPartition() == NULL) { qWarning() << "selected partition: " << selectedPartition(); return; } @@ -619,12 +590,12 @@ void PartitionManagerWidget::onPastePartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } - if (clipboardPartition() == nullptr) { + if (clipboardPartition() == NULL) { qWarning() << "no partition in the clipboard."; return; } @@ -636,7 +607,7 @@ void PartitionManagerWidget::onPastePartition() Q_ASSERT(dSource); - if (dSource == nullptr) { + if (dSource == NULL) { qWarning() << "source partition is null."; return; } @@ -654,7 +625,7 @@ bool PartitionManagerWidget::showInsertDialog(Partition& insertedPartition, qint Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return false; } @@ -710,7 +681,7 @@ void PartitionManagerWidget::onCheckPartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } @@ -723,7 +694,7 @@ void PartitionManagerWidget::onBackupPartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } @@ -743,7 +714,7 @@ void PartitionManagerWidget::onRestorePartition() Q_ASSERT(selectedDevice()); Q_ASSERT(selectedPartition()); - if (selectedDevice() == nullptr || selectedPartition() == nullptr) { + if (selectedDevice() == NULL || selectedPartition() == NULL) { qWarning() << "selected device: " << selectedDevice() << ", selected partition: " << selectedPartition(); return; } diff --git a/src/gui/partitionmanagerwidget.h b/src/gui/partitionmanagerwidget.h index 1926ffb..3524a4d 100644 --- a/src/gui/partitionmanagerwidget.h +++ b/src/gui/partitionmanagerwidget.h @@ -1,6 +1,5 @@ /************************************************************************* * Copyright (C) 2008-2010 by Volker Lanz * - * Copyright (C) 2015 by Teo Mrnjavac * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -70,7 +69,6 @@ public Q_SLOTS: void onEditMountPoint(); void onMountPartition(); - void onDecryptPartition(); void onCheckPartition();