Bug 58080 - file truncated after preview
Summary: file truncated after preview
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Unmaintained
Component: general (show other bugs)
Version: 3.1.1
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-03 22:09 UTC by Tim Hunter
Modified: 2003-05-13 07:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
image.html.gz (25.12 KB, application/x-gzip)
2003-05-04 18:12 UTC, Tim Hunter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Hunter 2003-05-03 22:09:39 UTC
Version:           3.1.1 (using KDE 3.1.0)
Installed from:    Mandrake Linux Cooker i586 - Cooker
Compiler:          gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
OS:          Linux (i686) release 2.4.21-0.13mdk

Open an existing file and make a change. Without saving the file, click the Preview icon. The preview appears. Click the Preview icon again. A dialog box appears, entitled "File Changed". It says "The file was changed outside of the Quanta editor." The on-disk version of the file has been truncated at line 900. The in-memory version of the file has all 4000+ lines. If you save the file before clicking the Preview icon this does not happen.

I'm running Quanta with no special options or configuration - very much "out-of-the-box."
Comment 1 András Manţia 2003-05-04 13:37:15 UTC
Subject: Re:  New: file truncated after preview

Hi,

 I cannot reproduce this. After the preview, the file changed dialog is not
shown, and the files itself is not truncated. Is it possible to send me (eben
in private) the file you were working on?

Andras
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+tPrqTQdfac6L/08RAvWoAKCNMslyOfP7mAhIL8RzUsVXHbPAEwCgtCPN
45ZyMi/sRDr7wh3iUFCwm5w=
=UEl4
-----END PGP SIGNATURE-----

Comment 2 Tim Hunter 2003-05-04 16:12:02 UTC
Subject: Re:  file truncated after preview

I've uploaded a tar file containing a set of files that reproduce this for me. 
The file "image.html" is the file that is truncated.

http://home.nc.rr.com/rmagick/bug58080.tar.gz

Please let me know if you need any more information.

On Sunday 04 May 2003 07:37 am, you wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=58080
>
>
>
>
> ------- Additional Comments From amantia@freemail.hu  2003-05-04 13:37
> ------- Subject: Re:  New: file truncated after preview
>
> Hi,
>
>  I cannot reproduce this. After the preview, the file changed dialog is not
> shown, and the files itself is not truncated. Is it possible to send me
> (eben in private) the file you were working on?
>
> Andras
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>
> iD8DBQE+tPrqTQdfac6L/08RAvWoAKCNMslyOfP7mAhIL8RzUsVXHbPAEwCgtCPN
> 45ZyMi/sRDr7wh3iUFCwm5w=
> =UEl4
> -----END PGP SIGNATURE-----

Comment 3 András Manţia 2003-05-04 17:39:41 UTC
Subject: Re:  file truncated after preview

I see the truncated file and the images there, but I cannot find the original 
html file, which got truncated. Can you send that one also?

Andras
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+tTQKTQdfac6L/08RAlxdAKDlvXT+i2LTVYCt91Yr8WQpkRoNiACfd1tN
5Kva/A714dg01MGQgK5KRHY=
=Ige1
-----END PGP SIGNATURE-----

Comment 4 Tim Hunter 2003-05-04 18:12:12 UTC
Subject: Re:  file truncated after preview

I'm sorry. Here it is. This file should have 4905 lines.

Please let me know if you need anything else.

On Sunday 04 May 2003 11:39 am, you wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=58080
>
>
>
>
> ------- Additional Comments From amantia@freemail.hu  2003-05-04 17:39
> ------- Subject: Re:  file truncated after preview
>
> I see the truncated file and the images there, but I cannot find the
> original html file, which got truncated. Can you send that one also?
>
> Andras
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
>
> iD8DBQE+tTQKTQdfac6L/08RAlxdAKDlvXT+i2LTVYCt91Yr8WQpkRoNiACfd1tN
> 5Kva/A714dg01MGQgK5KRHY=
> =Ige1
> -----END PGP SIGNATURE-----


Created an attachment (id=1485)
image.html.gz
Comment 5 András Manţia 2003-05-05 13:27:40 UTC
Subject: quanta

CVS commit by amantia: 

Do not truncate the file after a preview.

CCMAIL: 58080-done@bugs.kde.org


  M +3 -0      ChangeLog   1.160
  M +4 -24     quanta/quanta.cpp   1.272


--- quanta/ChangeLog  #1.159:1.160
@@ -36,4 +36,7 @@
     - fix the syntax of DTD tag files
     - don't close a modified document if saving has failed [#58013]
+    - fix the selection of modified files in the upload dialog. Should be more
+      accurate now.
+    - do not truncate the file after a preview
   - new features:
     - "Replace selection" for script actions replaces the selection if

--- quanta/quanta/quanta.cpp  #1.271:1.272
@@ -69,4 +69,5 @@
 #include <ktip.h>
 #include <kparts/componentfactory.h>
+#include <kio/netaccess.h>
 
 #include <ktexteditor/editinterface.h>
@@ -1067,8 +1068,4 @@ void QuantaApp::slotShowPreview()
     s->raiseWidget(id);
 
-//FIXME:
-//Restore the original doc from the temp file.
-//We should find a better synchronous method to copy the temp file to the current one.
-//which works also for non local files
     fileWatcher->stopScan();
     if (m_doc->isModified())
@@ -1077,12 +1075,5 @@ void QuantaApp::slotShowPreview()
       KURL tempUrl;
       tempUrl.setPath(w->tempFileName());
-
-      KTextEditor::Document *doc2 = KParts::ComponentFactory::createPartInstanceFromQuery<KTextEditor::Document>( "KTextEditor/Document",
-                                    QString::null,
-                                    this, 0,
-                                    this, 0 );
-      doc2->openURL(tempUrl);
-      doc2->saveAs(origUrl);
-      delete doc2;
+      KIO::NetAccess::file_copy(tempUrl, origUrl, -1, true, false, this);
     }
     fileWatcher->startScan();
@@ -1638,8 +1629,4 @@ void QuantaApp::slotSyntaxCheckDone()
   if (m_view->writeExists())
   {
-  //FIXME:
-  //Restore the original doc from the temp file.
-  //We should find a better synchronous method to copy the temp file to the current one.
-  //A method for this is also a good idea.
     Document *w = m_view->write();
 
@@ -1650,12 +1637,5 @@ void QuantaApp::slotSyntaxCheckDone()
       KURL tempUrl;
       tempUrl.setPath(w->tempFileName());
-
-      KTextEditor::Document *doc2 = KParts::ComponentFactory::createPartInstanceFromQuery<KTextEditor::Document>( "KTextEditor/Document",
-                                    QString::null,
-                                    this, 0,
-                                    this, 0 );
-      doc2->openURL(tempUrl);
-      doc2->saveAs(origUrl);
-      delete doc2;
+      KIO::NetAccess::file_copy(tempUrl, origUrl, -1, true, false, this);
     }
     fileWatcher->startScan();


Comment 6 András Manţia 2003-05-05 13:29:11 UTC
Subject: Re:  file truncated after preview

I still cannot reproduce the error. It may be because I use KDE CVS HEAD and 
not KDE 3.1. Two questions:
- - is it the same after doing a syntax check?
- - can you update your Quanta from CVS and try with that one? I believe I've 
found the solution for the problem.

Andras
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+tknfTQdfac6L/08RArybAJ9JXI9NC32pBZWN9qbx8Z9jB6dUJgCfZeCS
Av4jdIxeD1Pimfj2JDICnxM=
=cRTO
-----END PGP SIGNATURE-----

Comment 7 Tim Hunter 2003-05-07 02:49:06 UTC
Subject: Re:  file truncated after preview

Yes, I'll try CVS HEAD but it may be next week. Thanks!

On Monday 05 May 2003 07:29 am, you wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=58080
>
>
>
>
> ------- Additional Comments From amantia@freemail.hu  2003-05-05 13:29
> ------- Subject: Re:  file truncated after preview
>
> I still cannot reproduce the error. It may be because I use KDE CVS HEAD
> and not KDE 3.1. Two questions:
> - - is it the same after doing a syntax check?
> - - can you update your Quanta from CVS and try with that one? I believe
> I've found the solution for the problem.
>
> Andras

Comment 8 Tim Hunter 2003-05-12 01:08:06 UTC
Subject: Re:  file truncated after preview

On Monday 05 May 2003 07:29 am, you wrote:
> I still cannot reproduce the error. It may be because I use KDE CVS HEAD
> and not KDE 3.1. Two questions:
> - - is it the same after doing a syntax check?

No. I believe the bug requires that the file be "dirty" (changed in memory 
from the version on disk) before clicking the View button.

> - - can you update your Quanta from CVS and try with that one? I believe
> I've found the solution for the problem.

Sorry, no. I don't have the required Qt headers and libraries installed.


Comment 9 oyvind 2003-05-13 07:06:21 UTC
Let's clear something up! This is a MANDRAKE ONLY BUG. Reviewed even has a nice 
story about it: How the Quanta+ version in MDK 9.1 ruined my day at 
http://reviewed.homelinux.org/en/mandrakebadquanta.html 
 
I have tried this with other Linux distributions. The standard Mandrake 9.1. installation is the 
only one that seems to have this bug, probably because of a strange mix of KDE 
3.1.godwhoknows and Quanta 3.1.1.