Move createFileSystemColor back to GUI.

This commit is contained in:
Andrius Štikonas 2015-06-12 13:11:29 +01:00
parent b651d8de89
commit 11b097141a
6 changed files with 24 additions and 1 deletions

View File

@ -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>

View File

@ -26,6 +26,7 @@
#include <kpmcore/util/capacity.h>
#include <kpmcore/util/helpers.h>
#include "util/guihelpers.h"
#include <QFontDatabase>
#include <QtAlgorithms>

View File

@ -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>

View File

@ -25,6 +25,7 @@
#include <kpmcore/util/capacity.h>
#include <kpmcore/util/helpers.h>
#include "util/guihelpers.h"
#include <QComboBox>
#include <QFontDatabase>

View File

@ -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)

View File

@ -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