Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
dc15e100
Commit
dc15e100
authored
Mar 05, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch for reading py script under windows
parent
c62ae17a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+23
-2
No files found.
SCHNApps/src/schnapps.cpp
View file @
dc15e100
...
...
@@ -367,7 +367,7 @@ void SCHNApps::registerPluginsDirectory(const QString& path)
#ifdef WIN32
#ifdef _DEBUG
QDir
directory
(
path
+
QString
(
"Debug/"
);
QDir
directory
(
path
+
QString
(
"Debug/"
)
)
;
#else
QDir
directory
(
path
+
QString
(
"Release/"
));
#endif
...
...
@@ -811,9 +811,30 @@ void SCHNApps::showHidePythonDock()
void
SCHNApps
::
loadPythonScriptFromFile
(
const
QString
&
fileName
)
{
#ifdef WIN32
// NOT VERY NICE BUT ONLY WAY ON WINDOWS TO LOAD SCRIPT FILES
QFile
file
(
fileName
);
if
(
!
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
return
;
QTextStream
in
(
&
file
);
while
(
!
in
.
atEnd
())
{
QString
line
=
in
.
readLine
();
if
(
line
.
size
()
>=
2
)
{
int
j
=
0
;
while
(
line
[
j
]
==
' '
)
++
j
;
QString
spaces
(
4
-
j
,
QChar
(
' '
));
// need 4 spaces at begin of line
line
.
replace
(
QChar
(
'\\'
),
QChar
(
'/'
));
// replace \ by / in win path
m_pythonConsole
.
consoleMessage
(
spaces
+
line
);
m_pythonConsole
.
executeLine
(
false
);
}
}
#else
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
m_pythonContext
.
evalFile
(
fi
.
filePath
());
#endif
}
void
SCHNApps
::
loadPythonScriptFromFileDialog
()
...
...
@@ -829,7 +850,7 @@ void SCHNApps::closeEvent(QCloseEvent *event)
v
->
closeDialogs
();
}
emit
(
appsFinished
());
emit
(
appsFinished
());
QMainWindow
::
closeEvent
(
event
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment