~ubuntu-branches/ubuntu/karmic/qtcreator/karmic-security

« back to all changes in this revision

Viewing changes to src/plugins/cpptools/cppmodelmanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-07-19 16:23:52 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090719162352-oni0h8hrrkdd3sil
Tags: 1.2.1-1ubuntu1
* Merge from debian unstable (LP: #399414), remaining changes:
  - Add qt-creator transitional package.
* debian/control: Conflicts on qt-creator (<< 1.2.1-1ubuntu1).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
**
5
5
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6
6
**
7
 
** Contact:  Qt Software Information (qt-info@nokia.com)
 
7
** Contact: Nokia Corporation (qt-info@nokia.com)
8
8
**
9
9
** Commercial Usage
10
10
**
23
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
24
**
25
25
** If you are unsure which license is appropriate for your use, please
26
 
** contact the sales department at qt-sales@nokia.com.
 
26
** contact the sales department at http://www.qtsoftware.com/contact.
27
27
**
28
28
**************************************************************************/
29
29
 
68
68
#include <Lexer.h>
69
69
#include <Token.h>
70
70
 
 
71
#include <QtCore/QCoreApplication>
71
72
#include <QtCore/QDebug>
72
73
#include <QtCore/QMutexLocker>
73
74
#include <QtCore/QTime>
470
471
        m_currentDoc->addIncludeFile(fileName, line);
471
472
 
472
473
        if (contents.isEmpty() && ! QFileInfo(fileName).isAbsolute()) {
473
 
            QString msg;
474
 
 
475
 
            msg += fileName;
476
 
            msg += QLatin1String(": No such file or directory");
 
474
            QString msg = QCoreApplication::translate(
 
475
                    "CppPreprocessor", "%1: No such file or directory").arg(fileName);
477
476
 
478
477
            Document::DiagnosticMessage d(Document::DiagnosticMessage::Warning,
479
478
                                          m_currentDoc->fileName(),
529
528
           for each project and all related CppCodeModelPart instances.
530
529
 
531
530
    It also takes care of updating the code models when C++ files are
532
 
    modified within Workbench.
 
531
    modified within Qt Creator.
533
532
*/
534
533
 
535
534
CppModelManager::CppModelManager(QObject *parent)
649
648
    return macros;
650
649
}
651
650
 
 
651
void CppModelManager::addEditorSupport(AbstractEditorSupport *editorSupport)
 
652
{
 
653
    m_addtionalEditorSupport.insert(editorSupport);
 
654
}
 
655
 
 
656
void CppModelManager::removeEditorSupport(AbstractEditorSupport *editorSupport)
 
657
{
 
658
    m_addtionalEditorSupport.remove(editorSupport);
 
659
}
 
660
 
652
661
QMap<QString, QByteArray> CppModelManager::buildWorkingCopyList()
653
662
{
654
663
    QMap<QString, QByteArray> workingCopy;
661
670
        workingCopy[fileName] = editorSupport->contents();
662
671
    }
663
672
 
 
673
    QSetIterator<AbstractEditorSupport *> jt(m_addtionalEditorSupport);
 
674
    while (jt.hasNext()) {
 
675
        AbstractEditorSupport *es =  jt.next();
 
676
        workingCopy[es->fileName()] = es->contents();
 
677
    }
 
678
 
664
679
    // add the project configuration file
665
680
    QByteArray conf(pp_configuration);
666
681
    conf += definedMacros();