From 3b4474ab63321d07a938e2c70c196ddb611df14b Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 13 Sep 2022 08:37:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=A7=84=E8=8C=83=E6=80=A7?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileWatcher/desktop_watcher.cpp | 4 + src/BackProcess/FileWatcher/desktop_watcher.h | 1 + .../FileWatcher/directory_changed_thread.cpp | 5 +- .../tablet_directorychanged_thread.cpp | 79 +++++++++---------- .../tablet_directorychanged_thread.h | 2 +- .../Interface/currenttime_interface.h | 4 +- src/BackProcess/Search/searchappthread.cpp | 5 +- src/BackProcess/tablet/getmodeldata.cpp | 16 +++- src/BackProcess/tablet/getmodeldata.h | 1 + src/BackProcess/tablet/pagemanager.cpp | 8 ++ src/BackProcess/tablet/pagemanager.h | 1 + src/UserInterface/ListView/fulllistview.cpp | 18 ++++- src/UserInterface/ListView/fulllistview.h | 6 +- src/UserInterface/ListView/klistview.cpp | 28 ++++--- src/UserInterface/ListView/klistview.h | 8 +- src/UserInterface/ListView/listview.cpp | 21 ++--- src/UserInterface/ListView/rightlistview.cpp | 14 ++-- src/UserInterface/ListView/tabletlistview.cpp | 4 + src/UserInterface/Other/rotationlabel.cpp | 6 ++ src/UserInterface/Other/rotationlabel.h | 1 + .../RightClickMenu/rightclickmenu.cpp | 23 ++++-- .../ViewItem/full_item_delegate.cpp | 11 ++- src/UserInterface/ViewItem/itemdelegate.cpp | 15 ++-- src/UserInterface/ViewItem/kitemdelegate.cpp | 4 + src/UserInterface/ViewItem/kitemdelegate.h | 3 +- .../ViewItem/recent_item_delegate.cpp | 19 +++-- .../ViewItem/recent_item_delegate.h | 6 +- .../ViewItem/right_item_delegate.cpp | 11 ++- .../Widget/full_commonuse_widget.cpp | 5 +- .../Widget/full_function_widget.cpp | 5 +- .../Widget/full_letter_widget.cpp | 10 ++- .../Widget/full_searchresult_widget.cpp | 5 +- src/UserInterface/Widget/function_Widget.cpp | 3 +- src/UserInterface/Widget/function_Widget.h | 3 +- src/UserInterface/Widget/plugin_widget.cpp | 4 +- src/UserInterface/Widget/plugin_widget.h | 6 +- src/UserInterface/Widget/tabview_widget.cpp | 54 ------------- src/UserInterface/Widget/tabview_widget.h | 43 ---------- src/UserInterface/mainwindow.cpp | 4 +- src/UserInterface/mainwindow.h | 2 +- src/UserInterface/userinterface.pri | 2 - src/UtilityFunction/AbstractInterface.h | 31 -------- src/UtilityFunction/abstractInterface.h | 38 --------- src/UtilityFunction/thumbnail.cpp | 12 +-- src/UtilityFunction/utilityfunction.pri | 2 - 45 files changed, 238 insertions(+), 315 deletions(-) delete mode 100755 src/UserInterface/Widget/tabview_widget.cpp delete mode 100755 src/UserInterface/Widget/tabview_widget.h delete mode 100755 src/UtilityFunction/AbstractInterface.h delete mode 100755 src/UtilityFunction/abstractInterface.h diff --git a/src/BackProcess/FileWatcher/desktop_watcher.cpp b/src/BackProcess/FileWatcher/desktop_watcher.cpp index 299614c..67af15d 100755 --- a/src/BackProcess/FileWatcher/desktop_watcher.cpp +++ b/src/BackProcess/FileWatcher/desktop_watcher.cpp @@ -38,6 +38,10 @@ DesktopWatcher::DesktopWatcher() connect(m_directoryChangedThread, &DirectoryChangedThread::requestUpdateSignal, this, &DesktopWatcher::requestUpdateSlot); } +DesktopWatcher::~DesktopWatcher() +{ +} + /** * desktop文件目录改变信号槽 */ diff --git a/src/BackProcess/FileWatcher/desktop_watcher.h b/src/BackProcess/FileWatcher/desktop_watcher.h index 50209e9..9f23905 100755 --- a/src/BackProcess/FileWatcher/desktop_watcher.h +++ b/src/BackProcess/FileWatcher/desktop_watcher.h @@ -27,6 +27,7 @@ class DesktopWatcher : public QObject Q_OBJECT public: DesktopWatcher(); + ~DesktopWatcher(); public: Q_SIGNALS: diff --git a/src/BackProcess/FileWatcher/directory_changed_thread.cpp b/src/BackProcess/FileWatcher/directory_changed_thread.cpp index 3ef8938..694cdfe 100755 --- a/src/BackProcess/FileWatcher/directory_changed_thread.cpp +++ b/src/BackProcess/FileWatcher/directory_changed_thread.cpp @@ -28,7 +28,10 @@ DirectoryChangedThread::DirectoryChangedThread() DirectoryChangedThread::~DirectoryChangedThread() { - delete m_ukuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void DirectoryChangedThread::run() diff --git a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp index 1d2258f..09f9016 100755 --- a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp +++ b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.cpp @@ -28,21 +28,20 @@ TabletDirectoryChangedThread::TabletDirectoryChangedThread() { m_ukuiMenuInterface = new UkuiMenuInterface; QString path = QDir::homePath() + "/.config/ukui/ukui-menu.ini"; - setting = new QSettings(path, QSettings::IniFormat); + m_setting = new QSettings(path, QSettings::IniFormat); } TabletDirectoryChangedThread::~TabletDirectoryChangedThread() { if (m_ukuiMenuInterface) { delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; } - if (setting) { - delete setting; + if (m_setting) { + delete m_setting; + m_setting = nullptr; } - - m_ukuiMenuInterface = nullptr; - setting = nullptr; } @@ -67,35 +66,35 @@ void TabletDirectoryChangedThread::run() QStringList list = str.split('/'); str = list[list.size() - 1]; QString desktopfn = str; - setting->beginGroup("recentapp"); - setting->setValue(desktopfn, datetime); - setting->sync(); - setting->endGroup(); + m_setting->beginGroup("recentapp"); + m_setting->setValue(desktopfn, datetime); + m_setting->sync(); + m_setting->endGroup(); //wgx - setting->beginGroup("application"); - QStringList applist = setting->allKeys(); - int appnum = setting->allKeys().count(); + m_setting->beginGroup("application"); + QStringList applist = m_setting->allKeys(); + int appnum = m_setting->allKeys().count(); int maxindex = 0; int minindex = 0; for (int i = 0; i < appnum; i++) { - if (setting->value(applist.at(i)).toInt() > maxindex) { - maxindex = setting->value(applist.at(i)).toInt(); + if (m_setting->value(applist.at(i)).toInt() > maxindex) { + maxindex = m_setting->value(applist.at(i)).toInt(); } - if(setting->value(applist.at(i)).toInt() <= minindex) { - minindex = setting->value(applist.at(i)).toInt(); + if(m_setting->value(applist.at(i)).toInt() <= minindex) { + minindex = m_setting->value(applist.at(i)).toInt(); } } if (desktopfn.contains("small-plugin-manage")){ - setting->setValue(desktopfn,minindex-1); + m_setting->setValue(desktopfn,minindex-1); } else { - setting->setValue(desktopfn,maxindex+1); + m_setting->setValue(desktopfn,maxindex+1); } - setting->sync(); - setting->endGroup(); + m_setting->sync(); + m_setting->endGroup(); // QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfpList.at(i)); syslog(LOG_LOCAL0 | LOG_DEBUG, "%s", iconstr.toLocal8Bit().data()); @@ -113,35 +112,35 @@ void TabletDirectoryChangedThread::run() QFileInfo fileInfo(desktopfp); QString desktopfn = fileInfo.fileName(); myDebug() << "卸载" << desktopfn; - setting->beginGroup("lockapplication"); - setting->remove(desktopfn); - setting->sync(); - setting->endGroup(); - setting->beginGroup("application"); + m_setting->beginGroup("lockapplication"); + m_setting->remove(desktopfn); + m_setting->sync(); + m_setting->endGroup(); + m_setting->beginGroup("application"); - if (!setting->contains(desktopfn)) { - setting->sync(); - setting->endGroup(); + if (!m_setting->contains(desktopfn)) { + m_setting->sync(); + m_setting->endGroup(); continue; } - int val = setting->value(desktopfn).toInt(); + int val = m_setting->value(desktopfn).toInt(); myDebug() << "卸载val" << val; - setting->remove(desktopfn); - QStringList desktopfnList = setting->allKeys(); + m_setting->remove(desktopfn); + QStringList desktopfnList = m_setting->allKeys(); for (int i = 0; i < desktopfnList.count(); i++) { - if (setting->value(desktopfnList.at(i)).toInt() > val) { - setting->setValue(desktopfnList.at(i), setting->value(desktopfnList.at(i)).toInt() - 1); + if (m_setting->value(desktopfnList.at(i)).toInt() > val) { + m_setting->setValue(desktopfnList.at(i), m_setting->value(desktopfnList.at(i)).toInt() - 1); } } - setting->sync(); - setting->endGroup(); - setting->beginGroup("recentapp"); - setting->remove(desktopfn); - setting->sync(); - setting->endGroup(); + m_setting->sync(); + m_setting->endGroup(); + m_setting->beginGroup("recentapp"); + m_setting->remove(desktopfn); + m_setting->sync(); + m_setting->endGroup(); syslog(LOG_LOCAL0 | LOG_DEBUG, "软件卸载desktop文件名:%s", desktopfn.toLocal8Bit().data()); QDBusInterface iface("com.ukui.panel.desktop", "/", diff --git a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.h b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.h index 279dec1..6915f4d 100755 --- a/src/BackProcess/FileWatcher/tablet_directorychanged_thread.h +++ b/src/BackProcess/FileWatcher/tablet_directorychanged_thread.h @@ -35,7 +35,7 @@ public: private: UkuiMenuInterface *m_ukuiMenuInterface = nullptr; - QSettings *setting = nullptr; + QSettings *m_setting = nullptr; TabletListView *m_listView = nullptr; QStandardItemModel *listmodel = nullptr; diff --git a/src/BackProcess/Interface/currenttime_interface.h b/src/BackProcess/Interface/currenttime_interface.h index 50d0f3f..925855a 100755 --- a/src/BackProcess/Interface/currenttime_interface.h +++ b/src/BackProcess/Interface/currenttime_interface.h @@ -25,9 +25,9 @@ #include #include -class CurrentTimeInterface : QObject +class CurrentTimeInterface : public QObject { - + Q_OBJECT public: CurrentTimeInterface(); ~CurrentTimeInterface(); diff --git a/src/BackProcess/Search/searchappthread.cpp b/src/BackProcess/Search/searchappthread.cpp index 128aeed..e0fd07c 100755 --- a/src/BackProcess/Search/searchappthread.cpp +++ b/src/BackProcess/Search/searchappthread.cpp @@ -27,7 +27,10 @@ SearchAppThread::SearchAppThread() SearchAppThread::~SearchAppThread() { - delete m_ukuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void SearchAppThread::run() diff --git a/src/BackProcess/tablet/getmodeldata.cpp b/src/BackProcess/tablet/getmodeldata.cpp index 0c801af..cf7cd79 100755 --- a/src/BackProcess/tablet/getmodeldata.cpp +++ b/src/BackProcess/tablet/getmodeldata.cpp @@ -27,6 +27,14 @@ GetModelData::GetModelData() loadDesktopVercor(); } +GetModelData::~GetModelData() +{ + if (m_ukuiMenuInterface != nullptr) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } +} + void GetModelData::loadDesktopVercor() { UkuiMenuInterface::appInfoVector.clear(); @@ -58,10 +66,10 @@ QStringList GetModelData::getPreCollectionApp() QStringList preAppList = QStringList(); QStringList preAppListExist = QStringList(); preAppList << QString("/usr/share/applications/ukui-control-center.desktop") - <initAppIni(); } +PageManager::~PageManager() +{ + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } +} + int PageManager::getPageNum(const int &appNum) { int pageNum = 0; diff --git a/src/BackProcess/tablet/pagemanager.h b/src/BackProcess/tablet/pagemanager.h index 729b369..a57edfa 100755 --- a/src/BackProcess/tablet/pagemanager.h +++ b/src/BackProcess/tablet/pagemanager.h @@ -27,6 +27,7 @@ class PageManager : public QObject Q_OBJECT public: PageManager(); + ~PageManager(); int getPageNum(const int &appNum); QVector sortAppInPage(const QVector &appVector); diff --git a/src/UserInterface/ListView/fulllistview.cpp b/src/UserInterface/ListView/fulllistview.cpp index 17124b8..f55cd19 100755 --- a/src/UserInterface/ListView/fulllistview.cpp +++ b/src/UserInterface/ListView/fulllistview.cpp @@ -30,13 +30,25 @@ FullListView::FullListView(QWidget *parent, int module): initWidget(); m_delegate = new FullItemDelegate(this, module); this->setItemDelegate(m_delegate); - pUkuiMenuInterface = new UkuiMenuInterface; + m_ukuiMenuInterface = new UkuiMenuInterface; } FullListView::~FullListView() { - delete menu; - delete gsetting; + if (m_rightMenu) { + 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() diff --git a/src/UserInterface/ListView/fulllistview.h b/src/UserInterface/ListView/fulllistview.h index 93c06b2..12ed615 100755 --- a/src/UserInterface/ListView/fulllistview.h +++ b/src/UserInterface/ListView/fulllistview.h @@ -42,9 +42,9 @@ protected: void keyPressEvent(QKeyEvent *e); private: - RightClickMenu *menu = nullptr;//右键菜单 - QStringList data; - QGSettings *gsetting = nullptr; + RightClickMenu *m_rightMenu = nullptr;//右键菜单 + QStringList m_data; + QGSettings *m_gsetting = nullptr; public Q_SLOTS: void selectFirstItem(); diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index a6cf3dc..585eb9e 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -30,37 +30,43 @@ KListView::KListView(QWidget *parent): KListView::~KListView() { - delete m_delegate; - delete listmodel; - delete pUkuiMenuInterface; + if (m_delegate) { + delete m_delegate; + m_delegate = nullptr; + } + + if (m_listmodel) { + delete m_listmodel; + m_listmodel = nullptr; + } } void KListView::addData(QStringList data) { - listmodel = new QStandardItemModel(this); - this->setModel(listmodel); + m_listmodel = new QStandardItemModel(this); + this->setModel(m_listmodel); Q_FOREACH(QString desktopfp, data) { QStandardItem *item = new QStandardItem; item->setData(QVariant::fromValue(desktopfp), Qt::DisplayRole); - listmodel->appendRow(item); + m_listmodel->appendRow(item); } } void KListView::updateData(QStringList data) { - listmodel->clear(); + m_listmodel->clear(); Q_FOREACH(QString desktopfp, data) { QStandardItem *item = new QStandardItem; item->setData(QVariant::fromValue(desktopfp), Qt::DisplayRole); - listmodel->appendRow(item); + m_listmodel->appendRow(item); } } void KListView::onClicked(QModelIndex index) { - QVariant var = listmodel->data(index, Qt::DisplayRole); + QVariant var = m_listmodel->data(index, Qt::DisplayRole); if (var.isValid()) { QString desktopfp = var.value(); Q_EMIT sendHideMainWindowSignal(); @@ -88,7 +94,7 @@ void KListView::mouseMoveEvent(QMouseEvent *e) void KListView::mousePressEvent(QMouseEvent *event) { 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); } @@ -111,7 +117,7 @@ void KListView::rightClickedSlot(const QPoint &pos) return; } - QVariant var = listmodel->data(index, Qt::DisplayRole); + QVariant var = m_listmodel->data(index, Qt::DisplayRole); QStringList strlist = var.value(); if (strlist.count() == 1 || ((strlist.count() == 2) && (strlist.at(1).toInt() == 1))) { diff --git a/src/UserInterface/ListView/klistview.h b/src/UserInterface/ListView/klistview.h index 9e4dbbb..f7e4cc5 100755 --- a/src/UserInterface/ListView/klistview.h +++ b/src/UserInterface/ListView/klistview.h @@ -33,11 +33,11 @@ public: void initWidget(); KItemDelegate *m_delegate = nullptr; - QStandardItemModel *listmodel = nullptr; + QStandardItemModel *m_listmodel = nullptr; int module = 0; - double transparency; - QVariant pressApp; - UkuiMenuInterface *pUkuiMenuInterface = nullptr; + double m_transparency; + QVariant m_pressApp; + UkuiMenuInterface *m_ukuiMenuInterface = nullptr; protected: void paintEvent(QPaintEvent *e); void mousePressEvent(QMouseEvent *event); diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index e688092..de3b5a7 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -30,15 +30,18 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/): this->h = 540; this->module = 1; initWidget(); - listmodel = new QStandardItemModel(this); - this->setModel(listmodel); - pUkuiMenuInterface = new UkuiMenuInterface; + m_listmodel = new QStandardItemModel(this); + this->setModel(m_listmodel); + m_ukuiMenuInterface = new UkuiMenuInterface; this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); } ListView::~ListView() { - delete pUkuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void ListView::initWidget() @@ -70,12 +73,12 @@ void ListView::initWidget() void ListView::addData(QVector data, int module) { this->module = module; - listmodel->clear(); + m_listmodel->clear(); Q_FOREACH(QStringList desktopfp, data) { QStandardItem *item = new QStandardItem; item->setData(QVariant::fromValue(desktopfp), Qt::DisplayRole); - listmodel->appendRow(item); + m_listmodel->appendRow(item); } m_delegate = new ItemDelegate(this, module); @@ -84,18 +87,18 @@ void ListView::addData(QVector data, int module) void ListView::updateData(QVector data) { - listmodel->clear(); + m_listmodel->clear(); Q_FOREACH(QStringList desktopfp, data) { QStandardItem *item = new QStandardItem; item->setData(QVariant::fromValue(desktopfp), Qt::DisplayRole); - listmodel->appendRow(item); + m_listmodel->appendRow(item); } } void ListView::onClicked(QModelIndex index) { - QVariant var = listmodel->data(index, Qt::DisplayRole); + QVariant var = m_listmodel->data(index, Qt::DisplayRole); QString desktopfp = var.value().at(0); if (var.isValid()) { diff --git a/src/UserInterface/ListView/rightlistview.cpp b/src/UserInterface/ListView/rightlistview.cpp index 5a456bb..083deb2 100755 --- a/src/UserInterface/ListView/rightlistview.cpp +++ b/src/UserInterface/ListView/rightlistview.cpp @@ -30,12 +30,16 @@ RightListView::RightListView(QWidget *parent): initWidget(); m_delegate = new RightItemDelegate(this); this->setItemDelegate(m_delegate); - pUkuiMenuInterface = new UkuiMenuInterface; + m_ukuiMenuInterface = new UkuiMenuInterface; } RightListView::~RightListView() { - delete pUkuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } + } void RightListView::initWidget() @@ -69,11 +73,11 @@ void RightListView::dropEvent(QDropEvent *event) m_dropPos = event->pos(); 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(); QFileInfo fileInfo(desktopfp); QString desktopfn = fileInfo.fileName(); - QString dragDesktopfp = pressApp.value(); + QString dragDesktopfp = m_pressApp.value(); QFileInfo dragFileInfo(dragDesktopfp); QString dragDesktopfn = dragFileInfo.fileName(); changeCollectSort(dragDesktopfn, desktopfn); @@ -129,7 +133,7 @@ void RightListView::keyPressEvent(QKeyEvent *e) void RightListView::onClicked(QModelIndex index) { - QVariant var = listmodel->data(index, Qt::DisplayRole); + QVariant var = m_listmodel->data(index, Qt::DisplayRole); QString desktopfp = var.value().at(0); if (var.isValid()) { QString desktopfp = var.value(); diff --git a/src/UserInterface/ListView/tabletlistview.cpp b/src/UserInterface/ListView/tabletlistview.cpp index 36e1c83..8cfa872 100755 --- a/src/UserInterface/ListView/tabletlistview.cpp +++ b/src/UserInterface/ListView/tabletlistview.cpp @@ -362,6 +362,7 @@ void TabletListView::mousePressEvent(QMouseEvent *event) void TabletListView::mouseMoveEvent(QMouseEvent *event) { + myDebug(); if (event->buttons() & Qt::LeftButton & this->indexAt(event->pos()).isValid()) { if (iconClick) { if ((event->pos() - startPos).manhattanLength() >= QApplication::startDragDistance()) { @@ -429,12 +430,14 @@ void TabletListView::dragMoveEvent(QDragMoveEvent *event) void TabletListView::dragEnterEvent(QDragEnterEvent *event) { + myDebug(); iconClick = true; event->accept(); } void TabletListView::dropEvent(QDropEvent *event) { + myDebug(); dropPos = event->pos(); pressDesktopfp = (QString)event->mimeData()->data("INFO"); insertApplication(startPos, dropPos); @@ -442,6 +445,7 @@ void TabletListView::dropEvent(QDropEvent *event) } void TabletListView::mouseReleaseEvent(QMouseEvent *e) { + myDebug(); releasepos = e->pos();//释放的位置坐标 if (iconClick) { diff --git a/src/UserInterface/Other/rotationlabel.cpp b/src/UserInterface/Other/rotationlabel.cpp index d30ced6..8c2625a 100644 --- a/src/UserInterface/Other/rotationlabel.cpp +++ b/src/UserInterface/Other/rotationlabel.cpp @@ -19,6 +19,7 @@ #include "rotationlabel.h" #include #include +#include "utility.h" RotationLabel::RotationLabel(QWidget *parent) : QLabel(parent) @@ -50,6 +51,11 @@ void RotationLabel::paintEvent(QPaintEvent *event) return QLabel::paintEvent(event); } +void RotationLabel::mouseReleaseEvent(QMouseEvent *ev) +{ + Q_UNUSED(ev); +} + void RotationLabel::setIcon(const QPixmap &pixmap) { m_pixmap = pixmap; diff --git a/src/UserInterface/Other/rotationlabel.h b/src/UserInterface/Other/rotationlabel.h index 81d3ca6..b8a67b5 100644 --- a/src/UserInterface/Other/rotationlabel.h +++ b/src/UserInterface/Other/rotationlabel.h @@ -31,6 +31,7 @@ protected: int rotation(); void setRotation(int rot); void paintEvent(QPaintEvent *event); + void mouseReleaseEvent(QMouseEvent *ev); private: int m_rotation = 0; QPixmap m_pixmap; diff --git a/src/UserInterface/RightClickMenu/rightclickmenu.cpp b/src/UserInterface/RightClickMenu/rightclickmenu.cpp index 69b30f6..ef36c85 100755 --- a/src/UserInterface/RightClickMenu/rightclickmenu.cpp +++ b/src/UserInterface/RightClickMenu/rightclickmenu.cpp @@ -47,8 +47,15 @@ RightClickMenu::RightClickMenu(QWidget *parent): RightClickMenu::~RightClickMenu() { - delete m_cmdProc; - delete m_ukuiMenuInterface; + if (m_cmdProc) { + delete m_cmdProc; + m_cmdProc = nullptr; + } + + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } QPixmap RightClickMenu::getIconPixmap(QString iconstr, int type) @@ -127,7 +134,7 @@ bool RightClickMenu::canSwitch() return false; } else { QDBusReply 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"); - if (reply.isValid() && reply.value() == true) { + if (reply.isValid() && reply.value()) { m_showShutMenu.addAction(QIcon(getIconPixmap("kylin-sleep-symbolic", 1)), tr("Hibernate"), this, SLOT(hibernateActionTriggerSlot())); } 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"), this, SLOT(sleepActionTriggerSlot())); } @@ -323,21 +330,21 @@ int RightClickMenu::showShutdownMenu(const QPoint &pos, const bool &isFullWind) this, SLOT(lockScreenActionTriggerSlot())); 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"), this, SLOT(logoutActionTriggerSlot())); } 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"), this, SLOT(rebootActionTriggerSlot())); } 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"), this, SLOT(shutdownActionTriggerSlot())); } diff --git a/src/UserInterface/ViewItem/full_item_delegate.cpp b/src/UserInterface/ViewItem/full_item_delegate.cpp index 5e5c358..b2cfaa8 100755 --- a/src/UserInterface/ViewItem/full_item_delegate.cpp +++ b/src/UserInterface/ViewItem/full_item_delegate.cpp @@ -24,12 +24,15 @@ FullItemDelegate::FullItemDelegate(QObject *parent, int module): KItemDelegate(parent) { this->module = module; - pUkuiMenuInterface = new UkuiMenuInterface; + m_ukuiMenuInterface = new UkuiMenuInterface; } 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 @@ -69,7 +72,7 @@ void FullItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti painter->save(); painter->setOpacity(1); QString desktopfp = index.data(Qt::DisplayRole).value(); - QString iconstr = pUkuiMenuInterface->getAppIcon(desktopfp); + QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfp); QIcon icon; 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 textRect; iconRect = QRect(rect.x() + (rect.width() - Style::AppListIconSize) / 2, diff --git a/src/UserInterface/ViewItem/itemdelegate.cpp b/src/UserInterface/ViewItem/itemdelegate.cpp index 7effecd..f68fb9a 100755 --- a/src/UserInterface/ViewItem/itemdelegate.cpp +++ b/src/UserInterface/ViewItem/itemdelegate.cpp @@ -26,12 +26,15 @@ ItemDelegate::ItemDelegate(QObject *parent, int module): KItemDelegate(parent) { this->module = module; - pUkuiMenuInterface = new UkuiMenuInterface; + m_ukuiMenuInterface = new UkuiMenuInterface; } 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 @@ -86,7 +89,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, if (module > 0) { if (strlist.at(1).toInt() == 1) { 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; QFileInfo iconFileInfo(iconstr); @@ -130,7 +133,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->save(); 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(); QString appnameElidedText = fm.elidedText(appname, Qt::ElideRight, rect.width() - 62, Qt::TextShowMnemonic); painter->drawText(QRect(iconRect.right() + 15, rect.y(), @@ -253,7 +256,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, } } else { 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; QFileInfo iconFileInfo(iconstr); @@ -296,7 +299,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, } 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)); QString desktopfn = fileInfo.fileName(); diff --git a/src/UserInterface/ViewItem/kitemdelegate.cpp b/src/UserInterface/ViewItem/kitemdelegate.cpp index 3b18f3e..f89a938 100755 --- a/src/UserInterface/ViewItem/kitemdelegate.cpp +++ b/src/UserInterface/ViewItem/kitemdelegate.cpp @@ -22,3 +22,7 @@ KItemDelegate::KItemDelegate(QObject *parent): QStyledItemDelegate(parent) { } + +KItemDelegate::~KItemDelegate() +{ +} diff --git a/src/UserInterface/ViewItem/kitemdelegate.h b/src/UserInterface/ViewItem/kitemdelegate.h index d5a43af..53c731e 100755 --- a/src/UserInterface/ViewItem/kitemdelegate.h +++ b/src/UserInterface/ViewItem/kitemdelegate.h @@ -26,9 +26,10 @@ class KItemDelegate : public QStyledItemDelegate Q_OBJECT public: KItemDelegate(QObject *parent); + ~KItemDelegate(); int module = 0; - UkuiMenuInterface *pUkuiMenuInterface = nullptr; + UkuiMenuInterface *m_ukuiMenuInterface = nullptr; }; #endif // KITEMDELEGATE_H diff --git a/src/UserInterface/ViewItem/recent_item_delegate.cpp b/src/UserInterface/ViewItem/recent_item_delegate.cpp index 61c5bdc..5f2082a 100755 --- a/src/UserInterface/ViewItem/recent_item_delegate.cpp +++ b/src/UserInterface/ViewItem/recent_item_delegate.cpp @@ -18,19 +18,22 @@ #include "recent_item_delegate.h" -recentitemdelegate::recentitemdelegate(QObject *parent, int module): +RecentItemDelegate::RecentItemDelegate(QObject *parent, int module): KItemDelegate(parent) { 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()) { // QStyleOptionViewItem viewOption(option);//用来在视图中画一个item @@ -148,7 +151,7 @@ void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &op } } else { 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; QFileInfo iconFileInfo(iconstr); @@ -191,7 +194,7 @@ void recentitemdelegate::paint(QPainter *painter, const QStyleOptionViewItem &op } 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)); 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(); // if(strlist.at(1).toInt()==1) diff --git a/src/UserInterface/ViewItem/recent_item_delegate.h b/src/UserInterface/ViewItem/recent_item_delegate.h index 52125ce..aa0d672 100755 --- a/src/UserInterface/ViewItem/recent_item_delegate.h +++ b/src/UserInterface/ViewItem/recent_item_delegate.h @@ -26,15 +26,15 @@ #include "src/UtilityFunction/utility.h" #include "kitemdelegate.h" -class recentitemdelegate : public KItemDelegate +class RecentItemDelegate : public KItemDelegate { Q_OBJECT public: /** * @param module为0时为常用模块,1为字母模块、2为功能模块、3为搜索模块 */ - recentitemdelegate(QObject *parent, int module); - ~recentitemdelegate(); + RecentItemDelegate(QObject *parent, int module); + ~RecentItemDelegate(); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; }; diff --git a/src/UserInterface/ViewItem/right_item_delegate.cpp b/src/UserInterface/ViewItem/right_item_delegate.cpp index 96b7fb7..03e173f 100755 --- a/src/UserInterface/ViewItem/right_item_delegate.cpp +++ b/src/UserInterface/ViewItem/right_item_delegate.cpp @@ -23,12 +23,15 @@ RightItemDelegate::RightItemDelegate(QObject *parent): KItemDelegate(parent) { - pUkuiMenuInterface = new UkuiMenuInterface; + m_ukuiMenuInterface = new UkuiMenuInterface; } 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 @@ -83,7 +86,7 @@ void RightItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt painter->save(); painter->setOpacity(1); QString desktopfp = index.data(Qt::DisplayRole).value(); - QString iconstr = pUkuiMenuInterface->getAppIcon(desktopfp); + QString iconstr = m_ukuiMenuInterface->getAppIcon(desktopfp); QIcon icon; 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 textRect; iconRect = QRect(rect.x() + 28, diff --git a/src/UserInterface/Widget/full_commonuse_widget.cpp b/src/UserInterface/Widget/full_commonuse_widget.cpp index 53ad54f..463c8b4 100755 --- a/src/UserInterface/Widget/full_commonuse_widget.cpp +++ b/src/UserInterface/Widget/full_commonuse_widget.cpp @@ -31,7 +31,10 @@ FullCommonUseWidget::FullCommonUseWidget(QWidget *parent) : FullCommonUseWidget::~FullCommonUseWidget() { - delete m_ukuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void FullCommonUseWidget::initUi() diff --git a/src/UserInterface/Widget/full_function_widget.cpp b/src/UserInterface/Widget/full_function_widget.cpp index 1867b5e..4d08983 100755 --- a/src/UserInterface/Widget/full_function_widget.cpp +++ b/src/UserInterface/Widget/full_function_widget.cpp @@ -32,7 +32,10 @@ FullFunctionWidget::FullFunctionWidget(QWidget *parent) : FullFunctionWidget::~FullFunctionWidget() { - delete m_ukuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void FullFunctionWidget::initUi() diff --git a/src/UserInterface/Widget/full_letter_widget.cpp b/src/UserInterface/Widget/full_letter_widget.cpp index e0b0a9e..5eeea36 100755 --- a/src/UserInterface/Widget/full_letter_widget.cpp +++ b/src/UserInterface/Widget/full_letter_widget.cpp @@ -28,8 +28,14 @@ FullLetterWidget::FullLetterWidget(QWidget *parent) : FullLetterWidget::~FullLetterWidget() { - delete m_ukuiMenuInterface; - delete m_letterListBottomSpacer; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } + if (m_letterListBottomSpacer) { + delete m_letterListBottomSpacer; + m_letterListBottomSpacer = nullptr; + } } /** diff --git a/src/UserInterface/Widget/full_searchresult_widget.cpp b/src/UserInterface/Widget/full_searchresult_widget.cpp index 4a7b813..3cd5d2e 100755 --- a/src/UserInterface/Widget/full_searchresult_widget.cpp +++ b/src/UserInterface/Widget/full_searchresult_widget.cpp @@ -29,7 +29,10 @@ FullSearchResultWidget::FullSearchResultWidget(QWidget *parent) : FullSearchResultWidget::~FullSearchResultWidget() { - delete m_ukuiMenuInterface; + if (m_ukuiMenuInterface) { + delete m_ukuiMenuInterface; + m_ukuiMenuInterface = nullptr; + } } void FullSearchResultWidget::initUi() diff --git a/src/UserInterface/Widget/function_Widget.cpp b/src/UserInterface/Widget/function_Widget.cpp index d7f2746..827323e 100755 --- a/src/UserInterface/Widget/function_Widget.cpp +++ b/src/UserInterface/Widget/function_Widget.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include "currenttime_interface.h" #include "style.h" @@ -228,7 +227,7 @@ void FunctionWidget::initUi() } mainLayout->addWidget(searchEditBtn); - focusPlug = new pluginwidget(this); + focusPlug = new PluginWidget(this); mainLayout->addWidget(focusPlug); focusPlug->setFixedSize(400, 638); mainLayout->addStretch(); diff --git a/src/UserInterface/Widget/function_Widget.h b/src/UserInterface/Widget/function_Widget.h index 0c289a2..d2b8047 100755 --- a/src/UserInterface/Widget/function_Widget.h +++ b/src/UserInterface/Widget/function_Widget.h @@ -29,7 +29,6 @@ #include #include #include -#include "AbstractInterface.h" #include #include "plugin_widget.h" #include "currenttime_interface.h" @@ -41,7 +40,7 @@ public: FunctionWidget(QWidget *parent); ~FunctionWidget(); //QWidget* focusPlug=nullptr; - pluginwidget *focusPlug = nullptr; + PluginWidget *focusPlug = nullptr; void setDownOpacityEffect(const qreal &num); protected: diff --git a/src/UserInterface/Widget/plugin_widget.cpp b/src/UserInterface/Widget/plugin_widget.cpp index cfb6fd3..b982e59 100755 --- a/src/UserInterface/Widget/plugin_widget.cpp +++ b/src/UserInterface/Widget/plugin_widget.cpp @@ -19,14 +19,14 @@ #include "plugin_widget.h" #include "KySmallPluginInterface.h" #include -pluginwidget::pluginwidget(QWidget *parent) : QWidget(parent) +PluginWidget::PluginWidget(QWidget *parent) : QWidget(parent) { this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setAttribute(Qt::WA_StyledBackground, true); this->setFocusPolicy(Qt::NoFocus); init(); } -void pluginwidget::init() +void PluginWidget::init() { QPluginLoader loader("/opt/small-plugin/bin/libsmall-plugin-manage.so"); QObject *plugin = loader.instance(); diff --git a/src/UserInterface/Widget/plugin_widget.h b/src/UserInterface/Widget/plugin_widget.h index 325da2d..aaf71a4 100755 --- a/src/UserInterface/Widget/plugin_widget.h +++ b/src/UserInterface/Widget/plugin_widget.h @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include #include #include @@ -35,11 +33,11 @@ #include #include #include -class pluginwidget : public QWidget +class PluginWidget : public QWidget { Q_OBJECT public: - explicit pluginwidget(QWidget *parent = nullptr); + explicit PluginWidget(QWidget *parent = nullptr); void init(); }; diff --git a/src/UserInterface/Widget/tabview_widget.cpp b/src/UserInterface/Widget/tabview_widget.cpp deleted file mode 100755 index 7189cfe..0000000 --- a/src/UserInterface/Widget/tabview_widget.cpp +++ /dev/null @@ -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 - -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); -} - diff --git a/src/UserInterface/Widget/tabview_widget.h b/src/UserInterface/Widget/tabview_widget.h deleted file mode 100755 index d390923..0000000 --- a/src/UserInterface/Widget/tabview_widget.h +++ /dev/null @@ -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 -#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 diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 89a0e24..13304fd 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -770,7 +770,7 @@ void MainWindow::minAnimationFinished() // m_collectPushButton->clicked(true); on_collectPushButton_clicked(); - QTimer::singleShot(200, [=]() { + QTimer::singleShot(200, [ = ]() { m_animationPage->hide(); }); } @@ -790,7 +790,7 @@ void MainWindow::maxAnimationFinished() setMaxWindowPos(); m_fullWindow->activateWindow(); - QTimer::singleShot(200, [=]() { + QTimer::singleShot(200, [ = ]() { m_animationPage->hide(); }); } diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 4ae6622..91f7b40 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -38,7 +38,6 @@ #include "convert_winid_to_desktop.h" #include "style.h" #include "main_view_widget.h" -#include "tabview_widget.h" #include "dbus.h" #include "dbus-adaptor.h" #include "software_database_update_thread.h" @@ -54,6 +53,7 @@ #include "letter_button_widget.h" #include "animationpage.h" #include "rotationlabel.h" +#include "rightlistview.h" #include "ukuistylehelper/ukuistylehelper.h" #include "windowmanager/windowmanager.h" diff --git a/src/UserInterface/userinterface.pri b/src/UserInterface/userinterface.pri index 56b58f8..00b893b 100755 --- a/src/UserInterface/userinterface.pri +++ b/src/UserInterface/userinterface.pri @@ -40,7 +40,6 @@ HEADERS += \ $$PWD/Widget/main_view_widget.h \ $$PWD/Widget/plugin_widget.h \ $$PWD/Widget/splitbar_frame.h \ - $$PWD/Widget/tabview_widget.h \ $$PWD/full_mainwindow.h \ $$PWD/mainwindow.h \ $$PWD/tabletwindow.h @@ -78,7 +77,6 @@ SOURCES += \ $$PWD/Widget/main_view_widget.cpp \ $$PWD/Widget/plugin_widget.cpp \ $$PWD/Widget/splitbar_frame.cpp \ - $$PWD/Widget/tabview_widget.cpp \ $$PWD/full_mainwindow.cpp \ $$PWD/mainwindow.cpp \ $$PWD/tabletwindow.cpp diff --git a/src/UtilityFunction/AbstractInterface.h b/src/UtilityFunction/AbstractInterface.h deleted file mode 100755 index 915c223..0000000 --- a/src/UtilityFunction/AbstractInterface.h +++ /dev/null @@ -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 -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 diff --git a/src/UtilityFunction/abstractInterface.h b/src/UtilityFunction/abstractInterface.h deleted file mode 100755 index 24a10b8..0000000 --- a/src/UtilityFunction/abstractInterface.h +++ /dev/null @@ -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 -#include -#include -#include - -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 \ No newline at end of file diff --git a/src/UtilityFunction/thumbnail.cpp b/src/UtilityFunction/thumbnail.cpp index 0bf1dbd..ed6905a 100755 --- a/src/UtilityFunction/thumbnail.cpp +++ b/src/UtilityFunction/thumbnail.cpp @@ -237,19 +237,13 @@ bool ThumbNail::appDisable(QString desktopfp)//判断是否是禁用应用(这 char *name = g_key_file_get_locale_string(keyfile, "Desktop Entry", "Exec", nullptr, nullptr); //取出value值 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); - QString desktopfp1 =/*"application/"+*/str; //QString group=desktopfp.split('/').last(); disableSetting->beginGroup("application"); //判断 - bool bo = disableSetting->contains(desktopfp1.toLocal8Bit().data()); // iskey - bool bo1 = disableSetting->QSettings::value(desktopfp1.toLocal8Bit().data()).toBool(); //isvalue + bool bo = disableSetting->contains(execnamestr.toLocal8Bit().data()); // iskey + bool bo1 = disableSetting->QSettings::value(execnamestr.toLocal8Bit().data()).toBool(); //isvalue disableSetting->endGroup(); //qDebug()<