diff --git a/src/util/helpers.cpp b/src/util/helpers.cpp index e0d3c10..0163f4e 100644 --- a/src/util/helpers.cpp +++ b/src/util/helpers.cpp @@ -25,12 +25,6 @@ #include #include -#include -#include -#include -#include -#include - void registerMetaTypes() { qRegisterMetaType("Operation*"); @@ -42,33 +36,6 @@ bool caseInsensitiveLessThan(const QString& s1, const QString& s2) return s1.toLower() < s2.toLower(); } -void showColumnsContextMenu(const QPoint& p, QTreeWidget& tree) -{ - QMenu headerMenu(xi18nc("@title:menu", "Columns")); - - QHeaderView* header = tree.header(); - - for (qint32 i = 0; i < tree.model()->columnCount(); i++) { - const int idx = header->logicalIndex(i); - const QString text = tree.model()->headerData(idx, Qt::Horizontal).toString(); - - QAction* action = headerMenu.addAction(text); - action->setCheckable(true); - action->setChecked(!header->isSectionHidden(idx)); - action->setData(idx); - action->setEnabled(idx > 0); - } - - QAction* action = headerMenu.exec(tree.header()->mapToGlobal(p)); - - if (action != nullptr) { - const bool hidden = !action->isChecked(); - tree.setColumnHidden(action->data().toInt(), hidden); - if (!hidden) - tree.resizeColumnToContents(action->data().toInt()); - } -} - bool isMounted(const QString& deviceNode) { ExternalCommand cmd(QStringLiteral("lsblk"), diff --git a/src/util/helpers.h b/src/util/helpers.h index 1b38633..c529a69 100644 --- a/src/util/helpers.h +++ b/src/util/helpers.h @@ -29,19 +29,11 @@ class KAboutData; class Partition; class QString; -class QPoint; -class QTreeWidget; LIBKPMCORE_EXPORT void registerMetaTypes(); - LIBKPMCORE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2); - -LIBKPMCORE_EXPORT void showColumnsContextMenu(const QPoint& p, QTreeWidget& tree); - LIBKPMCORE_EXPORT bool checkAccessibleDevices(); - LIBKPMCORE_EXPORT bool isMounted(const QString& deviceNode); - LIBKPMCORE_EXPORT KAboutData aboutKPMcore(); /** Pointer to the file system (which might be inside LUKS container) contained in the partition