aboutsummaryrefslogtreecommitdiff
path: root/lumina-fileinfo
diff options
context:
space:
mode:
authorwi <william.os4y@gmail.com>2015-04-30 20:27:00 +0200
committerwi <william.os4y@gmail.com>2015-04-30 20:27:00 +0200
commiteaac94aeec2d5aac537a3f2cf3357628986f01f8 (patch)
tree6d02940b4fb72a68885d08a9bb6eecccfbe5627e /lumina-fileinfo
parentFix/Fix a couple important bugs before announcing 0.8.4-release: (diff)
downloadlumina-eaac94aeec2d5aac537a3f2cf3357628986f01f8.tar.gz
lumina-eaac94aeec2d5aac537a3f2cf3357628986f01f8.tar.bz2
lumina-eaac94aeec2d5aac537a3f2cf3357628986f01f8.zip
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.
Diffstat (limited to 'lumina-fileinfo')
-rw-r--r--lumina-fileinfo/dialog.cpp7
1 files 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<QByteArray> fmt = QImageReader::supportedImageFormats();
bgstack15