Bug 51308 - two open instances of quanta 3.0 cause saving trouble
Summary: two open instances of quanta 3.0 cause saving trouble
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-29 02:33 UTC by Herbert Peters
Modified: 2002-12-09 11:04 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 Herbert Peters 2002-11-29 02:33:44 UTC
Version:            (using KDE KDE 3.0.5)
Installed from:    SuSE RPMs
OS:          Linux

When opening a file from the desktop and I have quanta already open (with kompare as tool installed), then quanta opens a second instance opening the same files I've opened before, plus the new one. When I change something in the files that I had opened previously, both quanta instances run kompare and whatever I choose from kompare after the result has been shown, I'm ending up with a sourcefile, that is chmoded to -rw- for the user only.

Probably best would be to limit quanta to a single instance, to avoid such conditions.
Comment 1 András Manţia 2002-12-09 11:04:28 UTC
Subject: quanta/quanta/dialogs

CVS commit by amantia: 

Workaround for KIO::file_move bug (does not use the permissions argument correctly). Fixed bug #51308.

BTW, you can use the --unique switch to limit quanta to a single instance.

CCMAIL: 51308-done@bugs.kde.org


  M +8 -1      dirtydlg.cpp   1.2
  M +1 -0      dirtydlg.h   1.2


--- quanta/quanta/dialogs/dirtydlg.cpp  #1.1:1.2
@@ -25,4 +25,6 @@
 #include <kio/job.h>
 #include <kio/jobclasses.h>
+#include <kio/netaccess.h>
+#include <kfileitem.h>
 
 //app includes
@@ -64,5 +66,9 @@ void DirtyDlg::slotCompareDone(KProcess*
  delete proc;
 
- KIO::FileCopyJob *job = KIO::file_move(m_dest, m_src, -1, true, false,false );
+ KIO::UDSEntry entry;
+ KIO::NetAccess::stat(m_src, entry);
+ KFileItem item(entry, m_src, false, true);
+ m_permissions = item.permissions();
+ KIO::FileCopyJob *job = KIO::file_move(m_dest, m_src, m_permissions, true, false,false );
  connect( job, SIGNAL(result( KIO::Job *)),
                  SLOT  (slotResult( KIO::Job *)));
@@ -73,4 +79,5 @@ void DirtyDlg::slotCompareDone(KProcess*
 void DirtyDlg::slotResult(KIO::Job *)
 {
+ KIO::chmod(m_src, m_permissions);
  m_busy = false;
  accept();

--- quanta/quanta/dialogs/dirtydlg.h  #1.1:1.2
@@ -41,4 +41,5 @@ protected: // Protected attributes
   KURL m_dest;
   bool m_busy;
+  int  m_permissions;
 protected slots: // Protected slots
   /** No descriptions */