Move createFileSystemColor back to GUI.
This commit is contained in:
parent
b651d8de89
commit
11b097141a
|
@ -18,10 +18,10 @@
|
|||
#include "config/generalpagewidget.h"
|
||||
|
||||
#include <kpmcore/backend/corebackendmanager.h>
|
||||
|
||||
#include <kpmcore/fs/filesystemfactory.h>
|
||||
|
||||
#include <kpmcore/util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <kpmcore/util/capacity.h>
|
||||
#include <kpmcore/util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <QFontDatabase>
|
||||
#include <QtAlgorithms>
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include <kpmcore/util/capacity.h>
|
||||
#include <kpmcore/util/report.h>
|
||||
#include <kpmcore/util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <QCursor>
|
||||
#include <QFileDialog>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <kpmcore/util/capacity.h>
|
||||
#include <kpmcore/util/helpers.h>
|
||||
#include "util/guihelpers.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFontDatabase>
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QIcon>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
#include <QProcess>
|
||||
#include <QStandardPaths>
|
||||
#include <QString>
|
||||
|
@ -33,6 +36,18 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
QIcon createFileSystemColor(FileSystem::Type type, quint32 size)
|
||||
{
|
||||
QPixmap pixmap(size, size);
|
||||
QPainter painter(&pixmap);
|
||||
painter.setPen(QColor(0, 0, 0));
|
||||
painter.setBrush(Config::fileSystemColorCode(type));
|
||||
painter.drawRect(QRect(0, 0, pixmap.width() - 1, pixmap.height() - 1));
|
||||
painter.end();
|
||||
|
||||
return QIcon(pixmap);
|
||||
}
|
||||
|
||||
bool checkPermissions()
|
||||
{
|
||||
if (geteuid() != 0)
|
||||
|
|
|
@ -21,10 +21,15 @@
|
|||
|
||||
#include "util/libpartitionmanagerguiexport.h"
|
||||
|
||||
#include <kpmcore/fs/filesystem.h>
|
||||
|
||||
class QString;
|
||||
class QIcon;
|
||||
|
||||
LIBKPMGUI_EXPORT bool checkPermissions();
|
||||
LIBKPMGUI_EXPORT bool loadBackend();
|
||||
LIBKPMGUI_EXPORT QIcon createFileSystemColor(FileSystem::Type type, quint32 size);
|
||||
|
||||
QString suCommand();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue