From 82ebebfb8a5867b400c1df726a478bdcb9d7c005 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 22 Sep 2016 16:41:42 -0400 Subject: Large update to how XDGDesktop files are created/used. This impacts almost all tools/utilities within Lumina - please test (passed internal tests so far). This cleans up a lot of the backend XDG compliance class, moving lots of functionality into child functions of the XDGDesktop class and ensuring that they get cleaned up more regularly/properly. This *seems* to make the desktop startup a lot faster, even if the overall memory savings are slight (so far). --- src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 32 +++++++++++----------- src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 6 ++-- .../desktop-utils/lumina-fm/widgets/DirWidget.cpp | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src-qt5/desktop-utils') diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 56b72a3c..2656b855 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -241,27 +241,27 @@ void MainUI::on_push_save_clicked(){ INFO.setFile(filePath); INFO.XDG()->filePath = filePath; } - XDGDesktop XDG = *INFO.XDG(); + XDGDesktop *XDG = INFO.XDG(); //Now change the structure - XDG.name = ui->line_xdg_name->text(); - XDG.genericName = ui->line_xdg_name->text().toLower(); - XDG.comment = ui->line_xdg_comment->text(); - XDG.icon = ui->push_xdg_getIcon->whatsThis(); + XDG->name = ui->line_xdg_name->text(); + XDG->genericName = ui->line_xdg_name->text().toLower(); + XDG->comment = ui->line_xdg_comment->text(); + XDG->icon = ui->push_xdg_getIcon->whatsThis(); //Now do the type-specific fields - if(XDG.type==XDGDesktop::APP){ - XDG.exec = ui->line_xdg_command->text(); - XDG.tryexec = ui->line_xdg_command->text().section(" ",0,0); //use the first word/binary for the existance check - XDG.path = ui->line_xdg_wdir->text(); //working dir/path - XDG.useTerminal = ui->check_xdg_useTerminal->isChecked(); - XDG.startupNotify = ui->check_xdg_startupNotify->isChecked(); - }else if(XDG.type==XDGDesktop::LINK){ - XDG.url = ui->line_xdg_wdir->text(); //we re-used this field + if(XDG->type == XDGDesktop::APP){ + XDG->exec = ui->line_xdg_command->text(); + XDG->tryexec = ui->line_xdg_command->text().section(" ",0,0); //use the first word/binary for the existance check + XDG->path = ui->line_xdg_wdir->text(); //working dir/path + XDG->useTerminal = ui->check_xdg_useTerminal->isChecked(); + XDG->startupNotify = ui->check_xdg_startupNotify->isChecked(); + }else if(XDG->type==XDGDesktop::LINK){ + XDG->url = ui->line_xdg_wdir->text(); //we re-used this field } //Clear any info which this utility does not support at the moment - XDG.actionList.clear(); - XDG.actions.clear(); + XDG->actionList.clear(); + XDG->actions.clear(); //Now save the structure to file - bool saved = LXDG::saveDesktopFile( XDG, true); //Try to merge the file/structure as necessary + bool saved = XDG->saveDesktopFile(true); //Try to merge the file/structure as necessary qDebug() << "File Saved:" << saved; ui->push_save->setEnabled( !saved ); if(saved){ diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 65349d3e..e17ab439 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -35,12 +35,12 @@ public slots: private: Ui::MainUI *ui; bool canwrite; - bool terminate_thread; //flag for terminating the GetDirSize task + bool terminate_thread; //flag for terminating the GetDirSize task void ReloadAppIcon(); - void GetDirSize(const QString dirname) const; //function to get folder size + void GetDirSize(const QString dirname) const; //function to get folder size signals: - void folder_size_changed(quint64 size, quint64 files, quint64 folders, bool finished) const; //Signal for updating the folder size asynchronously + void folder_size_changed(quint64 size, quint64 files, quint64 folders, bool finished) const; //Signal for updating the folder size asynchronously private slots: //Initialization functions diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget.cpp index a23c9aec..b8b4da0b 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget.cpp @@ -94,7 +94,7 @@ void DirWidget::ChangeDir(QString dirpath){ } void DirWidget::setDirCompleter(QCompleter *comp){ - line_dir->setCompleter(comp); + //line_dir->setCompleter(comp); } QString DirWidget::id(){ -- cgit