Commit 4ef83082 authored by hjk's avatar hjk
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents 58e8aed6 68552b8f
......@@ -109,6 +109,7 @@ Document::Document(const QString &fileName)
localFileName.size());
_translationUnit = new TranslationUnit(_control, fileId);
_translationUnit->setQtMocRunEnabled(true);
_translationUnit->setObjCEnabled(true);
(void) _control->switchTranslationUnit(_translationUnit);
}
......
......@@ -59,7 +59,9 @@ SimpleLexer::SimpleLexer()
_skipComments(false),
_qtMocRunEnabled(true),
_objCEnabled(false)
{ }
{
setObjCEnabled(true);
}
SimpleLexer::~SimpleLexer()
{ }
......
......@@ -727,6 +727,7 @@ void Preprocessor::processDirective(TokenIterator firstToken, TokenIterator last
case PP_INCLUDE:
case PP_INCLUDE_NEXT:
case PP_IMPORT:
if (! skipping())
processInclude(d == PP_INCLUDE_NEXT, firstToken, lastToken);
break;
......@@ -1069,6 +1070,8 @@ Preprocessor::PP_DIRECTIVE_TYPE Preprocessor::classifyDirective (const QByteArra
case 6:
if (__directive[0] == 'i' && __directive == "ifndef")
return PP_IFNDEF;
else if (__directive[0] == 'i' && __directive == "import")
return PP_IMPORT;
else if (__directive[0] == 'd' && __directive == "define")
return PP_DEFINE;
break;
......
......@@ -150,6 +150,7 @@ namespace CPlusPlus {
{
PP_UNKNOWN_DIRECTIVE,
PP_DEFINE,
PP_IMPORT,
PP_INCLUDE,
PP_INCLUDE_NEXT,
PP_ELIF,
......
......@@ -2,38 +2,5 @@
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="application/octet-stream">
<comment>unknown</comment>
<comment xml:lang="bg">Неизвестен тип</comment>
<comment xml:lang="ca">desconegut</comment>
<comment xml:lang="cs">Neznámý</comment>
<comment xml:lang="cy">Anhysbys</comment>
<comment xml:lang="da">ukendt</comment>
<comment xml:lang="de">unbekannt</comment>
<comment xml:lang="el">αγνωστο</comment>
<comment xml:lang="eo">nekonata</comment>
<comment xml:lang="es">desconocido</comment>
<comment xml:lang="eu">ezezaguna</comment>
<comment xml:lang="fi">tuntematon</comment>
<comment xml:lang="fr">inconnu</comment>
<comment xml:lang="hu">ismeretlen</comment>
<comment xml:lang="it">Sconosciuto</comment>
<comment xml:lang="ja">不明</comment>
<comment xml:lang="ko">알 수 없음</comment>
<comment xml:lang="lt">nežinoma</comment>
<comment xml:lang="ms">Entah</comment>
<comment xml:lang="nb">ukjent</comment>
<comment xml:lang="nl">onbekend</comment>
<comment xml:lang="nn">ukjend</comment>
<comment xml:lang="pl">nieznany typ</comment>
<comment xml:lang="pt">desconhecido</comment>
<comment xml:lang="pt_BR">Desconhecido</comment>
<comment xml:lang="ru">неизвестный</comment>
<comment xml:lang="rw">itazwi</comment>
<comment xml:lang="sq">nuk njihet</comment>
<comment xml:lang="sr">непознато</comment>
<comment xml:lang="sv">okänd</comment>
<comment xml:lang="uk">невідомо</comment>
<comment xml:lang="vi">không rõ</comment>
<comment xml:lang="zh_CN">未知</comment>
<comment xml:lang="zh_TW">不明</comment>
</mime-type>
</mime-info>
......@@ -3,37 +3,6 @@
<mime-type type="text/x-csrc">
<sub-class-of type="text/plain"/>
<comment>C Source file</comment>
<comment xml:lang="bg">Изходен код на C</comment>
<comment xml:lang="ca">codi font en C</comment>
<comment xml:lang="cs">Zdrojový kód v C</comment>
<comment xml:lang="cy">Ffynhonnell Rhaglen C</comment>
<comment xml:lang="da">C-kildekode</comment>
<comment xml:lang="de">C-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας C</comment>
<comment xml:lang="eo">C-fontkodo</comment>
<comment xml:lang="es">código fuente en C</comment>
<comment xml:lang="eu">C iturburu-kodea</comment>
<comment xml:lang="fi">C-lähdekoodi</comment>
<comment xml:lang="fr">code source C</comment>
<comment xml:lang="hu">C-forráskód</comment>
<comment xml:lang="it">Codice sorgente C</comment>
<comment xml:lang="ja">C ソースコード</comment>
<comment xml:lang="ko">C 소스 코드</comment>
<comment xml:lang="lt">C pradinis kodas</comment>
<comment xml:lang="ms">Kod sumber C</comment>
<comment xml:lang="nb">C-kildekode</comment>
<comment xml:lang="nl">C-broncode</comment>
<comment xml:lang="nn">C-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy w C</comment>
<comment xml:lang="pt">código fonte C</comment>
<comment xml:lang="pt_BR">Código fonte C</comment>
<comment xml:lang="ru">программа на языке C</comment>
<comment xml:lang="sq">Kod burues C</comment>
<comment xml:lang="sr">C изворни ко̂д</comment>
<comment xml:lang="sv">C-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові C</comment>
<comment xml:lang="zh_CN">C 源代码</comment>
<comment xml:lang="zh_TW">C 源代碼</comment>
<glob pattern="*.c"/>
</mime-type>
......@@ -41,21 +10,6 @@
<mime-type type="text/x-chdr">
<sub-class-of type="text/x-csrc"/>
<comment>C Header file</comment>
<comment xml:lang="bg">Заглавен файл на C</comment>
<comment xml:lang="cs">Hlavička v C</comment>
<comment xml:lang="de">C-Header</comment>
<comment xml:lang="es">cabecera de código fuente en C</comment>
<comment xml:lang="eu">C goiburua</comment>
<comment xml:lang="fi">C-otsake</comment>
<comment xml:lang="fr">en-tête C</comment>
<comment xml:lang="hu">C fejléc</comment>
<comment xml:lang="it">Header C</comment>
<comment xml:lang="ko">C 헤더</comment>
<comment xml:lang="nb">C-kildekodeheader</comment>
<comment xml:lang="nn">C-hovud</comment>
<comment xml:lang="pl">Plik nagłówkowy w C</comment>
<comment xml:lang="sv">C-huvud</comment>
<comment xml:lang="uk">Файл заголовків на C</comment>
<glob pattern="*.h"/>
</mime-type>
......@@ -65,20 +19,6 @@
<sub-class-of type="text/x-chdr"/>
<comment>C++ Header file</comment>
<comment>C++ header</comment>
<comment xml:lang="bg">Заглавен файл на C++</comment>
<comment xml:lang="cs">Hlavička v C++</comment>
<comment xml:lang="de">C++-Header</comment>
<comment xml:lang="es">cabecera de código fuente en C++</comment>
<comment xml:lang="eu">C++ goiburua</comment>
<comment xml:lang="fi">C++-otsake</comment>
<comment xml:lang="fr">en-tête C++</comment>
<comment xml:lang="hu">C++ fejléc</comment>
<comment xml:lang="it">Header C++</comment>
<comment xml:lang="nb">C++-kildekodeheader</comment>
<comment xml:lang="nn">C++-hovud</comment>
<comment xml:lang="pl">Plik nagłówkowy w C++</comment>
<comment xml:lang="sv">C++-huvud</comment>
<comment xml:lang="uk">Файл заголовків на C++</comment>
<glob pattern="*.h"/>
<glob pattern="*.hh"/>
<glob pattern="*.hxx"/>
......@@ -97,37 +37,6 @@
<comment>C++ Source file</comment>
<sub-class-of type="text/x-csrc"/>
<comment>C++ source code</comment>
<comment xml:lang="bg">Изходен код на C++</comment>
<comment xml:lang="ca">codi font en C++</comment>
<comment xml:lang="cs">Zdrojový kód v C++</comment>
<comment xml:lang="cy">Ffynhonnell Rhaglen C++</comment>
<comment xml:lang="da">C++-kildekode</comment>
<comment xml:lang="de">C++-Quelltext</comment>
<comment xml:lang="el">πηγαίος κώδικας C++</comment>
<comment xml:lang="eo">C++-fontkodo</comment>
<comment xml:lang="es">código fuente en C++</comment>
<comment xml:lang="eu">C++ iturburu-kodea</comment>
<comment xml:lang="fi">C++-lähdekoodi</comment>
<comment xml:lang="fr">code source C++</comment>
<comment xml:lang="hu">C++-forráskód</comment>
<comment xml:lang="it">Codice sorgente C++</comment>
<comment xml:lang="ja">C++ ソースコード</comment>
<comment xml:lang="ko">C++ 소스 코드</comment>
<comment xml:lang="lt">C++ pradinis kodas</comment>
<comment xml:lang="ms">Kod sumber C++</comment>
<comment xml:lang="nb">C++-kildekode</comment>
<comment xml:lang="nl">C++-broncode</comment>
<comment xml:lang="nn">C++-kjeldekode</comment>
<comment xml:lang="pl">Kod źródłowy w C++</comment>
<comment xml:lang="pt">código fonte C++</comment>
<comment xml:lang="pt_BR">Código fonte C++</comment>
<comment xml:lang="ru">программа на языке C++</comment>
<comment xml:lang="sq">Kod burues C++</comment>
<comment xml:lang="sr">C++ изворни ко̂д</comment>
<comment xml:lang="sv">C++-källkod</comment>
<comment xml:lang="uk">Вихідний код на мові C++</comment>
<comment xml:lang="zh_CN">C++ 源代码</comment>
<comment xml:lang="zh_TW">C++ 源代碼</comment>
<glob pattern="*.cpp"/>
<glob pattern="*.cc"/>
<glob pattern="*.cxx"/>
......@@ -135,4 +44,15 @@
<glob pattern="*.C"/>
<glob pattern="*.inl"/>
</mime-type>
<mime-type type="text/x-objcsrc">
<comment>Objective-C source code</comment>
<sub-class-of type="text/x-csrc"/>
<magic priority="30">
<match value="#import" type="string" offset="0"/>
</magic>
<glob pattern="*.m"/>
<glob pattern="*.mm"/>
</mime-type>
</mime-info>
......@@ -230,6 +230,8 @@ bool CppHighlighter::isPPKeyword(const QStringRef &text) const
case 6:
if (text.at(0) == 'i' && text == QLatin1String("ifndef"))
return true;
if (text.at(0) == 'i' && text == QLatin1String("import"))
return true;
else if (text.at(0) == 'd' && text == QLatin1String("define"))
return true;
else if (text.at(0) == 'p' && text == QLatin1String("pragma"))
......
......@@ -17,11 +17,14 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Completion Settings</string>
<string>Code Completion</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="caseSensitive">
<property name="toolTip">
<string>Do a case-sensitive match for completion items.</string>
</property>
<property name="text">
<string>&amp;Case-sensitive completion</string>
</property>
......@@ -32,6 +35,9 @@
</item>
<item>
<widget class="QCheckBox" name="autoInsertBraces">
<property name="toolTip">
<string>Automatically insert (, ) and ; when appropriate.</string>
</property>
<property name="text">
<string>&amp;Automatically insert braces</string>
</property>
......@@ -42,6 +48,9 @@
</item>
<item>
<widget class="QCheckBox" name="partiallyComplete">
<property name="toolTip">
<string>Insert the common prefix of available completion items.</string>
</property>
<property name="text">
<string>Autocomplete common &amp;prefix</string>
</property>
......
......@@ -4,34 +4,5 @@
<sub-class-of type="application/xml"/>
<comment>Qt Designer file</comment>
<glob pattern="*.ui"/>
<comment xml:lang="bg">Файл, формат Qt Designer</comment>
<comment xml:lang="ca">fitxer de Qt Designer</comment>
<comment xml:lang="cs">Soubor Qt Designeru</comment>
<comment xml:lang="cy">Ffeil Qt Designer</comment>
<comment xml:lang="da">Qt Designer-fil</comment>
<comment xml:lang="de">QT Designer-Datei</comment>
<comment xml:lang="el">αρχείο Qt Designer</comment>
<comment xml:lang="eo">dosiero de Qt Designer</comment>
<comment xml:lang="es">fichero de Qt Designer</comment>
<comment xml:lang="eu">Qt Designer Fitxategia</comment>
<comment xml:lang="fi">Qt Designer -tiedosto</comment>
<comment xml:lang="fr">fichier Qt Designer</comment>
<comment xml:lang="hu">Qt Designer-fájl</comment>
<comment xml:lang="it">File Qt Designer</comment>
<comment xml:lang="ja">Qt Designer ファイル</comment>
<comment xml:lang="ko">Qt 디자이너 파일</comment>
<comment xml:lang="lt">Qt Designer rinkmena</comment>
<comment xml:lang="ms">Fail Qt Designer</comment>
<comment xml:lang="nb">Qt Designer-fil</comment>
<comment xml:lang="nl">Qt Designer-bestand</comment>
<comment xml:lang="nn">Qt Designer-fil</comment>
<comment xml:lang="pl">Plik Qt Designera</comment>
<comment xml:lang="pt">ficheiro do Qt Designer</comment>
<comment xml:lang="pt_BR">Arquivo do Qt Designer</comment>
<comment xml:lang="ru">файл Qt Designer</comment>
<comment xml:lang="sq">File Qt Designer</comment>
<comment xml:lang="sr">Qt Designer датотека</comment>
<comment xml:lang="sv">Qt Designer-fil</comment>
<comment xml:lang="uk">Файл програми Qt-дизайнер</comment>
</mime-type>
</mime-info>
......@@ -5,37 +5,6 @@
<alias type="text/javascript"/>
<sub-class-of type="text/plain"/>
<comment>Qt Script file</comment>
<comment xml:lang="bg">Програма на JavaScript</comment>
<comment xml:lang="ca">programa JavaScript</comment>
<comment xml:lang="cs">Program v JavaScriptu</comment>
<comment xml:lang="da">JavaScript-program</comment>
<comment xml:lang="de">JavaScript-Programm</comment>
<comment xml:lang="el">πρόγραμμα JavaScript</comment>
<comment xml:lang="eo">JavaScript-programo</comment>
<comment xml:lang="es">programa en JavaScript</comment>
<comment xml:lang="eu">JavaScript programa</comment>
<comment xml:lang="fi">JavaScript-ohjelma</comment>
<comment xml:lang="fr">programme JavaScript</comment>
<comment xml:lang="hu">JavaScript-program</comment>
<comment xml:lang="it">Programma JavaScript</comment>
<comment xml:lang="ja">JavaScript プログラム</comment>
<comment xml:lang="ko">자바스크립트 프로그램</comment>
<comment xml:lang="lt">JavaScript programa</comment>
<comment xml:lang="ms">Program JavaScript</comment>
<comment xml:lang="nb">JavaScript-program</comment>
<comment xml:lang="nl">JavaScript-programma</comment>
<comment xml:lang="nn">JavaScript-program</comment>
<comment xml:lang="pl">Pogram JavaScript</comment>
<comment xml:lang="pt">programa JavaScript</comment>
<comment xml:lang="pt_BR">Programa JavaScript</comment>
<comment xml:lang="ru">программа JavaScript</comment>
<comment xml:lang="sq">program JavaScript</comment>
<comment xml:lang="sr">Јаваскрипт програм</comment>
<comment xml:lang="sv">JavaScript-program</comment>
<comment xml:lang="uk">Програма на мові JavaScript</comment>
<comment xml:lang="vi">Chương trình JavaScript</comment>
<comment xml:lang="zh_CN">JavaScript 程序</comment>
<comment xml:lang="zh_TW">JavaScript 程式</comment>
<glob pattern="*.js"/>
</mime-type>
</mime-info>
......@@ -3,36 +3,6 @@
<mime-type type="text/plain">
<comment>Plain text document</comment>
<sub-class-of type="application/octet-stream"/>
<comment xml:lang="bg">Документ с неформатиран текст</comment>
<comment xml:lang="ca">document de text pla</comment>
<comment xml:lang="cs">Prostý textový dokument</comment>
<comment xml:lang="da">ren tekst-dokument</comment>
<comment xml:lang="de">einfaches Textdokument</comment>
<comment xml:lang="el">έγγραφο απλού κειμένου</comment>
<comment xml:lang="eo">plata teksta dokumento</comment>
<comment xml:lang="es">documento de texto sencillo</comment>
<comment xml:lang="eu">testu soileko dokumentua</comment>
<comment xml:lang="fi">perustekstiasiakirja</comment>
<comment xml:lang="fr">document plein texte</comment>
<comment xml:lang="hu">egyszerű szöveg</comment>
<comment xml:lang="it">Documento in testo semplice</comment>
<comment xml:lang="ja">平文テキストドキュメント</comment>
<comment xml:lang="ko">보통 text 문서</comment>
<comment xml:lang="lt">paprastas tekstinis dokumentas</comment>
<comment xml:lang="ms">Dokumen teks jernih</comment>
<comment xml:lang="nb">vanlig tekstdokument</comment>
<comment xml:lang="nl">platte tekst document</comment>
<comment xml:lang="nn">vanleg tekstdokument</comment>
<comment xml:lang="pl">zwykły dokument tekstowy</comment>
<comment xml:lang="pt">documento em texto simples</comment>
<comment xml:lang="pt_BR">Documento somente texto</comment>
<comment xml:lang="sq">dokument teksti i thjeshtë</comment>
<comment xml:lang="sr">обичан текстуални документ</comment>
<comment xml:lang="sv">vanligt textdokument</comment>
<comment xml:lang="uk">звичайний текстовий документ</comment>
<comment xml:lang="vi">thư nhập thô (văn bản không có kiểu dáng)</comment>
<comment xml:lang="zh_CN">纯文本文档</comment>
<comment xml:lang="zh_TW">普通文本檔</comment>
<glob pattern="*.txt"/>
</mime-type>
<mime-type type="application/xml">
......
......@@ -6,27 +6,144 @@
<rect>
<x>0</x>
<y>0</y>
<width>484</width>
<height>398</height>
<width>428</width>
<height>384</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxTabAndIndentSettings">
<item row="1" column="0">
<widget class="QGroupBox" name="groupBoxStorageSettings">
<property name="title">
<string>Tab/Indent Settings</string>
<string>Storage</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cleanWhitespace">
<property name="toolTip">
<string>Removes trailing whitespace on saving.</string>
</property>
<property name="text">
<string>&amp;Clean whitespace</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="inEntireDocument">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Clean whitespace in entire document instead of only for changed parts.</string>
</property>
<property name="text">
<string>In entire &amp;document</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="cleanIndentationLayout">
<item>
<spacer name="cleanIndentationSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cleanIndentation">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Correct leading whitespace according to tab settings.</string>
</property>
<property name="text">
<string>Clean indentation</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="addFinalNewLine">
<property name="text">
<string>&amp;Ensure newline at end of file</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBoxInteractionSettings">
<property name="title">
<string>Interaction</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="autoIndent">
<widget class="QCheckBox" name="useVim">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Enable automatic &amp;indentation</string>
<string>Use &quot;vi&quot; style editing</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxTabAndIndentSettings">
<property name="title">
<string>Tabs and Indentation</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
......@@ -89,13 +206,6 @@
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="insertSpaces">
<property name="text">
<string>Insert &amp;spaces instead of tabs</string>
</property>
</widget>
</item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
......@@ -145,8 +255,11 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="smartBackspace">
<property name="toolTip">
<string>Backspace will go back one indentation level instead of one space.</string>
</property>
<property name="text">
<string>&amp;Backspace follows indentation</string>
</property>
......@@ -168,121 +281,23 @@
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBoxStorageSettings">
<property name="title">
<string>Storage Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="cleanWhitespace">
<property name="text">
<string>&amp;Clean whitespace</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>