解决规范性问题

This commit is contained in:
lixueman 2022-09-13 08:37:16 +08:00
parent 8e026603c8
commit 3b4474ab63
45 changed files with 238 additions and 315 deletions

View File

@ -38,6 +38,10 @@ DesktopWatcher::DesktopWatcher()
connect(m_directoryChangedThread, &DirectoryChangedThread::requestUpdateSignal, this, &DesktopWatcher::requestUpdateSlot); connect(m_directoryChangedThread, &DirectoryChangedThread::requestUpdateSignal, this, &DesktopWatcher::requestUpdateSlot);
} }
DesktopWatcher::~DesktopWatcher()
{
}
/** /**
* desktop文件目录改变信号槽 * desktop文件目录改变信号槽
*/ */

View File

@ -27,6 +27,7 @@ class DesktopWatcher : public QObject
Q_OBJECT Q_OBJECT
public: public:
DesktopWatcher(); DesktopWatcher();
~DesktopWatcher();
public: public:
Q_SIGNALS: Q_SIGNALS:

View File

@ -28,7 +28,10 @@ DirectoryChangedThread::DirectoryChangedThread()
DirectoryChangedThread::~DirectoryChangedThread() DirectoryChangedThread::~DirectoryChangedThread()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void DirectoryChangedThread::run() void DirectoryChangedThread::run()

View File

@ -28,21 +28,20 @@ TabletDirectoryChangedThread::TabletDirectoryChangedThread()
{ {
m_ukuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini"; QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini";
setting = new QSettings(path, QSettings::IniFormat); m_setting = new QSettings(path, QSettings::IniFormat);
} }
TabletDirectoryChangedThread::~TabletDirectoryChangedThread() TabletDirectoryChangedThread::~TabletDirectoryChangedThread()
{ {
if (m_ukuiMenuInterface) { if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface; delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
} }
if (setting) { if (m_setting) {
delete setting; delete m_setting;
m_setting = nullptr;
} }
m_ukuiMenuInterface = nullptr;
setting = nullptr;
} }
@ -67,35 +66,35 @@ void TabletDirectoryChangedThread::run()
QStringList list = str.split('/'); QStringList list = str.split('/');
str = list[list.size() - 1]; str = list[list.size() - 1];
QString desktopfn = str; QString desktopfn = str;
setting->beginGroup("recentapp"); m_setting->beginGroup("recentapp");
setting->setValue(desktopfn, datetime); m_setting->setValue(desktopfn, datetime);
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
//wgx //wgx
setting->beginGroup("application"); m_setting->beginGroup("application");
QStringList applist = setting->allKeys(); QStringList applist = m_setting->allKeys();
int appnum = setting->allKeys().count(); int appnum = m_setting->allKeys().count();
int maxindex = 0; int maxindex = 0;
int minindex = 0; int minindex = 0;
for (int i = 0; i < appnum; i++) { for (int i = 0; i < appnum; i++) {
if (setting->value(applist.at(i)).toInt() > maxindex) { if (m_setting->value(applist.at(i)).toInt() > maxindex) {
maxindex = setting->value(applist.at(i)).toInt(); maxindex = m_setting->value(applist.at(i)).toInt();
} }
if(setting->value(applist.at(i)).toInt() <= minindex) { if(m_setting->value(applist.at(i)).toInt() <= minindex) {
minindex = setting->value(applist.at(i)).toInt(); minindex = m_setting->value(applist.at(i)).toInt();
} }
} }
if (desktopfn.contains("small-plugin-manage")){ if (desktopfn.contains("small-plugin-manage")){
setting->setValue(desktopfn,minindex-1); m_setting->setValue(desktopfn,minindex-1);
} else { } else {
setting->setValue(desktopfn,maxindex+1); m_setting->setValue(desktopfn,maxindex+1);
} }
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
// //
QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfpList.at(i)); QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfpList.at(i));
syslog(LOG_LOCAL0 | LOG_DEBUG, "%s", iconstr.toLocal8Bit().data()); syslog(LOG_LOCAL0 | LOG_DEBUG, "%s", iconstr.toLocal8Bit().data());
@ -113,35 +112,35 @@ void TabletDirectoryChangedThread::run()
QFileInfo fileInfo(desktopfp); QFileInfo fileInfo(desktopfp);
QString desktopfn = fileInfo.fileName(); QString desktopfn = fileInfo.fileName();
myDebug() << "卸载" << desktopfn; myDebug() << "卸载" << desktopfn;
setting->beginGroup("lockapplication"); m_setting->beginGroup("lockapplication");
setting->remove(desktopfn); m_setting->remove(desktopfn);
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
setting->beginGroup("application"); m_setting->beginGroup("application");
if (!setting->contains(desktopfn)) { if (!m_setting->contains(desktopfn)) {
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
continue; continue;
} }
int val = setting->value(desktopfn).toInt(); int val = m_setting->value(desktopfn).toInt();
myDebug() << "卸载val" << val; myDebug() << "卸载val" << val;
setting->remove(desktopfn); m_setting->remove(desktopfn);
QStringList desktopfnList = setting->allKeys(); QStringList desktopfnList = m_setting->allKeys();
for (int i = 0; i < desktopfnList.count(); i++) { for (int i = 0; i < desktopfnList.count(); i++) {
if (setting->value(desktopfnList.at(i)).toInt() > val) { if (m_setting->value(desktopfnList.at(i)).toInt() > val) {
setting->setValue(desktopfnList.at(i), setting->value(desktopfnList.at(i)).toInt() - 1); m_setting->setValue(desktopfnList.at(i), m_setting->value(desktopfnList.at(i)).toInt() - 1);
} }
} }
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
setting->beginGroup("recentapp"); m_setting->beginGroup("recentapp");
setting->remove(desktopfn); m_setting->remove(desktopfn);
setting->sync(); m_setting->sync();
setting->endGroup(); m_setting->endGroup();
syslog(LOG_LOCAL0 | LOG_DEBUG, "软件卸载desktop文件名%s", desktopfn.toLocal8Bit().data()); syslog(LOG_LOCAL0 | LOG_DEBUG, "软件卸载desktop文件名%s", desktopfn.toLocal8Bit().data());
QDBusInterface iface("com.ukui.panel.desktop", QDBusInterface iface("com.ukui.panel.desktop",
"/", "/",

View File

@ -35,7 +35,7 @@ public:
private: private:
UkuiMenuInterface *m_ukuiMenuInterface = nullptr; UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
QSettings *setting = nullptr; QSettings *m_setting = nullptr;
TabletListView *m_listView = nullptr; TabletListView *m_listView = nullptr;
QStandardItemModel *listmodel = nullptr; QStandardItemModel *listmodel = nullptr;

View File

@ -25,9 +25,9 @@
#include <QDateTime> #include <QDateTime>
#include <QObject> #include <QObject>
class CurrentTimeInterface : QObject class CurrentTimeInterface : public QObject
{ {
Q_OBJECT
public: public:
CurrentTimeInterface(); CurrentTimeInterface();
~CurrentTimeInterface(); ~CurrentTimeInterface();

View File

@ -27,7 +27,10 @@ SearchAppThread::SearchAppThread()
SearchAppThread::~SearchAppThread() SearchAppThread::~SearchAppThread()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void SearchAppThread::run() void SearchAppThread::run()

View File

@ -27,6 +27,14 @@ GetModelData::GetModelData()
loadDesktopVercor(); loadDesktopVercor();
} }
GetModelData::~GetModelData()
{
if (m_ukuiMenuInterface != nullptr) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
}
void GetModelData::loadDesktopVercor() void GetModelData::loadDesktopVercor()
{ {
UkuiMenuInterface::appInfoVector.clear(); UkuiMenuInterface::appInfoVector.clear();
@ -58,10 +66,10 @@ QStringList GetModelData::getPreCollectionApp()
QStringList preAppList = QStringList(); QStringList preAppList = QStringList();
QStringList preAppListExist = QStringList(); QStringList preAppListExist = QStringList();
preAppList << QString("/usr/share/applications/ukui-control-center.desktop") preAppList << QString("/usr/share/applications/ukui-control-center.desktop")
<<QString("/usr/share/applications/kylin-weather.desktop") << QString("/usr/share/applications/kylin-weather.desktop")
<<QString("/usr/share/applications/kylin-software-center.desktop") << QString("/usr/share/applications/kylin-software-center.desktop")
<<QString("/usr/share/applications/kylin-screenshot.desktop") << QString("/usr/share/applications/kylin-screenshot.desktop")
<<QString("/usr/share/applications/peony.desktop"); << QString("/usr/share/applications/peony.desktop");
Q_FOREACH(QString appDesktop,preAppList) { Q_FOREACH(QString appDesktop,preAppList) {
if (UkuiMenuInterface::allAppVector.contains(appDesktop)) { if (UkuiMenuInterface::allAppVector.contains(appDesktop)) {
preAppListExist.append(appDesktop); preAppListExist.append(appDesktop);

View File

@ -29,6 +29,7 @@ class GetModelData : public QObject
public: public:
GetModelData(); GetModelData();
~GetModelData();
public: public:
/** /**

View File

@ -27,6 +27,14 @@ PageManager::PageManager()
m_ukuiMenuInterface->initAppIni(); m_ukuiMenuInterface->initAppIni();
} }
PageManager::~PageManager()
{
if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
}
int PageManager::getPageNum(const int &appNum) int PageManager::getPageNum(const int &appNum)
{ {
int pageNum = 0; int pageNum = 0;

View File

@ -27,6 +27,7 @@ class PageManager : public QObject
Q_OBJECT Q_OBJECT
public: public:
PageManager(); PageManager();
~PageManager();
int getPageNum(const int &appNum); int getPageNum(const int &appNum);
QVector<QStringList> sortAppInPage(const QVector<QString> &appVector); QVector<QStringList> sortAppInPage(const QVector<QString> &appVector);

View File

@ -30,13 +30,25 @@ FullListView::FullListView(QWidget *parent, int module):
initWidget(); initWidget();
m_delegate = new FullItemDelegate(this, module); m_delegate = new FullItemDelegate(this, module);
this->setItemDelegate(m_delegate); this->setItemDelegate(m_delegate);
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
FullListView::~FullListView() FullListView::~FullListView()
{ {
delete menu; if (m_rightMenu) {
delete gsetting; delete m_rightMenu;
m_rightMenu = nullptr;
}
if (m_gsetting) {
delete m_gsetting;
m_gsetting = nullptr;
}
if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void FullListView::initWidget() void FullListView::initWidget()

View File

@ -42,9 +42,9 @@ protected:
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
private: private:
RightClickMenu *menu = nullptr;//右键菜单 RightClickMenu *m_rightMenu = nullptr;//右键菜单
QStringList data; QStringList m_data;
QGSettings *gsetting = nullptr; QGSettings *m_gsetting = nullptr;
public Q_SLOTS: public Q_SLOTS:
void selectFirstItem(); void selectFirstItem();

View File

@ -30,37 +30,43 @@ KListView::KListView(QWidget *parent):
KListView::~KListView() KListView::~KListView()
{ {
delete m_delegate; if (m_delegate) {
delete listmodel; delete m_delegate;
delete pUkuiMenuInterface; m_delegate = nullptr;
}
if (m_listmodel) {
delete m_listmodel;
m_listmodel = nullptr;
}
} }
void KListView::addData(QStringList data) void KListView::addData(QStringList data)
{ {
listmodel = new QStandardItemModel(this); m_listmodel = new QStandardItemModel(this);
this->setModel(listmodel); this->setModel(m_listmodel);
Q_FOREACH(QString desktopfp, data) { Q_FOREACH(QString desktopfp, data) {
QStandardItem *item = new QStandardItem; QStandardItem *item = new QStandardItem;
item->setData(QVariant::fromValue<QString>(desktopfp), Qt::DisplayRole); item->setData(QVariant::fromValue<QString>(desktopfp), Qt::DisplayRole);
listmodel->appendRow(item); m_listmodel->appendRow(item);
} }
} }
void KListView::updateData(QStringList data) void KListView::updateData(QStringList data)
{ {
listmodel->clear(); m_listmodel->clear();
Q_FOREACH(QString desktopfp, data) { Q_FOREACH(QString desktopfp, data) {
QStandardItem *item = new QStandardItem; QStandardItem *item = new QStandardItem;
item->setData(QVariant::fromValue<QString>(desktopfp), Qt::DisplayRole); item->setData(QVariant::fromValue<QString>(desktopfp), Qt::DisplayRole);
listmodel->appendRow(item); m_listmodel->appendRow(item);
} }
} }
void KListView::onClicked(QModelIndex index) void KListView::onClicked(QModelIndex index)
{ {
QVariant var = listmodel->data(index, Qt::DisplayRole); QVariant var = m_listmodel->data(index, Qt::DisplayRole);
if (var.isValid()) { if (var.isValid()) {
QString desktopfp = var.value<QString>(); QString desktopfp = var.value<QString>();
Q_EMIT sendHideMainWindowSignal(); Q_EMIT sendHideMainWindowSignal();
@ -88,7 +94,7 @@ void KListView::mouseMoveEvent(QMouseEvent *e)
void KListView::mousePressEvent(QMouseEvent *event) void KListView::mousePressEvent(QMouseEvent *event)
{ {
if ((this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) { if ((this->indexAt(event->pos()).isValid()) && event->button() == Qt::LeftButton) {
pressApp = listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole); m_pressApp = m_listmodel->data(this->indexAt(event->pos()), Qt::DisplayRole);
} }
return QListView::mousePressEvent(event); return QListView::mousePressEvent(event);
} }
@ -111,7 +117,7 @@ void KListView::rightClickedSlot(const QPoint &pos)
return; return;
} }
QVariant var = listmodel->data(index, Qt::DisplayRole); QVariant var = m_listmodel->data(index, Qt::DisplayRole);
QStringList strlist = var.value<QStringList>(); QStringList strlist = var.value<QStringList>();
if (strlist.count() == 1 || ((strlist.count() == 2) && (strlist.at(1).toInt() == 1))) { if (strlist.count() == 1 || ((strlist.count() == 2) && (strlist.at(1).toInt() == 1))) {

View File

@ -33,11 +33,11 @@ public:
void initWidget(); void initWidget();
KItemDelegate *m_delegate = nullptr; KItemDelegate *m_delegate = nullptr;
QStandardItemModel *listmodel = nullptr; QStandardItemModel *m_listmodel = nullptr;
int module = 0; int module = 0;
double transparency; double m_transparency;
QVariant pressApp; QVariant m_pressApp;
UkuiMenuInterface *pUkuiMenuInterface = nullptr; UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
protected: protected:
void paintEvent(QPaintEvent *e); void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event);

View File

@ -30,15 +30,18 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
this->h = 540; this->h = 540;
this->module = 1; this->module = 1;
initWidget(); initWidget();
listmodel = new QStandardItemModel(this); m_listmodel = new QStandardItemModel(this);
this->setModel(listmodel); this->setModel(m_listmodel);
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
} }
ListView::~ListView() ListView::~ListView()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void ListView::initWidget() void ListView::initWidget()
@ -70,12 +73,12 @@ void ListView::initWidget()
void ListView::addData(QVector<QStringList> data, int module) void ListView::addData(QVector<QStringList> data, int module)
{ {
this->module = module; this->module = module;
listmodel->clear(); m_listmodel->clear();
Q_FOREACH(QStringList desktopfp, data) { Q_FOREACH(QStringList desktopfp, data) {
QStandardItem *item = new QStandardItem; QStandardItem *item = new QStandardItem;
item->setData(QVariant::fromValue<QStringList>(desktopfp), Qt::DisplayRole); item->setData(QVariant::fromValue<QStringList>(desktopfp), Qt::DisplayRole);
listmodel->appendRow(item); m_listmodel->appendRow(item);
} }
m_delegate = new ItemDelegate(this, module); m_delegate = new ItemDelegate(this, module);
@ -84,18 +87,18 @@ void ListView::addData(QVector<QStringList> data, int module)
void ListView::updateData(QVector<QStringList> data) void ListView::updateData(QVector<QStringList> data)
{ {
listmodel->clear(); m_listmodel->clear();
Q_FOREACH(QStringList desktopfp, data) { Q_FOREACH(QStringList desktopfp, data) {
QStandardItem *item = new QStandardItem; QStandardItem *item = new QStandardItem;
item->setData(QVariant::fromValue<QStringList>(desktopfp), Qt::DisplayRole); item->setData(QVariant::fromValue<QStringList>(desktopfp), Qt::DisplayRole);
listmodel->appendRow(item); m_listmodel->appendRow(item);
} }
} }
void ListView::onClicked(QModelIndex index) void ListView::onClicked(QModelIndex index)
{ {
QVariant var = listmodel->data(index, Qt::DisplayRole); QVariant var = m_listmodel->data(index, Qt::DisplayRole);
QString desktopfp = var.value<QStringList>().at(0); QString desktopfp = var.value<QStringList>().at(0);
if (var.isValid()) { if (var.isValid()) {

View File

@ -30,12 +30,16 @@ RightListView::RightListView(QWidget *parent):
initWidget(); initWidget();
m_delegate = new RightItemDelegate(this); m_delegate = new RightItemDelegate(this);
this->setItemDelegate(m_delegate); this->setItemDelegate(m_delegate);
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
RightListView::~RightListView() RightListView::~RightListView()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void RightListView::initWidget() void RightListView::initWidget()
@ -69,11 +73,11 @@ void RightListView::dropEvent(QDropEvent *event)
m_dropPos = event->pos(); m_dropPos = event->pos();
if (this->indexAt(m_dropPos).isValid()) { if (this->indexAt(m_dropPos).isValid()) {
QVariant var = listmodel->data(indexAt(m_dropPos), Qt::DisplayRole); QVariant var = m_listmodel->data(indexAt(m_dropPos), Qt::DisplayRole);
QString desktopfp = var.value<QString>(); QString desktopfp = var.value<QString>();
QFileInfo fileInfo(desktopfp); QFileInfo fileInfo(desktopfp);
QString desktopfn = fileInfo.fileName(); QString desktopfn = fileInfo.fileName();
QString dragDesktopfp = pressApp.value<QString>(); QString dragDesktopfp = m_pressApp.value<QString>();
QFileInfo dragFileInfo(dragDesktopfp); QFileInfo dragFileInfo(dragDesktopfp);
QString dragDesktopfn = dragFileInfo.fileName(); QString dragDesktopfn = dragFileInfo.fileName();
changeCollectSort(dragDesktopfn, desktopfn); changeCollectSort(dragDesktopfn, desktopfn);
@ -129,7 +133,7 @@ void RightListView::keyPressEvent(QKeyEvent *e)
void RightListView::onClicked(QModelIndex index) void RightListView::onClicked(QModelIndex index)
{ {
QVariant var = listmodel->data(index, Qt::DisplayRole); QVariant var = m_listmodel->data(index, Qt::DisplayRole);
QString desktopfp = var.value<QStringList>().at(0); QString desktopfp = var.value<QStringList>().at(0);
if (var.isValid()) { if (var.isValid()) {
QString desktopfp = var.value<QString>(); QString desktopfp = var.value<QString>();

View File

@ -362,6 +362,7 @@ void TabletListView::mousePressEvent(QMouseEvent *event)
void TabletListView::mouseMoveEvent(QMouseEvent *event) void TabletListView::mouseMoveEvent(QMouseEvent *event)
{ {
myDebug();
if (event->buttons() & Qt::LeftButton & this->indexAt(event->pos()).isValid()) { if (event->buttons() & Qt::LeftButton & this->indexAt(event->pos()).isValid()) {
if (iconClick) { if (iconClick) {
if ((event->pos() - startPos).manhattanLength() >= QApplication::startDragDistance()) { if ((event->pos() - startPos).manhattanLength() >= QApplication::startDragDistance()) {
@ -429,12 +430,14 @@ void TabletListView::dragMoveEvent(QDragMoveEvent *event)
void TabletListView::dragEnterEvent(QDragEnterEvent *event) void TabletListView::dragEnterEvent(QDragEnterEvent *event)
{ {
myDebug();
iconClick = true; iconClick = true;
event->accept(); event->accept();
} }
void TabletListView::dropEvent(QDropEvent *event) void TabletListView::dropEvent(QDropEvent *event)
{ {
myDebug();
dropPos = event->pos(); dropPos = event->pos();
pressDesktopfp = (QString)event->mimeData()->data("INFO"); pressDesktopfp = (QString)event->mimeData()->data("INFO");
insertApplication(startPos, dropPos); insertApplication(startPos, dropPos);
@ -442,6 +445,7 @@ void TabletListView::dropEvent(QDropEvent *event)
} }
void TabletListView::mouseReleaseEvent(QMouseEvent *e) void TabletListView::mouseReleaseEvent(QMouseEvent *e)
{ {
myDebug();
releasepos = e->pos();//释放的位置坐标 releasepos = e->pos();//释放的位置坐标
if (iconClick) { if (iconClick) {

View File

@ -19,6 +19,7 @@
#include "rotationlabel.h" #include "rotationlabel.h"
#include <QPainter> #include <QPainter>
#include <QDebug> #include <QDebug>
#include "utility.h"
RotationLabel::RotationLabel(QWidget *parent) RotationLabel::RotationLabel(QWidget *parent)
: QLabel(parent) : QLabel(parent)
@ -50,6 +51,11 @@ void RotationLabel::paintEvent(QPaintEvent *event)
return QLabel::paintEvent(event); return QLabel::paintEvent(event);
} }
void RotationLabel::mouseReleaseEvent(QMouseEvent *ev)
{
Q_UNUSED(ev);
}
void RotationLabel::setIcon(const QPixmap &pixmap) void RotationLabel::setIcon(const QPixmap &pixmap)
{ {
m_pixmap = pixmap; m_pixmap = pixmap;

View File

@ -31,6 +31,7 @@ protected:
int rotation(); int rotation();
void setRotation(int rot); void setRotation(int rot);
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
void mouseReleaseEvent(QMouseEvent *ev);
private: private:
int m_rotation = 0; int m_rotation = 0;
QPixmap m_pixmap; QPixmap m_pixmap;

View File

@ -47,8 +47,15 @@ RightClickMenu::RightClickMenu(QWidget *parent):
RightClickMenu::~RightClickMenu() RightClickMenu::~RightClickMenu()
{ {
delete m_cmdProc; if (m_cmdProc) {
delete m_ukuiMenuInterface; delete m_cmdProc;
m_cmdProc = nullptr;
}
if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
QPixmap RightClickMenu::getIconPixmap(QString iconstr, int type) QPixmap RightClickMenu::getIconPixmap(QString iconstr, int type)
@ -127,7 +134,7 @@ bool RightClickMenu::canSwitch()
return false; return false;
} else { } else {
QDBusReply<QVariant> reply = interface.call("Get","org.freedesktop.DisplayManager.Seat","CanSwitch"); QDBusReply<QVariant> reply = interface.call("Get","org.freedesktop.DisplayManager.Seat","CanSwitch");
return reply.value().toBool(); return reply.value().toBool();
} }
} }
@ -307,14 +314,14 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind)
reply = iface.call("canHibernate"); reply = iface.call("canHibernate");
if (reply.isValid() && reply.value() == true) { if (reply.isValid() && reply.value()) {
m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-sleep-symbolic", 1)), tr("Hibernate"), m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-sleep-symbolic", 1)), tr("Hibernate"),
this, SLOT(hibernateActionTriggerSlot())); this, SLOT(hibernateActionTriggerSlot()));
} }
reply = iface.call("canSuspend"); reply = iface.call("canSuspend");
if (reply.isValid() && reply.value() == true) { if (reply.isValid() && reply.value()) {
m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-hebernate-symbolic", 1)), tr("Sleep"), m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-hebernate-symbolic", 1)), tr("Sleep"),
this, SLOT(sleepActionTriggerSlot())); this, SLOT(sleepActionTriggerSlot()));
} }
@ -323,21 +330,21 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind)
this, SLOT(lockScreenActionTriggerSlot())); this, SLOT(lockScreenActionTriggerSlot()));
reply = iface.call("canLogout"); reply = iface.call("canLogout");
if (reply.isValid() && reply.value() == true) { if (reply.isValid() && reply.value()) {
m_showShutMenu.addAction(QIcon(getIconPixmap("system-logout-symbolic", 1)), tr("Log Out"), m_showShutMenu.addAction(QIcon(getIconPixmap("system-logout-symbolic", 1)), tr("Log Out"),
this, SLOT(logoutActionTriggerSlot())); this, SLOT(logoutActionTriggerSlot()));
} }
reply = iface.call("canReboot"); reply = iface.call("canReboot");
if (reply.isValid() && reply.value() == true) { if (reply.isValid() && reply.value()) {
m_showShutMenu.addAction(QIcon(getIconPixmap("system-restart-symbolic", 1)), tr("Restart"), m_showShutMenu.addAction(QIcon(getIconPixmap("system-restart-symbolic", 1)), tr("Restart"),
this, SLOT(rebootActionTriggerSlot())); this, SLOT(rebootActionTriggerSlot()));
} }
reply = iface.call("canPowerOff"); reply = iface.call("canPowerOff");
if (reply.isValid() && reply.value() == true) { if (reply.isValid() && reply.value()) {
m_showShutMenu.addAction(QIcon(getIconPixmap("exit-symbolic", 1)), tr("Power Off"), m_showShutMenu.addAction(QIcon(getIconPixmap("exit-symbolic", 1)), tr("Power Off"),
this, SLOT(shutdownActionTriggerSlot())); this, SLOT(shutdownActionTriggerSlot()));
} }

View File

@ -24,12 +24,15 @@ FullItemDelegate::FullItemDelegate(QObject *parent, int module):
KItemDelegate(parent) KItemDelegate(parent)
{ {
this->module = module; this->module = module;
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
FullItemDelegate::~FullItemDelegate() FullItemDelegate::~FullItemDelegate()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
@ -69,7 +72,7 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
painter->save(); painter->save();
painter->setOpacity(1); painter->setOpacity(1);
QString desktopfp = index.data(Qt::DisplayRole).value<QString>(); QString desktopfp = index.data(Qt::DisplayRole).value<QString>();
QString iconstr = pUkuiMenuInterface->getAppIcon(desktopfp); QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfp);
QIcon icon; QIcon icon;
QFileInfo iconFileInfo(iconstr); QFileInfo iconFileInfo(iconstr);
@ -115,7 +118,7 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
} }
} }
QString appname = pUkuiMenuInterface->getAppName(desktopfp); QString appname = m_ukuiMenuInterface->getAppName(desktopfp);
QRect iconRect; QRect iconRect;
QRect textRect; QRect textRect;
iconRect = QRect(rect.x() + (rect.width() - Style::AppListIconSize) / 2, iconRect = QRect(rect.x() + (rect.width() - Style::AppListIconSize) / 2,

View File

@ -26,12 +26,15 @@ ItemDelegate::ItemDelegate(QObject *parent, int module):
KItemDelegate(parent) KItemDelegate(parent)
{ {
this->module = module; this->module = module;
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
ItemDelegate::~ItemDelegate() ItemDelegate::~ItemDelegate()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
@ -86,7 +89,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
if (module > 0) { if (module > 0) {
if (strlist.at(1).toInt() == 1) { if (strlist.at(1).toInt() == 1) {
QRect iconRect = QRect(rect.x() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32); QRect iconRect = QRect(rect.x() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32);
QString iconstr = pUkuiMenuInterface->getAppIcon(strlist.at(0)); QString iconstr = m_ukuiMenuInterface->getAppIcon(strlist.at(0));
QIcon icon; QIcon icon;
QFileInfo iconFileInfo(iconstr); QFileInfo iconFileInfo(iconstr);
@ -130,7 +133,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
painter->save(); painter->save();
icon.paint(painter, iconRect, Qt::AlignCenter); icon.paint(painter, iconRect, Qt::AlignCenter);
QString appname = pUkuiMenuInterface->getAppName(strlist.at(0)); QString appname = m_ukuiMenuInterface->getAppName(strlist.at(0));
QFontMetrics fm = painter->fontMetrics(); QFontMetrics fm = painter->fontMetrics();
QString appnameElidedText = fm.elidedText(appname, Qt::ElideRight, rect.width() - 62, Qt::TextShowMnemonic); QString appnameElidedText = fm.elidedText(appname, Qt::ElideRight, rect.width() - 62, Qt::TextShowMnemonic);
painter->drawText(QRect(iconRect.right() + 15, rect.y(), painter->drawText(QRect(iconRect.right() + 15, rect.y(),
@ -253,7 +256,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
} }
} else { } else {
QRect iconRect = QRect(rect.left() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32); QRect iconRect = QRect(rect.left() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32);
QString iconstr = pUkuiMenuInterface->getAppIcon(strlist.at(0)); QString iconstr = m_ukuiMenuInterface->getAppIcon(strlist.at(0));
QIcon icon; QIcon icon;
QFileInfo iconFileInfo(iconstr); QFileInfo iconFileInfo(iconstr);
@ -296,7 +299,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
} }
icon.paint(painter, iconRect, Qt::AlignCenter); icon.paint(painter, iconRect, Qt::AlignCenter);
QString appname = pUkuiMenuInterface->getAppName(strlist.at(0)); QString appname = m_ukuiMenuInterface->getAppName(strlist.at(0));
QFileInfo fileInfo(strlist.at(0)); QFileInfo fileInfo(strlist.at(0));
QString desktopfn = fileInfo.fileName(); QString desktopfn = fileInfo.fileName();

View File

@ -22,3 +22,7 @@ KItemDelegate::KItemDelegate(QObject *parent):
QStyledItemDelegate(parent) QStyledItemDelegate(parent)
{ {
} }
KItemDelegate::~KItemDelegate()
{
}

View File

@ -26,9 +26,10 @@ class KItemDelegate : public QStyledItemDelegate
Q_OBJECT Q_OBJECT
public: public:
KItemDelegate(QObject *parent); KItemDelegate(QObject *parent);
~KItemDelegate();
int module = 0; int module = 0;
UkuiMenuInterface *pUkuiMenuInterface = nullptr; UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
}; };
#endif // KITEMDELEGATE_H #endif // KITEMDELEGATE_H

View File

@ -18,19 +18,22 @@
#include "recent_item_delegate.h" #include "recent_item_delegate.h"
recentitemdelegate::recentitemdelegate(QObject *parent, int module): RecentItemDelegate::RecentItemDelegate(QObject *parent, int module):
KItemDelegate(parent) KItemDelegate(parent)
{ {
this->module = module; this->module = module;
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
recentitemdelegate::~recentitemdelegate() RecentItemDelegate::~RecentItemDelegate()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const void RecentItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{ {
if (index.isValid()) { if (index.isValid()) {
// QStyleOptionViewItem viewOption(option);//用来在视图中画一个item // QStyleOptionViewItem viewOption(option);//用来在视图中画一个item
@ -148,7 +151,7 @@ void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
} }
} else { } else {
QRect iconRect = QRect(rect.left() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32); QRect iconRect = QRect(rect.left() + 11, rect.y() + (rect.height() - 32) / 2, 32, 32);
QString iconstr = pUkuiMenuInterface->getAppIcon(strlist.at(0)); QString iconstr = m_ukuiMenuInterface->getAppIcon(strlist.at(0));
QIcon icon; QIcon icon;
QFileInfo iconFileInfo(iconstr); QFileInfo iconFileInfo(iconstr);
@ -191,7 +194,7 @@ void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
} }
icon.paint(painter, iconRect, Qt::AlignCenter); icon.paint(painter, iconRect, Qt::AlignCenter);
QString appname = pUkuiMenuInterface->getAppName(strlist.at(0)); QString appname = m_ukuiMenuInterface->getAppName(strlist.at(0));
QFileInfo fileInfo(strlist.at(0)); QFileInfo fileInfo(strlist.at(0));
QString desktopfn = fileInfo.fileName(); QString desktopfn = fileInfo.fileName();
@ -237,7 +240,7 @@ void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
} }
} }
QSize recentitemdelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const QSize RecentItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{ {
// QStringList strlist=index.model()->data(index,Qt::DisplayRole).toStringList(); // QStringList strlist=index.model()->data(index,Qt::DisplayRole).toStringList();
// if(strlist.at(1).toInt()==1) // if(strlist.at(1).toInt()==1)

View File

@ -26,15 +26,15 @@
#include "src/UtilityFunction/utility.h" #include "src/UtilityFunction/utility.h"
#include "kitemdelegate.h" #include "kitemdelegate.h"
class recentitemdelegate : public KItemDelegate class RecentItemDelegate : public KItemDelegate
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* @param module为0时为常用模块123 * @param module为0时为常用模块123
*/ */
recentitemdelegate(QObject *parent, int module); RecentItemDelegate(QObject *parent, int module);
~recentitemdelegate(); ~RecentItemDelegate();
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
}; };

View File

@ -23,12 +23,15 @@
RightItemDelegate::RightItemDelegate(QObject *parent): RightItemDelegate::RightItemDelegate(QObject *parent):
KItemDelegate(parent) KItemDelegate(parent)
{ {
pUkuiMenuInterface = new UkuiMenuInterface; m_ukuiMenuInterface = new UkuiMenuInterface;
} }
RightItemDelegate::~RightItemDelegate() RightItemDelegate::~RightItemDelegate()
{ {
delete pUkuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
@ -83,7 +86,7 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
painter->save(); painter->save();
painter->setOpacity(1); painter->setOpacity(1);
QString desktopfp = index.data(Qt::DisplayRole).value<QString>(); QString desktopfp = index.data(Qt::DisplayRole).value<QString>();
QString iconstr = pUkuiMenuInterface->getAppIcon(desktopfp); QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfp);
QIcon icon; QIcon icon;
QFileInfo iconFileInfo(iconstr); QFileInfo iconFileInfo(iconstr);
@ -129,7 +132,7 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
} }
} }
QString appname = pUkuiMenuInterface->getAppName(desktopfp); QString appname = m_ukuiMenuInterface->getAppName(desktopfp);
QRect iconRect; QRect iconRect;
QRect textRect; QRect textRect;
iconRect = QRect(rect.x() + 28, iconRect = QRect(rect.x() + 28,

View File

@ -31,7 +31,10 @@ FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) :
FullCommonUseWidget::~FullCommonUseWidget() FullCommonUseWidget::~FullCommonUseWidget()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void FullCommonUseWidget::initUi() void FullCommonUseWidget::initUi()

View File

@ -32,7 +32,10 @@ FullFunctionWidget::FullFunctionWidget(QWidget *parent) :
FullFunctionWidget::~FullFunctionWidget() FullFunctionWidget::~FullFunctionWidget()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void FullFunctionWidget::initUi() void FullFunctionWidget::initUi()

View File

@ -28,8 +28,14 @@ FullLetterWidget::FullLetterWidget(QWidget *parent) :
FullLetterWidget::~FullLetterWidget() FullLetterWidget::~FullLetterWidget()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_letterListBottomSpacer; delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
if (m_letterListBottomSpacer) {
delete m_letterListBottomSpacer;
m_letterListBottomSpacer = nullptr;
}
} }
/** /**

View File

@ -29,7 +29,10 @@ FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) :
FullSearchResultWidget::~FullSearchResultWidget() FullSearchResultWidget::~FullSearchResultWidget()
{ {
delete m_ukuiMenuInterface; if (m_ukuiMenuInterface) {
delete m_ukuiMenuInterface;
m_ukuiMenuInterface = nullptr;
}
} }
void FullSearchResultWidget::initUi() void FullSearchResultWidget::initUi()

View File

@ -24,7 +24,6 @@
#include <QLocale> #include <QLocale>
#include <qwindow.h> #include <qwindow.h>
#include <QDir> #include <QDir>
#include <AbstractInterface.h>
#include <QPluginLoader> #include <QPluginLoader>
#include "currenttime_interface.h" #include "currenttime_interface.h"
#include "style.h" #include "style.h"
@ -228,7 +227,7 @@ void FunctionWidget::initUi()
} }
mainLayout->addWidget(searchEditBtn); mainLayout->addWidget(searchEditBtn);
focusPlug = new pluginwidget(this); focusPlug = new PluginWidget(this);
mainLayout->addWidget(focusPlug); mainLayout->addWidget(focusPlug);
focusPlug->setFixedSize(400, 638); focusPlug->setFixedSize(400, 638);
mainLayout->addStretch(); mainLayout->addStretch();

View File

@ -29,7 +29,6 @@
#include <QDateTime> #include <QDateTime>
#include <QGSettings> #include <QGSettings>
#include <QSettings> #include <QSettings>
#include "AbstractInterface.h"
#include <QGraphicsDropShadowEffect> #include <QGraphicsDropShadowEffect>
#include "plugin_widget.h" #include "plugin_widget.h"
#include "currenttime_interface.h" #include "currenttime_interface.h"
@ -41,7 +40,7 @@ public:
FunctionWidget(QWidget *parent); FunctionWidget(QWidget *parent);
~FunctionWidget(); ~FunctionWidget();
//QWidget* focusPlug=nullptr; //QWidget* focusPlug=nullptr;
pluginwidget *focusPlug = nullptr; PluginWidget *focusPlug = nullptr;
void setDownOpacityEffect(const qreal &num); void setDownOpacityEffect(const qreal &num);
protected: protected:

View File

@ -19,14 +19,14 @@
#include "plugin_widget.h" #include "plugin_widget.h"
#include "KySmallPluginInterface.h" #include "KySmallPluginInterface.h"
#include <QDebug> #include <QDebug>
pluginwidget::pluginwidget(QWidget *parent) : QWidget(parent) PluginWidget::PluginWidget(QWidget *parent) : QWidget(parent)
{ {
this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
this->setAttribute(Qt::WA_StyledBackground, true); this->setAttribute(Qt::WA_StyledBackground, true);
this->setFocusPolicy(Qt::NoFocus); this->setFocusPolicy(Qt::NoFocus);
init(); init();
} }
void pluginwidget::init() void PluginWidget::init()
{ {
QPluginLoader loader("/opt/small-plugin/bin/libsmall-plugin-manage.so"); QPluginLoader loader("/opt/small-plugin/bin/libsmall-plugin-manage.so");
QObject *plugin = loader.instance(); QObject *plugin = loader.instance();

View File

@ -26,8 +26,6 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QPluginLoader> #include <QPluginLoader>
#include <AbstractInterface.h>
#include <abstractInterface.h>
#include <QLibrary> #include <QLibrary>
#include <QEvent> #include <QEvent>
#include <QLabel> #include <QLabel>
@ -35,11 +33,11 @@
#include <QSettings> #include <QSettings>
#include <QDBusInterface> #include <QDBusInterface>
#include <QDBusReply> #include <QDBusReply>
class pluginwidget : public QWidget class PluginWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit pluginwidget(QWidget *parent = nullptr); explicit PluginWidget(QWidget *parent = nullptr);
void init(); void init();
}; };

View File

@ -1,54 +0,0 @@
/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/
#include "tabview_widget.h"
#include <QTabBar>
TabViewWidget::TabViewWidget()
{
setStyleSheet("background:transparent");
collectionTab = new QWidget();
recentTab = new QWidget();
collectionTab->setObjectName(QString::fromUtf8("collectionTab"));
recentTab->setObjectName(QString::fromUtf8("recentTab"));
this->addTab(collectionTab, QString());
this->addTab(recentTab, QString());
this->tabBar()->hide();
this->setCurrentIndex(0);
initAppListWidget();
updateListView();
}
void TabViewWidget::initAppListWidget()
{
m_collectListView = new RightListView(collectionTab);
m_collectListView->setFixedSize(352, 428);
m_collectListView->show();
}
void TabViewWidget::updateListView()
{
m_data.clear();
Q_FOREACH(QString desktopfp, m_ukuiMenuInterface->getAllClassification()) {
m_data.append(desktopfp);
}
m_collectListView->addData(m_data);
}

View File

@ -1,43 +0,0 @@
/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/
#ifndef TABVIEWWIDGET_H
#define TABVIEWWIDGET_H
#include <QTabWidget>
#include "rightlistview.h"
class TabViewWidget: public QTabWidget
{
public:
TabViewWidget();
protected:
void initAppListWidget();
void updateListView();
private:
UkuiMenuInterface *m_ukuiMenuInterface = nullptr;
QWidget *collectionTab = nullptr;
QWidget *recentTab = nullptr;
RightListView *m_collectListView = nullptr;
QStringList m_data;
};
#endif // TABVIEWWIDGET_H

View File

@ -770,7 +770,7 @@ void MainWindow::minAnimationFinished()
// m_collectPushButton->clicked(true); // m_collectPushButton->clicked(true);
on_collectPushButton_clicked(); on_collectPushButton_clicked();
QTimer::singleShot(200, [=]() { QTimer::singleShot(200, [ = ]() {
m_animationPage->hide(); m_animationPage->hide();
}); });
} }
@ -790,7 +790,7 @@ void MainWindow::maxAnimationFinished()
setMaxWindowPos(); setMaxWindowPos();
m_fullWindow->activateWindow(); m_fullWindow->activateWindow();
QTimer::singleShot(200, [=]() { QTimer::singleShot(200, [ = ]() {
m_animationPage->hide(); m_animationPage->hide();
}); });
} }

View File

@ -38,7 +38,6 @@
#include "convert_winid_to_desktop.h" #include "convert_winid_to_desktop.h"
#include "style.h" #include "style.h"
#include "main_view_widget.h" #include "main_view_widget.h"
#include "tabview_widget.h"
#include "dbus.h" #include "dbus.h"
#include "dbus-adaptor.h" #include "dbus-adaptor.h"
#include "software_database_update_thread.h" #include "software_database_update_thread.h"
@ -54,6 +53,7 @@
#include "letter_button_widget.h" #include "letter_button_widget.h"
#include "animationpage.h" #include "animationpage.h"
#include "rotationlabel.h" #include "rotationlabel.h"
#include "rightlistview.h"
#include "ukuistylehelper/ukuistylehelper.h" #include "ukuistylehelper/ukuistylehelper.h"
#include "windowmanager/windowmanager.h" #include "windowmanager/windowmanager.h"

View File

@ -40,7 +40,6 @@ HEADERS += \
$$PWD/Widget/main_view_widget.h \ $$PWD/Widget/main_view_widget.h \
$$PWD/Widget/plugin_widget.h \ $$PWD/Widget/plugin_widget.h \
$$PWD/Widget/splitbar_frame.h \ $$PWD/Widget/splitbar_frame.h \
$$PWD/Widget/tabview_widget.h \
$$PWD/full_mainwindow.h \ $$PWD/full_mainwindow.h \
$$PWD/mainwindow.h \ $$PWD/mainwindow.h \
$$PWD/tabletwindow.h $$PWD/tabletwindow.h
@ -78,7 +77,6 @@ SOURCES += \
$$PWD/Widget/main_view_widget.cpp \ $$PWD/Widget/main_view_widget.cpp \
$$PWD/Widget/plugin_widget.cpp \ $$PWD/Widget/plugin_widget.cpp \
$$PWD/Widget/splitbar_frame.cpp \ $$PWD/Widget/splitbar_frame.cpp \
$$PWD/Widget/tabview_widget.cpp \
$$PWD/full_mainwindow.cpp \ $$PWD/full_mainwindow.cpp \
$$PWD/mainwindow.cpp \ $$PWD/mainwindow.cpp \
$$PWD/tabletwindow.cpp $$PWD/tabletwindow.cpp

View File

@ -1,31 +0,0 @@
/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/
#ifndef ABSTRACTINTERFACE_H
#define ABSTRACTINTERFACE_H
#include <QObject>
class QWidget;
class AbstractInterface
{
public:
virtual ~AbstractInterface() {}
virtual QWidget *createPluginWidget(QWidget *parent, bool type) = 0;
};
#define AbstractInterface_iid "Welcome to use focusmode"
Q_DECLARE_INTERFACE(AbstractInterface, AbstractInterface_iid)
#endif // ABSTRACTINTERFACE_H

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/
#ifndef OOBE_PLUGIN_INFACE_H
#define OOBE_PLUGIN_INFACE_H
#include <QtPlugin>
#include <functional>
#include <QString>
#include <QObject>
class QWidget;
class kyMenuPluginInterface
{
public:
virtual ~kyMenuPluginInterface() {}
virtual const QString name() = 0;
virtual const QString description() = 0;
virtual QWidget *createWidget(QWidget *parent) = 0;
};
Q_DECLARE_INTERFACE(kyMenuPluginInterface, "org.kyMenuPlugin.AbstractInterface")
#endif

View File

@ -237,19 +237,13 @@ bool ThumbNail::appDisable(QString desktopfp)//判断是否是禁用应用(这
char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr); char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr);
//取出value值 //取出value值
QString execnamestr = QString::fromLocal8Bit(name); QString execnamestr = QString::fromLocal8Bit(name);
//处理value值
str = execnamestr;
// str = execnamestr.section(' ', 0, 0);
// QStringList list = str.split('/');
// str = list[list.size()-1];
//关闭文件
g_key_file_free(keyfile); g_key_file_free(keyfile);
QString desktopfp1 =/*"application/"+*/str;
//QString group=desktopfp.split('/').last(); //QString group=desktopfp.split('/').last();
disableSetting->beginGroup("application"); disableSetting->beginGroup("application");
//判断 //判断
bool bo = disableSetting->contains(desktopfp1.toLocal8Bit().data()); // iskey bool bo = disableSetting->contains(execnamestr.toLocal8Bit().data()); // iskey
bool bo1 = disableSetting->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue bool bo1 = disableSetting->QSettings::value(execnamestr.toLocal8Bit().data()).toBool(); //isvalue
disableSetting->endGroup(); disableSetting->endGroup();
//qDebug()<<bo<<bo1; //qDebug()<<bo<<bo1;

View File

@ -3,10 +3,8 @@ INCLUDEPATH += \
$$PWD/Style $$PWD/Style
HEADERS += \ HEADERS += \
$$PWD/AbstractInterface.h \
$$PWD/KySmallPluginInterface.h \ $$PWD/KySmallPluginInterface.h \
$$PWD/Style/style.h \ $$PWD/Style/style.h \
$$PWD/abstractInterface.h \
$$PWD/thumbnail.h \ $$PWD/thumbnail.h \
$$PWD/utility.h $$PWD/utility.h