From eaac94aeec2d5aac537a3f2cf3357628986f01f8 Mon Sep 17 00:00:00 2001 From: wi Date: Thu, 30 Apr 2015 20:27:00 +0200 Subject: this patch correct 2 issues with non existing files: - lumina-fileinfo file (where file is a not existing file) now return expected values - lumina-fileinfo file.desktop (where file.destp is an empty file) now present the correct screen allowing users to enter values of the desktop file Thanks to last fix, users willing to create a desktop file (via lumina-fm -> new file) in their ~/Desktop folder are able to edit it. --- lumina-fileinfo/dialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lumina-fileinfo/dialog.cpp b/lumina-fileinfo/dialog.cpp index f44ace8f..6141b961 100644 --- a/lumina-fileinfo/dialog.cpp +++ b/lumina-fileinfo/dialog.cpp @@ -122,9 +122,11 @@ void Dialog::LoadDesktopFile(QString input) exit(1); } //if proposed file does not exist, than we will create one based on the templates - if (!QFile::exists(input)) { + QFileInfo info(desktopFileName); + if ((info.size() == 0) && (desktopFileName.endsWith(".desktop"))) { + QFile::remove(desktopFileName); //for the copy, we need to remove it if (desktopType=="link") { - copyTemplate("-link"); + copyTemplate("-link"); } else { copyTemplate("-app"); } @@ -132,7 +134,6 @@ void Dialog::LoadDesktopFile(QString input) this->setWindowTitle(desktopFileName.section("/",-1)); ui->tabWidget->setCurrentIndex(0); //always start on the file info tab //Now load the file info and put it into the UI - QFileInfo info(desktopFileName); QString mime = LXDG::findAppMimeForFile(desktopFileName); QList fmt = QImageReader::supportedImageFormats(); -- cgit