[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdewebdev/quanta
From:       Andras Mantia <amantia () kde ! org>
Date:       2006-09-01 21:38:30
Message-ID: 1157146710.834761.6769.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 579876 by amantia:

Save As asked for confirmation of "save before close" for modified files due to the \
setEncoding() call. This was confusing and could result in data loss as well. For \
now, remove the possibility to change the encoding in the save dialog (users should \
change the encoding and save later or save and change later).

Possiby fixes #131728  (I cannot reproduce it with this version).

BUG: 131728 

 M  +1 -0      ChangeLog  
 M  +14 -7     src/quanta.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #579875:579876
@@ -4,6 +4,7 @@
  - bugfixes:
       - do not allow growing of quantarc until it crashes Quanta [#111049]
       - symlink handling fixes (hopefully won't break anything)
+      - fix Save As problems, possibly #131728
 
 Version 3.5.4 (Release date: 02-08-2006; Started 24-06-2005):
  - bugfixes:
--- branches/KDE/3.5/kdewebdev/quanta/src/quanta.cpp #579875:579876
@@ -376,7 +376,7 @@
     if (!QExtFileInfo::exists(*i, true, this))
     {
       KMessageBox::error(this, i18n("<qt>The file <b>%1</b> does not exist or is not \
                a recognized mime type.</qt>").arg((*i).prettyURL(0, \
                KURL::StripFileProtocol)));
-      
+
     } else
     {
       if (QuantaCommon::checkMimeGroup(*i, "text") ||
@@ -463,8 +463,10 @@
       fileWatcher->removeFile(oldURL.path());
 //      kdDebug(24000) << "removeFile[slotFileSaveAs]: " << oldURL.path() << endl;
     }
-    QString myEncoding =  \
dynamic_cast<KTextEditor::EncodingInterface*>(w->doc())->encoding();  
+    //FIXME: in katepart changing encoding saves the original file if it was \
modified, so it's useless in saveas... +//    QString myEncoding =  \
dynamic_cast<KTextEditor::EncodingInterface*>(w->doc())->encoding(); +
     bool gotPath = false;
 
     KURL saveAsUrl;
@@ -502,15 +504,20 @@
         saveAsUrl.setPath(saveAsUrl.directory(false, false) + oldURL.fileName());
       }
 
-
+//FIXME: in katepart changing encoding saves the original file if it was modified, \
so it's useless in saveas... +      /*
     KEncodingFileDialog::Result data;
     data = KEncodingFileDialog::getSaveURLAndEncoding(myEncoding, saveAsUrl.url(),
         "all/allfiles text/html text/xml application/x-php text/plain", this, \
i18n("Save File"));  KURL saveUrl = data.URLs[0];
-    QString encoding = data.encoding;
+    bool found;
+    QString encoding = KGlobal::charsets()->codecForName(data.encoding, \
                found)->name();
     KTextEditor::EncodingInterface* encodingIf = \
                dynamic_cast<KTextEditor::EncodingInterface*>(w->doc());
-    if (encodingIf)
+    if (encodingIf && encodingIf->encoding() != encoding)
        encodingIf->setEncoding(encoding);
+      */
+    KURL saveUrl = KFileDialog::getSaveURL(saveAsUrl.url(),
+         "all/allfiles text/html text/xml application/x-php text/plain", this, \
i18n("Save File"));  
     if (QuantaCommon::checkOverwrite(saveUrl, this) && view->saveDocument(saveUrl))
     {
@@ -3419,7 +3426,7 @@
 //FIXME: Find a good way to redraw the editor view when the toolbar height
 //changes
 //  if (ViewManager::ref()->activeView())
-    //ViewManager::ref()->activeView()->activated();  
+    //ViewManager::ref()->activeView()->activated();
 }
 
 
@@ -4486,7 +4493,7 @@
     delete dlg;
 
   } else
-  if (!node || w->currentDTD(true)->name == "text/css") 
+  if (!node || w->currentDTD(true)->name == "text/css")
   {
         kdDebug(24000) << "[CSS editor] This is a pure CSS document" << endl;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic