feat(settings): Correct spelling of 'folder' & add deleting folder method.

Description: 更正文件夹单词的拼写并添加设置列表删除功能

Log: 更正文件夹单词的拼写并添加设置列表删除功能
This commit is contained in:
zhangjiaping 2020-12-31 09:09:13 +08:00
parent d33ea025a4
commit c2d678492c
9 changed files with 155 additions and 120 deletions

View File

@ -1 +1,7 @@
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/app-match.h \
SOURCES += \
$$PWD/app-match.cpp \

View File

@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/config-file.h \
$$PWD/floder-list-item.h \
$$PWD/folder-list-item.h \
$$PWD/search-list-view.h \
$$PWD/search-detail-view.h \
$$PWD/option-view.h \
@ -10,7 +10,7 @@ HEADERS += \
SOURCES += \
$$PWD/config-file.cpp \
$$PWD/floder-list-item.cpp \
$$PWD/folder-list-item.cpp \
$$PWD/search-list-view.cpp \
$$PWD/search-detail-view.cpp \
$$PWD/option-view.cpp \

View File

@ -1,22 +1,22 @@
#include "floder-list-item.h"
#include "folder-list-item.h"
#include <QIcon>
#include <QEvent>
FloderListItem::FloderListItem(QWidget *parent, const QString &path) : QWidget(parent)
FolderListItem::FolderListItem(QWidget *parent, const QString &path) : QWidget(parent)
{
m_path = path;
initUi();
}
FloderListItem::~FloderListItem()
FolderListItem::~FolderListItem()
{
}
/**
* @brief FloderListItem::initUi ui
* @brief FolderListItem::initUi ui
*/
void FloderListItem::initUi() {
void FolderListItem::initUi() {
m_layout = new QVBoxLayout(this);
m_layout->setSpacing(0);
m_layout->setContentsMargins(0,0,0,0);
@ -33,7 +33,7 @@ void FloderListItem::initUi() {
m_delLabel = new QLabel(m_widget);
m_iconLabel->setPixmap(QIcon::fromTheme("inode-directory").pixmap(QSize(16, 16)));
m_pathLabel->setText(m_path);
m_delLabel->setText(tr("Delete the floder out of blacklist"));
m_delLabel->setText(tr("Delete the folder out of blacklist"));
m_pathLabel->setStyleSheet("QLabel{color: palette(text); background: transparent;}");
m_delLabel->setStyleSheet("QLabel{color: #3790FA; background: transparent;}");
m_delLabel->setCursor(QCursor(Qt::PointingHandCursor));
@ -46,20 +46,28 @@ void FloderListItem::initUi() {
}
/**
* @brief FloderListItem::enterEvent
* @brief FolderListItem::getPath
* @return
*/
QString FolderListItem::getPath() {
return m_path;
}
/**
* @brief FolderListItem::enterEvent
* @param event
*/
void FloderListItem::enterEvent(QEvent *event){
void FolderListItem::enterEvent(QEvent *event){
m_delLabel->show();
m_widget->setStyleSheet("QWidget#mWidget{background: rgba(0,0,0,0.1);}");
QWidget::enterEvent(event);
}
/**
* @brief FloderListItem::leaveEvent
* @brief FolderListItem::leaveEvent
* @param event
*/
void FloderListItem::leaveEvent(QEvent *event){
void FolderListItem::leaveEvent(QEvent *event){
m_delLabel->hide();
m_widget->setStyleSheet("QWidget#mWidget{background: transparent;}");
QWidget::leaveEvent(event);
@ -67,15 +75,16 @@ void FloderListItem::leaveEvent(QEvent *event){
/**
* @brief FloderListItem::eventFilter
* @brief FolderListItem::eventFilter
* @param watched
* @param event
* @return
*/
bool FloderListItem::eventFilter(QObject *watched, QEvent *event){
bool FolderListItem::eventFilter(QObject *watched, QEvent *event){
if (watched == m_delLabel) {
if (event->type() == QEvent::MouseButtonPress) {
// qDebug()<<"pressed!";
Q_EMIT this->onDelBtnClicked(m_path);
}
}
return QObject::eventFilter(watched, event);

View File

@ -1,21 +1,22 @@
#ifndef FLODERLISTITEM_H
#define FLODERLISTITEM_H
#ifndef FOLDERLISTITEM_H
#define FOLDERLISTITEM_H
#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
class FloderListItem : public QWidget
class FolderListItem : public QWidget
{
Q_OBJECT
public:
explicit FloderListItem(QWidget *parent = nullptr, const QString &path = 0);
~FloderListItem();
explicit FolderListItem(QWidget *parent = nullptr, const QString &path = 0);
~FolderListItem();
QString getPath();
protected:
virtual void enterEvent(QEvent * event);
virtual void leaveEvent(QEvent * event);
virtual void enterEvent(QEvent *);
virtual void leaveEvent(QEvent *);
bool eventFilter(QObject *, QEvent *);
private:
@ -30,6 +31,7 @@ private:
QLabel * m_pathLabel = nullptr;
QLabel * m_delLabel = nullptr;
Q_SIGNALS:
void onDelBtnClicked(const QString&);
};
#endif // FLODERLISTITEM_H
#endif // FOLDERLISTITEM_H

View File

@ -4,63 +4,63 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="80"/>
<location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="99"/>
<location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="104"/>
<location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="212"/>
<location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="214"/>
<location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="216"/>
<location filename="../../content-widget.cpp" line="216"/>
<source>Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="218"/>
<location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="220"/>
<location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="222"/>
<location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FloderListItem</name>
<name>FolderListItem</name>
<message>
<location filename="../../control/floder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source>
<location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../../src/mainwindow.cpp" line="125"/>
<location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -96,7 +96,7 @@
<context>
<name>QObject</name>
<message>
<location filename="../../src/main.cpp" line="71"/>
<location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source>
<translation type="unfinished"></translation>
</message>
@ -127,88 +127,88 @@
<context>
<name>SettingsWidget</name>
<message>
<location filename="../../src/settings-widget.cpp" line="49"/>
<location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="66"/>
<location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="72"/>
<location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/>
<location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../settings-widget.cpp" line="77"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="84"/>
<location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="87"/>
<location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="96"/>
<location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="117"/>
<location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="120"/>
<location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="133"/>
<location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="135"/>
<location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="137"/>
<location filename="../../settings-widget.cpp" line="137"/>
<source>360</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="160"/>
<location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="164"/>
<location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="194"/>
<location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="197"/>
<location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="205"/>
<location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,63 +4,63 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="80"/>
<location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="99"/>
<location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="104"/>
<location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="212"/>
<location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="214"/>
<location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="216"/>
<location filename="../../content-widget.cpp" line="216"/>
<source>Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="218"/>
<location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="220"/>
<location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="222"/>
<location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FloderListItem</name>
<name>FolderListItem</name>
<message>
<location filename="../../control/floder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source>
<location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../../src/mainwindow.cpp" line="125"/>
<location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -96,7 +96,7 @@
<context>
<name>QObject</name>
<message>
<location filename="../../src/main.cpp" line="71"/>
<location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source>
<translation type="unfinished"></translation>
</message>
@ -127,88 +127,88 @@
<context>
<name>SettingsWidget</name>
<message>
<location filename="../../src/settings-widget.cpp" line="49"/>
<location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="66"/>
<location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="72"/>
<location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/>
<location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../settings-widget.cpp" line="77"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="84"/>
<location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="87"/>
<location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="96"/>
<location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="117"/>
<location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="120"/>
<location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="133"/>
<location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="135"/>
<location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="137"/>
<location filename="../../settings-widget.cpp" line="137"/>
<source>360</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="160"/>
<location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="164"/>
<location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="194"/>
<location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="197"/>
<location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="205"/>
<location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source>
<translation type="unfinished"></translation>
</message>

View File

@ -4,63 +4,63 @@
<context>
<name>ContentWidget</name>
<message>
<location filename="../../src/content-widget.cpp" line="80"/>
<location filename="../../content-widget.cpp" line="80"/>
<source>Recently Opened</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="99"/>
<location filename="../../content-widget.cpp" line="99"/>
<source>Open Quickly</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="104"/>
<location filename="../../content-widget.cpp" line="104"/>
<source>Commonly Used</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="212"/>
<location filename="../../content-widget.cpp" line="212"/>
<source>Apps</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="214"/>
<location filename="../../content-widget.cpp" line="214"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="216"/>
<location filename="../../content-widget.cpp" line="216"/>
<source>Files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="218"/>
<location filename="../../content-widget.cpp" line="218"/>
<source>Dirs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="220"/>
<location filename="../../content-widget.cpp" line="220"/>
<source>Best Matches</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/content-widget.cpp" line="222"/>
<location filename="../../content-widget.cpp" line="222"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FloderListItem</name>
<name>FolderListItem</name>
<message>
<location filename="../../control/floder-list-item.cpp" line="36"/>
<source>Delete the floder out of blacklist</source>
<location filename="../../control/folder-list-item.cpp" line="36"/>
<source>Delete the folder out of blacklist</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<location filename="../../src/mainwindow.cpp" line="125"/>
<location filename="../../mainwindow.cpp" line="119"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
@ -96,7 +96,7 @@
<context>
<name>QObject</name>
<message>
<location filename="../../src/main.cpp" line="71"/>
<location filename="../../main.cpp" line="71"/>
<source>ukui-search is already running!</source>
<translation type="unfinished"></translation>
</message>
@ -127,88 +127,88 @@
<context>
<name>SettingsWidget</name>
<message>
<location filename="../../src/settings-widget.cpp" line="49"/>
<location filename="../../settings-widget.cpp" line="49"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="66"/>
<location filename="../../settings-widget.cpp" line="66"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="72"/>
<location filename="../../settings-widget.cpp" line="72"/>
<source>Index State</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="75"/>
<location filename="../../src/settings-widget.cpp" line="77"/>
<location filename="../../settings-widget.cpp" line="75"/>
<location filename="../../settings-widget.cpp" line="77"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="84"/>
<location filename="../../settings-widget.cpp" line="84"/>
<source>File Index Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="87"/>
<location filename="../../settings-widget.cpp" line="87"/>
<source>Following folders will not be searched. You can set it by adding and removing folders.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="96"/>
<location filename="../../settings-widget.cpp" line="96"/>
<source>Add ignored folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="117"/>
<location filename="../../settings-widget.cpp" line="117"/>
<source>Search Engine Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="120"/>
<location filename="../../settings-widget.cpp" line="120"/>
<source>Please select search engine you preferred.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="133"/>
<location filename="../../settings-widget.cpp" line="133"/>
<source>baidu</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="135"/>
<location filename="../../settings-widget.cpp" line="135"/>
<source>sougou</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="137"/>
<location filename="../../settings-widget.cpp" line="137"/>
<source>360</source>
<translation type="unfinished">360</translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="160"/>
<location filename="../../settings-widget.cpp" line="160"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="164"/>
<location filename="../../settings-widget.cpp" line="164"/>
<source>Confirm</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="194"/>
<location filename="../../settings-widget.cpp" line="194"/>
<source>Creating ...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="197"/>
<location filename="../../settings-widget.cpp" line="197"/>
<source>Done</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/settings-widget.cpp" line="205"/>
<location filename="../../settings-widget.cpp" line="205"/>
<source>Index Entry: %1</source>
<translation type="unfinished">: %1</translation>
</message>

View File

@ -4,7 +4,7 @@
#include <QFileDialog>
#include <QDir>
#include <QDebug>
#include "floder-list-item.h"
#include "folder-list-item.h"
extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent)
@ -178,13 +178,30 @@ void SettingsWidget::initUi() {
*/
void SettingsWidget::setupBlackList(const QStringList& list) {
Q_FOREACH(QString path, list) {
FloderListItem * item = new FloderListItem(m_dirListWidget, path);
FolderListItem * item = new FolderListItem(m_dirListWidget, path);
m_dirListLyt->addWidget(item);
item->setMaximumWidth(470);
//测试用,实际调用中应等待后端完成操作后删除该控件
connect(item, SIGNAL(onDelBtnClicked(const QString&)), this, SLOT(onBtnDelClicked(const QString&)));
}
m_dirListLyt->addStretch();
}
/**
* @brief SettingsWidget::onBtnDelClicked
* @param path
*/
void SettingsWidget::onBtnDelClicked(const QString& path) {
qDebug()<<path;
Q_FOREACH (FolderListItem * item, m_dirListWidget->findChildren<FolderListItem*>()) {
if (item->getPath() == path) {
item->deleteLater();
item = NULL;
return;
}
}
}
/**
* @brief setIndexState
* @param isCreatingIndex

View File

@ -73,6 +73,7 @@ private Q_SLOTS:
void onBtnConfirmClicked();
void onBtnCancelClicked();
void onBtnAddClicked();
void onBtnDelClicked(const QString&);
};
#endif // SETTINGSWIDGET_H