aboutsummaryrefslogtreecommitdiff
path: root/lumina-fileinfo
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-05-01 13:42:20 -0400
committerKen Moore <moorekou@gmail.com>2015-05-01 13:42:20 -0400
commit099ba69a0b18553d3821bf8e933504b6b3bd6a9b (patch)
tree8258daaea038e47ee56251b9d7a0c3d616cf6bbd /lumina-fileinfo
parentMerge pull request #108 from william-os4y/fm-term (diff)
parentthis patch correct 2 issues with non existing files: (diff)
downloadlumina-099ba69a0b18553d3821bf8e933504b6b3bd6a9b.tar.gz
lumina-099ba69a0b18553d3821bf8e933504b6b3bd6a9b.tar.bz2
lumina-099ba69a0b18553d3821bf8e933504b6b3bd6a9b.zip
Merge pull request #105 from william-os4y/fileinfo2
patches of lumina-fileinfo when the proposed file is not existing or empty
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