From e68620ce4d4f8300059c384b2919acaf9c873374 Mon Sep 17 00:00:00 2001
From: fahim
Date: Fri, 5 Jun 2015 17:23:39 +0530
Subject: Subject: Changes for saving previouse values

Description: Changes for saving previouse values of component entered by
User.
---
 src/frontEnd/ProjectExplorer.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'src/frontEnd/ProjectExplorer.py')

diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index b518d863..906001d5 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -87,9 +87,8 @@ class ProjectExplorer(QtGui.QWidget):
         self.windowgrid = QtGui.QGridLayout()
         if (os.path.isfile(str(self.filePath)))== True:
             self.fopen = open(str(self.filePath), 'r')
-            lines = self.fopen.readlines()
-            for line in lines:
-                self.text.append(line)
+            lines = self.fopen.read()
+            self.text.setText(lines)
     
             QtCore.QObject.connect(self.text,QtCore.SIGNAL("textChanged()"), self.enable_save)        
             
@@ -108,9 +107,7 @@ class ProjectExplorer(QtGui.QWidget):
         
     def save_data(self):
         self.fopen=open(self.filePath, 'w')
-        lines = str(self.text.toPlainText()).split('\n')
-        lines=[i+'\r' if i in lines[:-1] else i for i in lines]
-        self.fopen.writelines(lines)
+        self.fopen.write(self.text.toPlainText())
         self.fopen.close()
         self.textwindow.close()
         
-- 
cgit