From b8b51103f2c239ec609edb6ac90df85b40c93561 Mon Sep 17 00:00:00 2001 From: zhangjiaping Date: Wed, 30 Dec 2020 17:23:03 +0800 Subject: [PATCH] feat(settings): Optimize setting widget & add translations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 优化设置界面并添加翻译文件 Log: 优化设置界面并添加翻译文件 --- libsearch/file-utils.cpp | 3 + libsearch/gobject-template.cpp | 1 + libsearch/index/index.pri | 1 - libsearch/settingsearch/setting-match.cpp | 2 +- src/control/control.pri | 2 + src/control/floder-list-item.cpp | 82 ++++ src/control/floder-list-item.h | 35 ++ src/control/home-page-item.cpp | 4 +- src/mainwindow.cpp | 2 +- src/res/search.xml | 567 ---------------------- src/res/translations/bo.ts | 145 +++++- src/res/translations/tr.ts | 145 +++++- src/res/translations/zh_CN.ts | 147 +++++- src/resource.qrc | 1 - src/settings-widget.cpp | 49 +- src/settings-widget.h | 3 + 16 files changed, 586 insertions(+), 603 deletions(-) create mode 100644 src/control/floder-list-item.cpp create mode 100644 src/control/floder-list-item.h delete mode 100644 src/res/search.xml diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index 14fcee8..bbb06c6 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -95,6 +95,9 @@ QIcon FileUtils::getAppIcon(const QString &path) { */ QIcon FileUtils::getSettingIcon(const QString& setting, const bool& is_white) { QString name = setting.left(setting.indexOf("/")); + if (! name.isEmpty()) { + name.replace(QString(name.at(0)), QString(name.at(0).toUpper())); + } QString path; if (is_white) { path = QString("/usr/share/ukui-control-center/shell/res/secondaryleftmenu/%1White.svg").arg(name); diff --git a/libsearch/gobject-template.cpp b/libsearch/gobject-template.cpp index 7b3067d..f1a4ed4 100644 --- a/libsearch/gobject-template.cpp +++ b/libsearch/gobject-template.cpp @@ -1,4 +1,5 @@ #include "gobject-template.h" +#include "glib-object.h" std::shared_ptr> wrapGFile(GFile *file) { return std::make_shared>(file); diff --git a/libsearch/index/index.pri b/libsearch/index/index.pri index d800e45..7e9c0ed 100644 --- a/libsearch/index/index.pri +++ b/libsearch/index/index.pri @@ -11,7 +11,6 @@ HEADERS += \ $$PWD/inotify.h \ $$PWD/messagelist-manager.h \ $$PWD/traverse_bfs.h \ - $$PWD/messagelist-manager.h \ $$PWD/text-content-indexer.h \ $$PWD/file-searcher.h diff --git a/libsearch/settingsearch/setting-match.cpp b/libsearch/settingsearch/setting-match.cpp index 5665765..8801c3a 100644 --- a/libsearch/settingsearch/setting-match.cpp +++ b/libsearch/settingsearch/setting-match.cpp @@ -16,7 +16,7 @@ void SettingsMatch::xmlElement(){ QString pinyinIndex; QString ChineseIndex; - QFile file(QString::fromLocal8Bit(":/res/search.xml")); + QFile file(QString::fromLocal8Bit("/usr/share/ukui-control-center/shell/res/search.xml")); if (!file.open(QIODevice::ReadOnly)){ return; } diff --git a/src/control/control.pri b/src/control/control.pri index ba747d4..a45e52e 100644 --- a/src/control/control.pri +++ b/src/control/control.pri @@ -2,6 +2,7 @@ INCLUDEPATH += $$PWD HEADERS += \ $$PWD/config-file.h \ + $$PWD/floder-list-item.h \ $$PWD/search-list-view.h \ $$PWD/search-detail-view.h \ $$PWD/option-view.h \ @@ -9,6 +10,7 @@ HEADERS += \ SOURCES += \ $$PWD/config-file.cpp \ + $$PWD/floder-list-item.cpp \ $$PWD/search-list-view.cpp \ $$PWD/search-detail-view.cpp \ $$PWD/option-view.cpp \ diff --git a/src/control/floder-list-item.cpp b/src/control/floder-list-item.cpp new file mode 100644 index 0000000..dcffcae --- /dev/null +++ b/src/control/floder-list-item.cpp @@ -0,0 +1,82 @@ +#include "floder-list-item.h" +#include +#include + +FloderListItem::FloderListItem(QWidget *parent, const QString &path) : QWidget(parent) +{ + m_path = path; + initUi(); +} + +FloderListItem::~FloderListItem() +{ + +} + +/** + * @brief FloderListItem::initUi 构建ui + */ +void FloderListItem::initUi() { + m_layout = new QVBoxLayout(this); + m_layout->setSpacing(0); + m_layout->setContentsMargins(0,0,0,0); + m_widget = new QWidget(this); + m_widget->setObjectName("mWidget"); + this->setFixedHeight(32); + m_layout->addWidget(m_widget); + m_widgetlayout = new QHBoxLayout(m_widget); + m_widgetlayout->setContentsMargins(4, 4, 4, 4); + m_widget->setLayout(m_widgetlayout); + + m_iconLabel = new QLabel(m_widget); + m_pathLabel = new QLabel(m_widget); + 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_pathLabel->setStyleSheet("QLabel{color: palette(text); background: transparent;}"); + m_delLabel->setStyleSheet("QLabel{color: #3790FA; background: transparent;}"); + m_delLabel->setCursor(QCursor(Qt::PointingHandCursor)); + m_delLabel->installEventFilter(this); + m_delLabel->hide(); + m_widgetlayout->addWidget(m_iconLabel); + m_widgetlayout->addWidget(m_pathLabel); + m_widgetlayout->addStretch(); + m_widgetlayout->addWidget(m_delLabel); +} + +/** + * @brief FloderListItem::enterEvent 鼠标移入事件 + * @param event + */ +void FloderListItem::enterEvent(QEvent *event){ + m_delLabel->show(); + m_widget->setStyleSheet("QWidget#mWidget{background: rgba(0,0,0,0.1);}"); + QWidget::enterEvent(event); +} + +/** + * @brief FloderListItem::leaveEvent 鼠标移出事件 + * @param event + */ +void FloderListItem::leaveEvent(QEvent *event){ + m_delLabel->hide(); + m_widget->setStyleSheet("QWidget#mWidget{background: transparent;}"); + QWidget::leaveEvent(event); +} + + +/** + * @brief FloderListItem::eventFilter 处理删除按钮点击事件 + * @param watched + * @param event + * @return + */ +bool FloderListItem::eventFilter(QObject *watched, QEvent *event){ + if (watched == m_delLabel) { + if (event->type() == QEvent::MouseButtonPress) { +// qDebug()<<"pressed!"; + } + } + return QObject::eventFilter(watched, event); +} diff --git a/src/control/floder-list-item.h b/src/control/floder-list-item.h new file mode 100644 index 0000000..6bc7c7a --- /dev/null +++ b/src/control/floder-list-item.h @@ -0,0 +1,35 @@ +#ifndef FLODERLISTITEM_H +#define FLODERLISTITEM_H + +#include +#include +#include +#include + +class FloderListItem : public QWidget +{ + Q_OBJECT +public: + explicit FloderListItem(QWidget *parent = nullptr, const QString &path = 0); + ~FloderListItem(); + +protected: + virtual void enterEvent(QEvent * event); + virtual void leaveEvent(QEvent * event); + bool eventFilter(QObject *, QEvent *); + +private: + void initUi(); + + QString m_path; + + QVBoxLayout * m_layout = nullptr; + QWidget * m_widget = nullptr; + QHBoxLayout * m_widgetlayout = nullptr; + QLabel * m_iconLabel = nullptr; + QLabel * m_pathLabel = nullptr; + QLabel * m_delLabel = nullptr; +Q_SIGNALS: +}; + +#endif // FLODERLISTITEM_H diff --git a/src/control/home-page-item.cpp b/src/control/home-page-item.cpp index 79258ed..af5b6cf 100644 --- a/src/control/home-page-item.cpp +++ b/src/control/home-page-item.cpp @@ -65,6 +65,7 @@ void HomePageItem::setupUi(const int& type, const QString& path) { m_namelabel->setText(FileUtils::getAppName(path)); break; } + case SearchListView::ResType::Dir : case SearchListView::ResType::File : { icon = FileUtils::getFileIcon(QString("file://%1").arg(path)); m_namelabel->setText(FileUtils::getFileName(path)); @@ -75,9 +76,6 @@ void HomePageItem::setupUi(const int& type, const QString& path) { m_namelabel->setText(FileUtils::getSettingName(path)); break; } - case SearchListView::ResType::Dir : { - break; - } default : break; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a66fd39..511224c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -173,7 +173,7 @@ void MainWindow::initUi() QStringList list; list<<"/usr/share/applications/peony.desktop"<<"/usr/share/applications/ukui-control-center.desktop"<<"/usr/share/applications/ukui-clock.desktop"<<"/usr/share/applications/wps-office-pdf.desktop"; QStringList list2; - list2<<"/home/zjp/下载/搜索结果.png"<<"/home/zjp/下载/显示不全.mp4"<<"/home/zjp/下载/dmesg.log"<<"/home/zjp/下载/WiFi_AP选择.docx"; + list2< - - guanyu - banben - 关于 - 版本 - - - guanyu - neihe - 关于 - 内核 - - - 关于 - CPU - - - guanyu - neicun - 关于 - 内存 - - - guanyu - yingpan - 关于 - 硬盘 - - - yuyanhediqu - dangqianquyu - 语言和地区 - 当前区域 - - - yuyanhediqu - quyugeshishuju - 语言和地区 - 区域格式数据 - - - yuyanhediqu - shouxuanyuyan - 语言和地区 - 首选语言 - - - kaijiqidong - morenchengxu - 开机启动 - 默认程序 - - - huifuchuchangshezhi - huanyuan - 恢复出厂设置 - 还原 - - - shijianheriqi - tongbuxitongshijian - 时间和日期 - 同步系统时间 - - - shijianheriqi - shoudonggenggaishijian - 时间和日期 - 手动更改时间 - - - shijianheriqi - genggaishiqu - 时间和日期 - 更改时区 - - - shijianheriqi - xiaoshizhi - 时间和日期 - 24小时制 - - - morenyingyong - liulanqi - 默认应用 - 浏览器 - - - morenyingyong - dianziyoujian - 默认应用 - 电子邮件 - - - morenyingyong - tuxiangchakanqi - 默认应用 - 图像查看器 - - - morenyingyong - yinpinbofangqi - 默认应用 - 音频播放器 - - - morenyingyong - shipinbofangqi - 默认应用 - 视频播放器 - - - morenyingyong - wendangbianjiqi - 默认应用 - 文档编辑器 - - - zhuomian - xianshizaizhuomiandetubiao - 桌面 - 显示在桌面的图标 - - - zhuomian - xianshizaituopanshangdetubiao - 桌面 - 显示在托盘上的图标 - - - ziti - zitidaxiao - 字体 - 字体大小 - - - jianpan - qiyonganjianzhongfushezhi - 键盘 - 启用按键重复设置 - - - jianpan - yanchi - 键盘 - 延迟 - - - jianpan - sudu - 键盘 - 速度 - - - jianpan - shuruzifuceshizhongfuxiaoguo: - 键盘 - 输入字符测试重复效果: - - - jianpan - daxiesuodingtishi - 键盘 - 大写锁定提示 - - - jianpan - huifumorenbuju - 键盘 - 恢复默认布局 - - - jianpan - jianpanbuju - 键盘 - 键盘布局 - - - shubiao - guanyongshou - 鼠标 - 惯用手 - - - shubiao - sudu - 鼠标 - 速度 - - - shubiao - shubiaoshuangjijiangeshichang - 鼠标 - 鼠标双击间隔时长 - - - shubiao - mingandu - 鼠标 - 敏感度 - - - shubiao - kejianxing - 鼠标 - 可见性 - - - shubiao - zhizhendaxiao - 鼠标 - 指针大小 - - - shubiao - guangbiaosudu - 鼠标 - 光标速度 - - - shubiao - qiyongwenbenquyudeguangbiaoshanshuo - 鼠标 - 启用文本区域的光标闪烁 - - - wangluolianjie - wangluozhuangtai - 网络连接 - 网络状态 - - - 网络连接 - 打开wifi - - - tongzhi - shezhizaitongzhizhongxinxianshidetongzhixinxi - 通知 - 设置在通知中心显示的通知信息 - - - tongzhi - shezhitongzhilaiyuan - 通知 - 设置通知来源 - - - xianshiqi - fenbianlv - 显示器 - 分辨率 - - - xianshiqi - suofangpingmu - 显示器 - 缩放屏幕 - - - dianyuan - pingheng(tuijian) - 电源 - 平衡(推荐) - - - dianyuan - jieneng - 电源 - 节能 - - - dianyuan - zidingyi - 电源 - 自定义 - - - dayinji - tianjiadayinjihesaomiaoyi - 打印机 - 添加打印机和扫描仪 - - - dayinji - tianjiadayinjihesaomiaoyi - 打印机 - 添加打印机和扫描仪 - - - daili - kaiqizidongdaili - 代理 - 开启自动代理 - - - daili - kaiqishoudongdaili - 代理 - 开启手动代理 - - - suoping - suopingshixianshiweiduxiaoxishu - 锁屏 - 锁屏时显示未读消息数 - - - suoping - jihuopingbaoshisuodingpingmu - 锁屏 - 激活屏保时锁定屏幕 - - - suoping - xianshisuopingbizhizaidengluyemian - 锁屏 - 显示锁屏壁纸在登录页面 - - - pingbao - kaiqipingbao - 屏保 - 开启屏保 - - - pingbao - pingmubaohuchengxu - 屏保 - 屏幕保护程序 - - - pingbao - dengdaishijian - 屏保 - 等待时间 - - - kuaijiejian - xitongkuaijiejian - 快捷键 - 系统快捷键 - - - kuaijiejian - zidingyikuaijiejian - 快捷键 - 自定义快捷键 - - - kuaijiejian - tianjiazidingyikuaijiejian - 快捷键 - 添加自定义快捷键 - - - zhuti - zhutimoshi - 主题 - 主题模式 - - - zhuti - xitong - 主题 - 系统 - - - zhuti - qianse - 主题 - 浅色 - - - zhuti - toumingxiaoguo - 主题 - 透明效果 - - - zhuti - shense - 主题 - 深色 - - - zhuti - tubiaozhuti - 主题 - 图标主题 - - - zhuti - guangbiaozhuti - 主题 - 光标主题 - - - zhuti - toumingdu - 主题 - 透明度 - - - zhuti - di - 主题 - - - - zhuti - gao - 主题 - - - - chumoban - chumobanshezhi - 触摸板 - 触摸板设置 - - - shengyin - xuanzeshurushebei - 声音 - 选择输入设备 - - - shengyin - yinliangdaxiao - 声音 - 音量大小 - - - shengyin - shurudengji - 声音 - 输入等级 - - - shengyin - xuanzeshuchushebei - 声音 - 选择输出设备 - - - shengyin - zhuyinliangdaxiao - 声音 - 主音量大小 - - - shengyin - shengdaopingheng - 声音 - 声道平衡 - - - shengyin - peizhi - 声音 - 配置 - - - shengyin - shengqia - 声音 - 声卡 - - - shengyin - xitongyinxiao - 声音 - 系统音效 - - - shengyin - xitongyinxiaozhuti - 声音 - 系统音效主题 - - - shengyin - tishiyin - 声音 - 提示音 - - - shengyin - kaiguanjiyinle - 声音 - 开关机音乐 - - - shengyin - tishiyinliangkaiguan - 声音 - 提示音量开关 - - - xianshiqi - suofangpingmu - 显示器 - 缩放屏幕 - - - gengxin - xitonggengxin - 更新 - 系统更新 - - - zhanghuxinxi - mimashixiao - 账户信息 - 密码时效 - - - zhanghuxinxi - mianmidenglu - 账户信息 - 免密登录 - - - zhanghuxinxi - zidongdenglu - 账户信息 - 自动登录 - - - VPN - 添加VPN连接 - - - beijing - liulanbendibizhi - 背景 - 浏览本地壁纸 - - - beijing - huifumorenshezhi - 背景 - 恢复默认设置 - - - beijing - liulanxianshangbizhi - 背景 - 浏览线上壁纸 - - - xianshiqi - tongyishuchu - 显示器 - 统一输出 - - - xianshiqi - yejianmoshi - 显示器 - 夜间模式 - - diff --git a/src/res/translations/bo.ts b/src/res/translations/bo.ts index 470253a..c870a50 100644 --- a/src/res/translations/bo.ts +++ b/src/res/translations/bo.ts @@ -4,35 +4,63 @@ ContentWidget - + + Recently Opened + + + + + Open Quickly + + + + + Commonly Used + + + + Apps - + Settings - + Files - + + Dirs + + + + Best Matches - + Unknown + + FloderListItem + + + Delete the floder out of blacklist + + + MainWindow - + Search @@ -68,7 +96,7 @@ QObject - + ukui-search is already running! @@ -76,14 +104,113 @@ SearchDetailView - + + Path + + + + + Last time modified + + + + Application - + Document + + SettingsWidget + + + Search + + + + + Settings + + + + + Index State + + + + + + ... + + + + + File Index Settings + + + + + Following folders will not be searched. You can set it by adding and removing folders. + + + + + Add ignored folders + + + + + Search Engine Settings + + + + + Please select search engine you preferred. + + + + + baidu + + + + + sougou + + + + + 360 + + + + + Cancel + + + + + Confirm + + + + + Creating ... + + + + + Done + + + + + Index Entry: %1 + + + diff --git a/src/res/translations/tr.ts b/src/res/translations/tr.ts index 470253a..c870a50 100644 --- a/src/res/translations/tr.ts +++ b/src/res/translations/tr.ts @@ -4,35 +4,63 @@ ContentWidget - + + Recently Opened + + + + + Open Quickly + + + + + Commonly Used + + + + Apps - + Settings - + Files - + + Dirs + + + + Best Matches - + Unknown + + FloderListItem + + + Delete the floder out of blacklist + + + MainWindow - + Search @@ -68,7 +96,7 @@ QObject - + ukui-search is already running! @@ -76,14 +104,113 @@ SearchDetailView - + + Path + + + + + Last time modified + + + + Application - + Document + + SettingsWidget + + + Search + + + + + Settings + + + + + Index State + + + + + + ... + + + + + File Index Settings + + + + + Following folders will not be searched. You can set it by adding and removing folders. + + + + + Add ignored folders + + + + + Search Engine Settings + + + + + Please select search engine you preferred. + + + + + baidu + + + + + sougou + + + + + 360 + + + + + Cancel + + + + + Confirm + + + + + Creating ... + + + + + Done + + + + + Index Entry: %1 + + + diff --git a/src/res/translations/zh_CN.ts b/src/res/translations/zh_CN.ts index ec68e13..55bcd98 100644 --- a/src/res/translations/zh_CN.ts +++ b/src/res/translations/zh_CN.ts @@ -4,37 +4,65 @@ ContentWidget - + + Recently Opened + 最近 + + + + Open Quickly + 快速 + + + + Commonly Used + 常用 + + + Apps 应用 - + Settings 配置项 - + Files 文件 - + + Dirs + 文件夹 + + + Best Matches 最佳匹配 - + Unknown 未知 + + FloderListItem + + + Delete the floder out of blacklist + 删除 + + MainWindow - + Search - 搜索 + 从列表搜索 @@ -68,7 +96,7 @@ QObject - + ukui-search is already running! @@ -76,14 +104,113 @@ SearchDetailView - + + Path + 路径 + + + + Last time modified + 上次修改时间 + + + Application 应用 - + Document 文件 + + SettingsWidget + + + Search + 搜索 + + + + Settings + 配置项 + + + + Index State + 索引状态 + + + + + ... + + + + + File Index Settings + 文件索引设置 + + + + Following folders will not be searched. You can set it by adding and removing folders. + 搜索将不再查看以下文件夹。通过增加和删除文件夹可进行文件索引设置。 + + + + Add ignored folders + 添加禁止索引文件夹 + + + + Search Engine Settings + 搜索引擎设置 + + + + Please select search engine you preferred. + 设置互联网搜索引擎 + + + + baidu + 百度 + + + + sougou + 搜狗 + + + + 360 + 360 + + + + Cancel + 取消 + + + + Confirm + 确认 + + + + Creating ... + 正在索引 + + + + Done + 索引完成 + + + + Index Entry: %1 + 索引项: %1 + + diff --git a/src/resource.qrc b/src/resource.qrc index 8c23de3..df637d4 100644 --- a/src/resource.qrc +++ b/src/resource.qrc @@ -6,7 +6,6 @@ res/translations/tr.ts res/translations/zh_CN.ts res/icons/desktop.png - res/search.xml res/icons/close.svg diff --git a/src/settings-widget.cpp b/src/settings-widget.cpp index cc84918..8738975 100644 --- a/src/settings-widget.cpp +++ b/src/settings-widget.cpp @@ -1,6 +1,10 @@ #include "settings-widget.h" #include #include +#include +#include +#include +#include "floder-list-item.h" extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) @@ -8,6 +12,12 @@ SettingsWidget::SettingsWidget(QWidget *parent) : QWidget(parent) this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint); this->setAttribute(Qt::WA_TranslucentBackground); initUi(); + QStringList list; + list<<"/usr/share/applications"<<"/usr/share/icons"<< + "/usr/libs"<<"/home/zjp/UKUI/SEARCH"<< + "/home/zjp/UKUI/UKCC"<<"/home/zjp/UKUI/SD/intel/ukui-settings-daemon"<< + "/home/zjp/下载"<<"/home/zjp/code"; + setupBlackList(list); } SettingsWidget::~SettingsWidget() @@ -88,6 +98,15 @@ void SettingsWidget::initUi() { m_indexBtnLyt->addWidget(m_addDirBtn); m_indexBtnLyt->addStretch(); m_dirListArea = new QScrollArea(this); + m_dirListArea->setStyleSheet("QScrollArea{background:transparent;}"); + m_dirListWidget = new QWidget(this); + m_dirListWidget->setStyleSheet("QWidget{background:transparent;}"); + m_dirListLyt = new QVBoxLayout(m_dirListWidget); + m_dirListLyt->setContentsMargins(0, 0, 0, 0); + m_dirListLyt->setSpacing(0); + m_dirListWidget->setLayout(m_dirListLyt); + m_dirListArea->setWidget(m_dirListWidget); + m_dirListArea->setWidgetResizable(true); m_mainLyt->addWidget(m_indexSettingLabel); m_mainLyt->addWidget(m_indexDescLabel); m_mainLyt->addWidget(m_indexBtnFrame); @@ -153,6 +172,19 @@ void SettingsWidget::initUi() { m_mainLyt->addStretch(); } +/** + * @brief SettingsWidget::setupBlackList 创建黑名单列表 + * @param list 文件夹路径列表 + */ +void SettingsWidget::setupBlackList(const QStringList& list) { + Q_FOREACH(QString path, list) { + FloderListItem * item = new FloderListItem(m_dirListWidget, path); + m_dirListLyt->addWidget(item); + item->setMaximumWidth(470); + } + m_dirListLyt->addStretch(); +} + /** * @brief setIndexState 设置当前索引状态 * @param isCreatingIndex 是否正在创建索引 @@ -191,9 +223,24 @@ void SettingsWidget::onBtnCancelClicked() { * @brief SettingsWidget::onBtnAddClicked 点击添加黑名单按钮的槽函数 */ void SettingsWidget::onBtnAddClicked() { - + QFileDialog * fileDialog = new QFileDialog(this); +// fileDialog->setFileMode(QFileDialog::Directory); //允许查看文件和文件夹,但只允许选择文件夹 + fileDialog->setFileMode(QFileDialog::DirectoryOnly); //只允许查看文件夹 + fileDialog->setViewMode(QFileDialog::Detail); + fileDialog->setDirectory(QDir::homePath()); + if (fileDialog->exec() != QDialog::Accepted) { + fileDialog->deleteLater(); + return; + } + QString selectedDir; + selectedDir = fileDialog->selectedFiles().first(); + qDebug()<