Remove all remaining functions depending on Solid.
This commit is contained in:
parent
30d8f841ed
commit
204d2f9799
|
@ -85,11 +85,6 @@ find_package(PkgConfig REQUIRED)
|
|||
pkg_check_modules(BLKID REQUIRED blkid)
|
||||
pkg_check_modules(LIBATASMART REQUIRED libatasmart)
|
||||
|
||||
option(ENABLE_UDISKS2 "Use UDisks2 backend." OFF)
|
||||
if (ENABLE_UDISKS2)
|
||||
add_definitions(-DENABLE_UDISKS2)
|
||||
endif (ENABLE_UDISKS2)
|
||||
|
||||
include_directories(${Qt5Core_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE_DIRS} lib/ src/)
|
||||
|
||||
add_subdirectory(lib)
|
||||
|
|
|
@ -46,7 +46,6 @@ target_link_libraries( partitionmanagerprivate libfatlabel
|
|||
KF5::KIOCore
|
||||
KF5::KIOWidgets
|
||||
KF5::Service
|
||||
KF5::Solid
|
||||
KF5::XmlGui
|
||||
KF5::WidgetsAddons
|
||||
)
|
||||
|
|
|
@ -58,9 +58,6 @@ int Q_DECL_IMPORT main(int argc, char* argv[])
|
|||
if (!loadBackend())
|
||||
return 0;
|
||||
|
||||
if (!checkAccessibleDevices())
|
||||
return 0;
|
||||
|
||||
MainWindow* mainWindow = new MainWindow();
|
||||
mainWindow->show();
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#include <KMessageBox>
|
||||
#include <KLocalizedString>
|
||||
|
||||
#include <Solid/Device>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QCollator>
|
||||
|
@ -212,57 +210,3 @@ bool loadBackend()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool checkAccessibleDevices()
|
||||
{
|
||||
if (getSolidDeviceList().empty())
|
||||
{
|
||||
KMessageBox::error(NULL,
|
||||
xi18nc("@info", "<para>No usable devices could be found.</para><para>Make sure you have sufficient "
|
||||
"privileges to access block devices on your system.</para>"),
|
||||
i18nc("@title:window", "Error: No Usable Devices Found"));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QList<Solid::Device> getSolidDeviceList()
|
||||
{
|
||||
#ifdef ENABLE_UDISKS2
|
||||
QString predicate = QStringLiteral("StorageVolume.usage == 'PartitionTable'");
|
||||
|
||||
#else
|
||||
QString predicate = QStringLiteral("[ [ [ StorageDrive.driveType == 'HardDisk' OR StorageDrive.driveType == 'CompactFlash'] OR "
|
||||
"[ StorageDrive.driveType == 'MemoryStick' OR StorageDrive.driveType == 'SmartMedia'] ] OR "
|
||||
"[ StorageDrive.driveType == 'SdMmc' OR StorageDrive.driveType == 'Xd'] ]");
|
||||
#endif
|
||||
|
||||
QStringList argList;
|
||||
int argc = argList.size();
|
||||
if (argc > 0)
|
||||
{
|
||||
predicate = QStringLiteral(" [ ") + predicate + QStringLiteral(" AND ");
|
||||
|
||||
qint32 brackets = (argc + 1) / 2;
|
||||
brackets = argc == 1 ? 0 : brackets;
|
||||
for (qint32 i = 0; i < brackets; i++)
|
||||
predicate += QStringLiteral("[ ");
|
||||
|
||||
bool right_bracket = false;
|
||||
for (qint32 i = 0; i < argc; i++, right_bracket =! right_bracket)
|
||||
{
|
||||
predicate += QStringLiteral("Block.device == '%1' ").arg(argList[i]);
|
||||
|
||||
if (right_bracket)
|
||||
predicate += i == 1 ? QStringLiteral("] ") : QStringLiteral("] ] ");
|
||||
if (i < argc - 1)
|
||||
predicate += QStringLiteral("OR ");
|
||||
if (right_bracket && i != argc - 2 && i != argc - 1)
|
||||
predicate += QStringLiteral("[ ");
|
||||
}
|
||||
predicate += right_bracket && brackets > 0 ? QStringLiteral("] ]") : QStringLiteral("]");
|
||||
}
|
||||
|
||||
return Solid::Device::listFromQuery(predicate);
|
||||
}
|
||||
|
|
|
@ -31,10 +31,6 @@ class QIcon;
|
|||
class QPoint;
|
||||
class QTreeWidget;
|
||||
|
||||
namespace Solid
|
||||
{
|
||||
class Device;
|
||||
}
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT void registerMetaTypes();
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkPermissions();
|
||||
|
@ -50,8 +46,6 @@ LIBPARTITIONMANAGERPRIVATE_EXPORT void showColumnsContextMenu(const QPoint& p, Q
|
|||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool loadBackend();
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT QList<Solid::Device> getSolidDeviceList();
|
||||
|
||||
LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkAccessibleDevices();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue