Ulrich Van Den Hekke 15 years ago
parent
commit
3cd3eb5384
  1. 2
      src/javascriptparser.cpp
  2. 6
      src/xsleditor.cpp
  3. 36
      src/xsllistview.cpp

2
src/javascriptparser.cpp

@ -229,7 +229,7 @@ void PrivateJavaScriptParser::nextIdentifier( QIODevice * device, enum JAVASCRIP
state = STATE_END;
} else if( c == '/' ) {
state = STATE_STARTCOMMENT;
} else if( ( c >= 'A' ) && ( c <= 'Z' ) ) {
} else if( ( ( c >= 'A' ) && ( c <= 'Z' ) ) || ( c == '_' ) ) {
state = STATE_IDENTIFIER;
st = ch;
} else if( ( c == '+' ) || ( c == '-' ) || ( ( c >= '0' ) && ( c <= '9' ) ) ) {

6
src/xsleditor.cpp

@ -579,7 +579,11 @@ void XSLEditor::keyPressEvent( QKeyEvent *e ) {
setTextCursor( tc );
}
}
updateModel();
try {
updateModel();
} catch( XMLParserException e ) {
emit hasError( tr( "Error %1 at %2" ).arg( e.getMessage() ).arg( e.getLine() ) );
}
} else if( e->text().right(1) == "=" ) {
QTextCursor tc( textCursor() );
QTextCursor tc2( textCursor() );

36
src/xsllistview.cpp

@ -200,22 +200,26 @@ void XSLModelData::loadFromContent( const QString& content ) {
}
int XSLModelData::childCount() {
if( global.m_project && ( m_child.size() == 0 ) && ( ( m_type == etImport ) || ( m_type == etJavascript ) ) ) {
if( QFile::exists( QDir( global.m_project->specifPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->specifPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->navPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->navPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->projectPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->projectPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->languePath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->languePath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->languesPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->languesPath() ).absoluteFilePath( m_name ) );
}
try {
if( global.m_project && ( m_child.size() == 0 ) && ( ( m_type == etImport ) || ( m_type == etJavascript ) ) ) {
if( QFile::exists( QDir( global.m_project->specifPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->specifPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->navPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->navPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->projectPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->projectPath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->languePath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->languePath() ).absoluteFilePath( m_name ) );
} else
if( QFile::exists( QDir( global.m_project->languesPath() ).absoluteFilePath( m_name ) ) ) {
loadFromFile( QDir( global.m_project->languesPath() ).absoluteFilePath( m_name ) );
}
}
} catch( XMLParserException e ) {
emit hasError( tr( "Error %1 at %2" ).arg( e.getMessage() ).arg( e.getLine() ) );
}
return m_child.size();
};

Loading…
Cancel
Save