Logo Search packages:      
Sourcecode: qdevelop version File versions  Download package

void LogBuild::mouseDoubleClickEvent ( QMouseEvent *  event  )  [protected]

When the user double-click on a error or warning line, the file is opened in a editor.

Definition at line 33 of file logbuild.cpp.

References m_mainImpl.

{
    // First highlight the line double-clicked
    QTextCursor cursor = textCursor();
    cursor.movePosition(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);
    cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
    setTextCursor( cursor );
    //
    BlockLogBuild *blockUserData = (BlockLogBuild*)cursor.block().userData();
    // If blockUserData is null, the line doesn't contains "error" or "warning", we quit this function.
    if ( !blockUserData )
        return;
    QString projectDirectory = blockUserData->directory();
    QString text = cursor.block().text();
    if ( !containsError(text) && !containsWarning(text) )
        return;
    QString filename = text.section(":", 0, 0).replace("\\", "/").replace("//", "/");
    int numLine = text.section(":", 1, 1).toInt();
    if ( numLine == 0 )
        return;
    QString absoluteName = QDir(projectDirectory+"/"+filename).absolutePath();
    m_mainImpl->openFile( QStringList( absoluteName ), numLine);
}


Generated by  Doxygen 1.6.0   Back to index