419 if res != QMessageBox.Yes: |
419 if res != QMessageBox.Yes: |
420 # user selected to not overwrite |
420 # user selected to not overwrite |
421 return |
421 return |
422 |
422 |
423 try: |
423 try: |
424 rcfile = open(fname, 'w') |
424 rcfile = open(fname, 'w', encoding = "utf-8") |
425 rcfile.write('<!DOCTYPE RCC>\n') |
425 rcfile.write('<!DOCTYPE RCC>\n') |
426 rcfile.write('<RCC version="1.0">\n') |
426 rcfile.write('<RCC version="1.0">\n') |
427 rcfile.write('<qresource>\n') |
427 rcfile.write('<qresource>\n') |
428 rcfile.write('</qresource>\n') |
428 rcfile.write('</qresource>\n') |
429 rcfile.write('</RCC>\n') |
429 rcfile.write('</RCC>\n') |
508 self.compileRunning = False |
508 self.compileRunning = False |
509 e4App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
509 e4App().getObject("ViewManager").enableEditorsCheckFocusIn(True) |
510 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
510 if exitStatus == QProcess.NormalExit and exitCode == 0 and self.buf: |
511 ofn = os.path.join(self.project.ppath, self.compiledFile) |
511 ofn = os.path.join(self.project.ppath, self.compiledFile) |
512 try: |
512 try: |
513 f = open(ofn, "w") |
513 f = open(ofn, "w", encoding = "utf-8") |
514 for line in self.buf.splitlines(): |
514 for line in self.buf.splitlines(): |
515 f.write(line + os.linesep) |
515 f.write(line + os.linesep) |
516 f.close() |
516 f.close() |
517 if self.compiledFile not in self.project.pdata["SOURCES"]: |
517 if self.compiledFile not in self.project.pdata["SOURCES"]: |
518 self.project.appendFile(ofn) |
518 self.project.appendFile(ofn) |
698 @param filename filename of the resource file (string) |
698 @param filename filename of the resource file (string) |
699 @param mtime modification time to check against |
699 @param mtime modification time to check against |
700 @return flag indicating some file is newer (boolean) |
700 @return flag indicating some file is newer (boolean) |
701 """ |
701 """ |
702 try: |
702 try: |
703 f = open(filename, "r") |
703 f = open(filename, "r", encoding = "utf-8") |
704 buf = f.read() |
704 buf = f.read() |
705 f.close() |
705 f.close() |
706 except IOError: |
706 except IOError: |
707 return False |
707 return False |
708 |
708 |