Bug 80674 - Codepage choose need in the file open dialog
Summary: Codepage choose need in the file open dialog
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-30 08:38 UTC by Andrey Cherepanov
Modified: 2004-05-14 22:35 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 Andrey Cherepanov 2004-04-30 08:38:55 UTC
Version:           3.0.2 (using KDE 3.2.1, compiled sources)
Compiler:          gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
OS:          Linux (i686) release 2.4.20-8smp

I cannot choose codepage for opened file in file open dialog. Codepage choose is work well in the file saving dialog. Please, make codepage choose combobox in the file open dialog such as Kate text editor.
Comment 1 Jens Dagerbo 2004-05-14 22:35:13 UTC
CVS commit by dagerbo: 

Make it possible to open files using an other than default encoding.

CCMAIL: 80674-done@bugs.kde.org


  M +12 -6     partcontroller.cpp   1.129


--- kdevelop/src/partcontroller.cpp  #1.128:1.129
@@ -38,4 +38,5 @@
 #include <kiconloader.h>
 #include <kuserprofile.h>
+#include <kencodingfiledialog.h>
 
 #include <ktexteditor/view.h>
@@ -1045,8 +1046,10 @@ void PartController::slotCurrentChanged(
 void PartController::slotOpenFile()
 {
-  KURL::List fileNames = KFileDialog::getOpenURLs(QString::null, QString::null, TopLevel::getInstance()->main(), QString::null);
+        KEncodingFileDialog::Result result = KEncodingFileDialog::getOpenURLsAndEncoding(QString::null, QString::null, 
+                QString::null, TopLevel::getInstance()->main(), QString::null);
 
-  for ( KURL::List::Iterator it = fileNames.begin(); it != fileNames.end(); ++it )
+        for ( KURL::List::Iterator it = result.URLs.begin(); it != result.URLs.end(); ++it )
   {
+                m_presetEncoding = result.encoding;
     editDocument( *it );
   }
@@ -1247,4 +1250,5 @@ void PartController::revertFiles( const 
 /////////////////////////////////////////////////////////////////////////////
 
+//BEGIN History methods
 
 PartController::HistoryEntry::HistoryEntry( const KURL & u, int l, int c) 
@@ -1377,4 +1381,6 @@ void PartController::addHistoryEntry(con
 }
 
+//END History methods
+
 void PartController::slotWaitForFactoryHack( )
 {