Bug 57718 - quanta can not open empty files created by touch
Summary: quanta can not open empty files created by touch
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: 3.1.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-25 23:47 UTC by Thilo Bangert
Modified: 2003-05-01 14:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thilo Bangert 2003-04-25 23:47:21 UTC
Version:           3.1.1 (using KDE KDE 3.1.1a)
Installed from:    Gentoo Packages

i added a directory containing empty files which were created by touch from the shell.

these files get added to the project OK, but when i try to edit them quanta complains:
"This file cannot be opened with quanta. Do you want to open with an external programm..."

anyway - these are empty files and kate can read them OK...
thanks
Thilo
Comment 1 András Manţia 2003-05-01 14:50:03 UTC
Subject: QUANTA_3_1_BRANCH: quanta

CVS commit by amantia: 

Allow opening of empty local files. [#57718]

CCMAIL: 57718-done@bugs.kde.org
CCMAIL: tamas@komaromi-komaromi.hu


  M +1 -0      ChangeLog   1.90.2.63
  M +20 -15    quanta/quantacommon.cpp   1.29.2.6
  M +3 -3      quanta/treeviews/filemanage.cpp   1.15.2.2


--- quanta/ChangeLog  #1.90.2.62:1.90.2.63
@@ -22,4 +22,5 @@
     - fix the DTD tag files, add warning if they contain syntax errors
     - use the Attribute Quotation setting
+    - allow opening of empty local files [#57718]
  - usability enhancements:
     - bring up the message output window, when and action/plugin wants to printed

--- quanta/quanta/quantacommon.cpp  #1.29.2.5:1.29.2.6
@@ -411,4 +411,7 @@ Format QuantaCommon::findFormatByFileCon
      result.text = v.toBool();
 
+  if (mime->name().startsWith("inode/"))
+     return result;
+
   QFile f(fileName);
   if (f.open(IO_ReadOnly))
@@ -419,4 +422,6 @@ Format QuantaCommon::findFormatByFileCon
         result.compression = Format::GZipCompression;
   }
+  if ((ulong) f.size() == 0)
+    result.text = true;
   return result;
 }