changeset 466:0babe9272732

- Created indenter shell scripts now automatically have the executable flag set to true. - The by each indenter supported programming languages, written in braces, are removed from the created shell scripts name. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@703 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Mon, 26 May 2008 12:18:16 +0000
parents eb09281af924
children 3df4cd788ce3
files CHANGELOG.txt src/mainwindow.cpp
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.txt	Mon May 26 10:19:01 2008 +0000
+++ b/CHANGELOG.txt	Mon May 26 12:18:16 2008 +0000
@@ -7,6 +7,7 @@
 [add] Extended the created batch/shell script so it is able to indent only one file given as parameter or a whole directory recursively with a defined file suffix.
 [add] Feature Request ID 1885911 : Added the possibility to open a file on applications start, that is handed over as parameter on the command line.
 [add] Feature Request ID 1729429 : Added the possibility to drag'n drop in any source code file for opening it.
+[change] Created indenter shell scripts now automatically have the executable flag set to true.
 [change] Completed the support for all perl tidy parameters.
 [change] Updated to uncrustify version 0.46.
 [fix] Bug ID 1933074 : On Unix systems the user config files were stored in his home dir in the subfolder ".config". Now they are directly stored in ".universalindentgui".
--- a/src/mainwindow.cpp	Mon May 26 10:19:01 2008 +0000
+++ b/src/mainwindow.cpp	Mon May 26 12:18:16 2008 +0000
@@ -1396,6 +1396,11 @@
     QString fileExtensions = tr("Shell Script")+" (*."+shellScriptExtension+");;"+tr("All files")+" (*.*)";
 
     QString currentIndenterName = toolBarWidget->cmbBoxIndenters->currentText();
+    // Remove the supported programming languages from indenters name, which are set in braces.
+    if ( currentIndenterName.indexOf("(") > 0 ) {
+        // Using index-1 to also leave out the blank before the brace.
+        currentIndenterName = currentIndenterName.left( currentIndenterName.indexOf("(")-1 );
+    }
     currentIndenterName = currentIndenterName.replace(" ", "_");
 
     //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions );
@@ -1410,6 +1415,10 @@
     QFile outSrcFile(fileName);
     outSrcFile.open( QFile::ReadWrite | QFile::Text );
     outSrcFile.write( indenterCallShellScript.toAscii() );
+#if !defined(Q_OS_WIN32)
+// For none Windows systems the files executable flag
+    outSrcFile.setPermissions( outSrcFile.permissions() | QFile::ExeOwner | QFile::ExeUser| QFile::ExeGroup );
+#endif
     outSrcFile.close();
 }