diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 0c3ca291a0748b4f1958ae804960668c282e2e41..523d203aefa232ff43243d6a55990563223bad2a 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -70,7 +70,7 @@ <message> <location filename="../../../src/plugins/bineditor/bineditorplugin.cpp" line="+446"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+3"/> @@ -360,7 +360,7 @@ <message> <location filename="../../../src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp" line="+123"/> <source>CMake Wizard</source> - <translation>CMake Assistent</translation> + <translation>CMake-Assistent</translation> </message> </context> <context> @@ -696,7 +696,7 @@ <message> <location line="+3"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+3"/> @@ -734,7 +734,7 @@ <translation>Die Datei wurde geändert. Möchten Sie die Änderungen rückgängig machen?</translation> </message> <message> - <location line="+78"/> + <location line="+80"/> <source>The commit list spans several repositories (%1). Please commit them one by one.</source> <translation>Die abzugebenden Dateien umfassen mehrere Repositories. Bitte geben Sie sie einzeln ab.</translation> </message> @@ -754,7 +754,7 @@ <translation>Es konnte keine temporäre Datei erstellt werden: %1</translation> </message> <message> - <location line="+105"/> + <location line="+108"/> <source>Project status</source> <translation>Status des Projekts</translation> </message> @@ -796,7 +796,7 @@ <message> <location line="+3"/> <source>The process terminated abnormally.</source> - <translation>Der Prozess wurde in unnormaler Weise beendet.</translation> + <translation type="unfinished">Der Prozess wurde in anormaler Weise beendet.</translation> </message> <message> <location line="+3"/> @@ -907,7 +907,7 @@ <context> <name>CVSPlugin</name> <message> - <location filename="../../../src/plugins/cvs/cvsplugin.cpp" line="-1039"/> + <location filename="../../../src/plugins/cvs/cvsplugin.cpp" line="-1044"/> <source>Cannot find repository for '%1'</source> <translation>Das Repository der Datei '%1' konnte nicht gefunden werden</translation> </message> @@ -1170,7 +1170,7 @@ <location/> <source>When this option is checked, 'Step Into' compresses several steps into one in certain situations, leading to 'less noisy' debugging. So will, e.g., the atomic reference counting code be skipped, and a single 'Step Into' for a signal emission will end up directly in the slot connected to it.</source> - <translation>Diese Option bewirkt, dass 'Einzelschritt in' in bestimmten Situationen mehrere Schritte zusammenfaßt, was das Debuggen beschleunigt. Zum Beispiel wird der Code des atomaren Referenzzählung übersprungen; und bei der Emission eines Signals gelangt man zum verbundenen Slot.</translation> + <translation>Diese Option bewirkt, dass 'Einzelschritt in' in bestimmten Situationen mehrere Schritte zusammenfasst, was das Debuggen beschleunigt. Zum Beispiel wird der Code des atomaren Referenzzählung übersprungen; und bei der Emission eines Signals gelangt man zum verbundenen Slot.</translation> </message> <message> <location/> @@ -1190,7 +1190,7 @@ <message> <location/> <source>Use alternating row colors in debug views</source> - <translation>Alternierende Farben für Debugansichten benutzen</translation> + <translation>Alternierende Farben für Debug-Ansichten benutzen</translation> </message> <message> <location/> @@ -1670,7 +1670,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+7"/> <source>Split Top/Bottom</source> - <translation>Open/unten teilen</translation> + <translation type="unfinished">Oben/unten teilen</translation> </message> <message> <location line="+7"/> @@ -1863,7 +1863,7 @@ Sollen sie überschrieben werden?</translation> <translation>Ausgaben</translation> </message> <message> - <location line="+161"/> + <location line="+162"/> <source>&File</source> <translation>&Datei</translation> </message> @@ -1949,7 +1949,7 @@ Sollen sie überschrieben werden?</translation> <location line="+5"/> <location line="+4"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+5"/> @@ -2194,7 +2194,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+35"/> <source>Plugin Details of %1</source> - <translation>Pluginbeschreibung zu %1</translation> + <translation>Beschreibung zu %1</translation> </message> <message> <location line="+20"/> @@ -2342,19 +2342,19 @@ Sollen sie überschrieben werden?</translation> <context> <name>CppEditor::Internal::CPPEditor</name> <message> - <location filename="../../../src/plugins/cppeditor/cppeditor.cpp" line="+615"/> + <location filename="../../../src/plugins/cppeditor/cppeditor.cpp" line="+616"/> <source>Sort alphabetically</source> <translation>Alphabetisch sortieren</translation> </message> <message> - <location line="+163"/> + <location line="+188"/> <source>This change cannot be undone.</source> <translation>Diese Änderung kann nicht rückgängig gemacht werden.</translation> </message> <message> <location line="+1"/> <source>Yes, I know what I am doing.</source> - <translation>Ja, Ich bin mir dessen bewußt.</translation> + <translation>Ja, Ich bin mir dessen bewusst.</translation> </message> </context> <context> @@ -2402,7 +2402,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>CppEditor::Internal::CppPlugin</name> <message> - <location filename="../../../src/plugins/cppeditor/cppplugin.cpp" line="+174"/> + <location filename="../../../src/plugins/cppeditor/cppplugin.cpp" line="+189"/> <source>C++</source> <translation>C++</translation> </message> @@ -2437,7 +2437,7 @@ Sollen sie überschrieben werden?</translation> <translation>Erzeugt C++-Header- und Quelldatei für eine neue Klasse</translation> </message> <message> - <location line="+11"/> + <location line="+12"/> <source>Follow Symbol under Cursor</source> <translation>Symbol unter Einfügemarke verfolgen</translation> </message> @@ -2461,6 +2461,11 @@ Sollen sie überschrieben werden?</translation> <source>Rename Symbol under Cursor</source> <translation>Symbol unter Einfügemarke umbenennen</translation> </message> + <message> + <location line="+12"/> + <source>Update code model</source> + <translation>Code-Modell aktualisieren</translation> + </message> </context> <context> <name>CppFileSettingsPage</name> @@ -2537,7 +2542,7 @@ Sollen sie überschrieben werden?</translation> <message> <location filename="../../../src/plugins/cpptools/cppcurrentdocumentfilter.h" line="+53"/> <source>Methods in current Document</source> - <translation>Methoden im aktuellenDokument</translation> + <translation>Methoden im aktuellen Dokument</translation> </message> </context> <context> @@ -2583,7 +2588,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>CppTools::Internal::CppFindReferences</name> <message> - <location filename="../../../src/plugins/cpptools/cppfindreferences.cpp" line="+239"/> + <location filename="../../../src/plugins/cpptools/cppfindreferences.cpp" line="+235"/> <source>Searching...</source> <translation>Suche...</translation> </message> @@ -2599,7 +2604,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>CppTools::Internal::CppModelManager</name> <message> - <location filename="../../../src/plugins/cpptools/cppmodelmanager.cpp" line="+319"/> + <location filename="../../../src/plugins/cpptools/cppmodelmanager.cpp" line="+327"/> <source>Scanning</source> <translation>Suche</translation> </message> @@ -2620,7 +2625,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>CppTools::Internal::CppToolsPlugin</name> <message> - <location filename="../../../src/plugins/cpptools/cpptoolsplugin.cpp" line="+120"/> + <location filename="../../../src/plugins/cpptools/cpptoolsplugin.cpp" line="+126"/> <source>&C++</source> <translation>&C++</translation> </message> @@ -2858,7 +2863,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="-58"/> <source>Process ID</source> - <translation>Prozess-Id'</translation> + <translation>Prozess-Id</translation> </message> <message> <location line="+1"/> @@ -2986,7 +2991,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+6"/> <source>Breakpoint will only be hit after being ignored so many times.</source> - <translation>Der Haltepunkt wird ausgelöst, nachdem er vorherh so viele Male übersprungen wurde.</translation> + <translation>Der Haltepunkt wird ausgelöst, nachdem er vorher so viele Male übersprungen wurde.</translation> </message> </context> <context> @@ -3156,7 +3161,7 @@ Sollen sie überschrieben werden?</translation> <translation>Die Ausführung des Prozesses kann nicht fortgesetzt werden: %1</translation> </message> <message> - <location line="+24"/> + <location line="+31"/> <source>Reverse stepping is not implemented.</source> <translation>Die Funktionalität für 'Einzelschritt rückwärts' ist nicht implementiert.</translation> </message> @@ -3166,17 +3171,16 @@ Sollen sie überschrieben werden?</translation> <translation>Für den Thread %1 ist kein Einzelschritt möglich.</translation> </message> <message> - <location line="+27"/> + <location line="+37"/> <source>Stepping %1</source> <translation>Führe Schritt aus (%1)</translation> </message> <message> - <location line="+63"/> <source>Running to 0x%1...</source> - <translation>Ausführung bis zur Adresse 0x%1...</translation> + <translation type="obsolete">Ausführung bis zur Adresse 0x%1...</translation> </message> <message> - <location line="+67"/> + <location line="+94"/> <source>Running requested...</source> <translation>Fortsetzung angefordert...</translation> </message> @@ -3257,7 +3261,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+1"/> <source>debugger call</source> - <translation>Debuggeraufruf</translation> + <translation>Debugger-Aufruf</translation> </message> <message> <location line="+5"/> @@ -3557,7 +3561,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>Debugger::Internal::DebuggerRunControlFactory</name> <message> - <location filename="../../../src/plugins/debugger/debuggerrunner.cpp" line="+79"/> + <location filename="../../../src/plugins/debugger/debuggerrunner.cpp" line="+80"/> <source>Debug</source> <translation>Debuggen</translation> </message> @@ -3565,7 +3569,7 @@ Sollen sie überschrieben werden?</translation> <context> <name>Debugger::Internal::DebuggerRunControl</name> <message> - <location line="+108"/> + <location line="+123"/> <source>Debugger</source> <translation>Debugger</translation> </message> @@ -3575,7 +3579,7 @@ Sollen sie überschrieben werden?</translation> <message> <location filename="../../../src/plugins/debugger/debuggeractions.cpp" line="+118"/> <source>Debugger properties...</source> - <translation>Debuggereinstellungen...</translation> + <translation>Debugger-Einstellungen...</translation> </message> <message> <location line="+6"/> @@ -3710,7 +3714,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+9"/> <source>Show address data in stack view when debugging</source> - <translation>Addressen im Stack-Fenster anzeigen</translation> + <translation>Adressen im Stack-Fenster anzeigen</translation> </message> <message> <location line="+1"/> @@ -3776,7 +3780,7 @@ Sollen sie überschrieben werden?</translation> <message> <location line="+3"/> <source>The last waitFor...() function timed out. The state of QProcess is unchanged, and you can try calling waitFor...() again.</source> - <translation>Zeitüberschreitung bei der letzten waitFor...()-Funktion. Der Status des QProcess ist unverändert, und waitFor...() kann nocheinmal gerufen.</translation> + <translation>Zeitüberschreitung bei der letzten waitFor...()-Funktion. Der Status des QProcess ist unverändert, und waitFor...() kann noch einmal gerufen.</translation> </message> <message> <location line="+4"/> @@ -3834,7 +3838,7 @@ Sollen sie überschrieben werden?</translation> <translation>Der Prozess konnte nicht gestartet werden.</translation> </message> <message> - <location line="+417"/> + <location line="+423"/> <source><p>The inferior stopped because it received a signal from the Operating System.<p><table><tr><td>Signal name : </td><td>%1</td></tr><tr><td>Signal meaning : </td><td>%2</td></tr></table></source> <translation><p>Der Prozess wurde nach Erhalt eines Signals vom Betriebssystem angehalten.<p><table><tr><td>Name des Signals : </td><td>%1</td></tr><tr><td>Bedeutung : </td><td>%2</td></tr></table></translation> </message> @@ -3850,7 +3854,7 @@ Sollen sie überschrieben werden?</translation> <translation>Signal erhalten</translation> </message> <message> - <location line="-763"/> + <location line="-769"/> <source>Reading %1...</source> <translation>Lese %1...</translation> </message> @@ -3860,12 +3864,12 @@ Sollen sie überschrieben werden?</translation> <translation>Sprung ausgeführt/ Angehalten.</translation> </message> <message> - <location line="+164"/> + <location line="+165"/> <source>Loading %1...</source> <translation>Lade %1...</translation> </message> <message> - <location line="+79"/> + <location line="+84"/> <source>Stopped at breakpoint.</source> <translation>An Haltepunkt angehalten.</translation> </message> @@ -3889,12 +3893,12 @@ Das Debuggen wird wahrscheinlich nicht richtig funktionieren. Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> </message> <message> - <location line="-560"/> + <location line="-566"/> <source>Processing queued commands.</source> <translation>Kommando-Warteschlange wird abgearbeitet.</translation> </message> <message> - <location line="+504"/> + <location line="+510"/> <location line="+109"/> <source>Stopped.</source> <translation>Angehalten.</translation> @@ -3984,7 +3988,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> </translation> </message> <message> - <location line="-2855"/> + <location line="-2861"/> <source>An unknown error in the Gdb process occurred. </source> <translation>Im Gdb-Prozess trat ein unbekannter Fehler auf.</translation> </message> @@ -4012,7 +4016,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <translation>Fehler bei Ausführung: %1</translation> </message> <message> - <location line="+227"/> + <location line="+228"/> <source>Program exited with exit code %1.</source> <translation>Das Programm wurde beendet, Rückgabewert %1.</translation> </message> @@ -4027,7 +4031,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <translation>Das Programm wurde normal beendet.</translation> </message> <message> - <location line="+483"/> + <location line="+488"/> <source>Continuing after temporary stop...</source> <translation>Setze nach temporärem Anhalten fort...</translation> </message> @@ -4074,7 +4078,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <message> <location line="+708"/> <source>Jumping out of bogus frame...</source> - <translation>Verlasse ungültigen Stack-Frame...</translation> + <translation>Verlasse ungültigen Stack-Rahmen...</translation> </message> <message> <location line="+903"/> @@ -4145,27 +4149,27 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <translation>Der Start des Adapters schlug fehl</translation> </message> <message> - <location line="+24"/> + <location line="+39"/> <source>Setting breakpoints...</source> <translation>Setze Haltepunkte...</translation> </message> <message> - <location line="-8"/> + <location line="-23"/> <source>Starting inferior...</source> <translation>Starte zu debuggenden Prozess...</translation> </message> <message> - <location line="+30"/> + <location line="+45"/> <source>Inferior start failed</source> <translation>Der Start des zu debuggenden Prozesses schlug fehl</translation> </message> <message> - <location line="-2963"/> + <location line="-2978"/> <source>Inferior shutdown failed</source> <translation>Das Beenden des zu debuggenden Prozesses schlug fehl</translation> </message> <message> - <location line="+2983"/> + <location line="+2998"/> <source>Adapter crashed</source> <translation>Der Adapter ist abgestürzt</translation> </message> @@ -4325,7 +4329,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <message> <location filename="../../../src/plugins/debugger/gdb/plaingdbadapter.cpp" line="+79"/> <source>Cannot set up communication with child process: %1</source> - <translation>Die Kommunikation mit dem untergeordneten Prozesss konnte nicht hergestellt werden: %1</translation> + <translation>Die Kommunikation mit dem untergeordneten Prozess konnte nicht hergestellt werden: %1</translation> </message> <message> <location line="+36"/> @@ -4480,17 +4484,30 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <translation>Angehalten.</translation> </message> </context> +<context> + <name>Debugger::Internal::SourceFilesModel</name> + <message> + <location filename="../../../src/plugins/debugger/sourcefileswindow.cpp" line="+98"/> + <source>Internal name</source> + <translation>Interner Name</translation> + </message> + <message> + <location line="+1"/> + <source>Full name</source> + <translation>Vollständiger Name</translation> + </message> +</context> <context> <name>Debugger::Internal::SourceFilesWindow</name> <message> - <location filename="../../../src/plugins/debugger/sourcefileswindow.cpp" line="+175"/> + <location line="+76"/> <source>Source Files</source> <translation>Quelldateien</translation> </message> <message> <location line="+27"/> <source>Reload data</source> - <translation>Daten akualisieren</translation> + <translation>Daten aktualisieren</translation> </message> <message> <location line="+5"/> @@ -4710,7 +4727,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <context> <name>Debugger::Internal::TrkGdbAdapter</name> <message> - <location filename="../../../src/plugins/debugger/gdb/trkgdbadapter.cpp" line="+1597"/> + <location filename="../../../src/plugins/debugger/gdb/trkgdbadapter.cpp" line="+1605"/> <source>Process started, PID: 0x%1, thread id: 0x%2, code segment: 0x%3, data segment: 0x%4.</source> <translation>Der Prozess wurde gestartet, PID: 0x%1, Thread-Id: 0x%2, Code-Segment: 0x%3, Datensegment: 0x%4.</translation> </message> @@ -4742,7 +4759,7 @@ Es wird empfohlen, gdb 6.7 oder später zu benutzen.</translation> <message> <location/> <source>Communication</source> - <translation>Kommunkation</translation> + <translation>Kommunikation</translation> </message> <message> <location/> @@ -5485,7 +5502,7 @@ It also automatically sets the correct Qt version.</source> <message> <location line="+2"/> <source>Could not open file for read: %1</source> - <translation>Die Datei konnte nicht zum Lesen geöffnen werden: %1</translation> + <translation>Die Datei konnte nicht zum Lesen geöffnet werden: %1</translation> </message> <message> <location line="+16"/> @@ -5655,17 +5672,17 @@ Grund: %3</translation> <context> <name>FakeVim::Internal::FakeVimHandler</name> <message> - <location filename="../../../src/plugins/fakevim/fakevimhandler.cpp" line="+939"/> + <location filename="../../../src/plugins/fakevim/fakevimhandler.cpp" line="+946"/> <source>Not implemented in FakeVim</source> <translation>In FakeVim nicht implementiert</translation> </message> <message> - <location line="-695"/> + <location line="-696"/> <source>E20: Mark '%1' not set</source> <translation>E20: Die Marke '%1' ist nicht gesetzt</translation> </message> <message> - <location line="+671"/> + <location line="+672"/> <source>%1%2%</source> <translation>%1%2%</translation> </message> @@ -5738,7 +5755,7 @@ Grund: %3</translation> <translation>Die Suche hat den Anfang erreicht, setze am Ende fort</translation> </message> <message> - <location line="+575"/> + <location line="+582"/> <source>Already at oldest change</source> <translation>Älteste Änderung erreicht</translation> </message> @@ -5878,7 +5895,7 @@ Grund: %3</translation> <message> <location/> <source>Incremental search:</source> - <translation>Inkrimentelle Suche:</translation> + <translation>Inkrementelle Suche:</translation> </message> </context> <context> @@ -6018,7 +6035,7 @@ Grund: %3</translation> <message> <location line="+5"/> <source>Replace && Find Previous</source> - <translation>Ersetzen und rückwarts weitersuchen</translation> + <translation>Ersetzen und rückwärts weitersuchen</translation> </message> <message> <location line="+8"/> @@ -6529,7 +6546,7 @@ Grund: %3</translation> <context> <name>Git::Internal::GitClient</name> <message> - <location filename="../../../src/plugins/git/gitclient.cpp" line="+71"/> + <location filename="../../../src/plugins/git/gitclient.cpp" line="+76"/> <source>Note that the git plugin for QtCreator is not able to interact with the server so far. Thus, manual ssh-identification etc. will not work.</source> <translatorcomment>Not used.</translatorcomment> <translation type="unfinished"></translation> @@ -6558,7 +6575,7 @@ Grund: %3</translation> <translation>Warte auf Daten...</translation> </message> <message> - <location line="+100"/> + <location line="+101"/> <source>Git Diff</source> <translation>Git Diff</translation> </message> @@ -6583,7 +6600,7 @@ Grund: %3</translation> <translation>Git Blame %1</translation> </message> <message numerus="yes"> - <location line="+56"/> + <location line="+58"/> <source>Unable to add %n file(s) to %1: %2</source> <translation> <numerusform>Keine der %n Dateien konnte zu %1 hinzugefügt werden: %2</numerusform> @@ -6622,7 +6639,7 @@ Grund: %3</translation> <translation>Das Kommando 'show' konnte nicht ausgeführt werden: %1: %2</translation> </message> <message> - <location line="+148"/> + <location line="+149"/> <source>Changes</source> <translation>Änderungen</translation> </message> @@ -6672,12 +6689,12 @@ Grund: %3</translation> <translation>Die Datei wurde geändert. Möchten Sie die Änderungen rückgängig machen?</translation> </message> <message> - <location line="+24"/> + <location line="+26"/> <source>The file is not modified.</source> <translation>Datei ungeändert.</translation> </message> <message> - <location line="+22"/> + <location line="+23"/> <source>There are no modified files.</source> <translation>Es gibt keine geänderten Dateien.</translation> </message> @@ -6685,7 +6702,7 @@ Grund: %3</translation> <context> <name>Git::Internal::GitPlugin</name> <message> - <location filename="../../../src/plugins/git/gitplugin.cpp" line="+232"/> + <location filename="../../../src/plugins/git/gitplugin.cpp" line="+233"/> <source>&Git</source> <translation>&Git</translation> </message> @@ -6897,7 +6914,7 @@ Grund: %3</translation> <message> <location line="+3"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+3"/> @@ -6905,7 +6922,7 @@ Grund: %3</translation> <translation>&Wiederholen</translation> </message> <message> - <location line="+60"/> + <location line="+65"/> <source>Could not find working directory</source> <translation>Das Arbeitsverzeichnis konnte nicht gefunden werden.</translation> </message> @@ -7655,7 +7672,7 @@ Grund: %3</translation> <message> <location line="+3"/> <source>Open Link in New Tab Ctrl+LMB</source> - <translation>Link in neuem Reiter öffnen\t(Ctrl+Linke Maustaste)</translation> + <translation>Link in neuem Reiter öffnen (Strg+Linke Maustaste)</translation> </message> </context> <context> @@ -7681,7 +7698,7 @@ Grund: %3</translation> <message> <location filename="../../../src/plugins/debugger/debuggeroutputwindow.cpp" line="+76"/> <source>Type Ctrl-<Return> to execute a line.</source> - <translation>Sie können eine Zeile mittels <Ctrl-Return> ausführen.</translation> + <translation>Sie können eine Zeile mittels <Strg+Return> ausführen.</translation> </message> </context> <context> @@ -7865,12 +7882,12 @@ in your .pro file.</source> <message> <location line="+1"/> <source>C Header file</source> - <translation>C-Headerdatei</translation> + <translation>C-Header-Datei</translation> </message> <message> <location line="+1"/> <source>C++ Header file</source> - <translation>C++-Headerdatei</translation> + <translation>C++-Header-Datei</translation> </message> <message> <location line="+1"/> @@ -8584,7 +8601,7 @@ p, li { white-space: pre-wrap; } <message> <location line="+3"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+3"/> @@ -8602,7 +8619,7 @@ p, li { white-space: pre-wrap; } <translation>Die Datei wurde geändert. Möchten Sie die Änderungen rückgängig machen?</translation> </message> <message> - <location line="+93"/> + <location line="+98"/> <source>Another submit is currently executed.</source> <translation>Es läuft bereits ein Submit-Vorgang.</translation> </message> @@ -8651,7 +8668,7 @@ p, li { white-space: pre-wrap; } <message> <location line="+3"/> <source>The process terminated abnormally.</source> - <translation>Der Prozess wurde in unnormaler Weise beendet.</translation> + <translation>Der Prozess wurde in abnormaler Weise beendet.</translation> </message> <message> <location line="+3"/> @@ -8782,7 +8799,7 @@ p, li { white-space: pre-wrap; } <message> <location/> <source>P4 Port:</source> - <translation>P4 Portnummer:</translation> + <translation>P4 Port-Nummer:</translation> </message> <message> <location filename="../../../src/plugins/perforce/settingspage.cpp" line="+106"/> @@ -8861,7 +8878,7 @@ p, li { white-space: pre-wrap; } <message> <location line="+33"/> <source>Plugin Details of %1</source> - <translation>Pluginbeschreibung zu %1</translation> + <translation>Beschreibung zu %1</translation> </message> <message> <location line="+20"/> @@ -8953,7 +8970,7 @@ p, li { white-space: pre-wrap; } <message> <location line="+6"/> <source>Plugin initialization failed: %1</source> - <translation>Die Initialisierungs des Plugins schlug fehl: %1</translation> + <translation>Die Initialisierung des Plugins schlug fehl: %1</translation> </message> <message> <location line="+19"/> @@ -10006,7 +10023,7 @@ Fehler: %2</translation> <message> <location line="+5"/> <source>Cannot retrieve debugging output!</source> - <translation>Es konnte keine Debugausgabe erhalten werden!</translation> + <translation>Es konnte keine Debug-Ausgabe erhalten werden!</translation> </message> </context> <context> @@ -11024,12 +11041,12 @@ unter Versionsverwaltung (%2) gestellt werden?</translation> <message> <location filename="../../../src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizard.cpp" line="+43"/> <source>Qt4 Designer Custom Widget</source> - <translation>Benutzerdefinertes Widget für Qt4 Designer</translation> + <translation>Benutzerdefiniertes Widget für Qt4 Designer</translation> </message> <message> <location line="+1"/> <source>Creates a Qt4 Designer Custom Widget or a Custom Widget Collection.</source> - <translation>Erstellt ein oder mehrere benutzerdefinerte Widgets für Qt4 Designer.</translation> + <translation>Erstellt ein oder mehrere benutzerdefinierte Widgets für Qt4 Designer.</translation> </message> </context> <context> @@ -11037,7 +11054,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation> <message> <location filename="../../../src/plugins/qt4projectmanager/customwidgetwizard/customwidgetwizarddialog.cpp" line="+56"/> <source>This wizard generates a Qt4 Designer Custom Widget or a Qt4 Designer Custom Widget Collection project.</source> - <translation>Dieser Wizard erstellt ein Projekt mit einem oder mehreren benutzerdefinerten Widgets für Qt4 Designer.</translation> + <translation>Dieser Wizard erstellt ein Projekt mit einem oder mehreren benutzerdefinierten Widgets für Qt4 Designer.</translation> </message> </context> <context> @@ -11405,7 +11422,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation> <message> <location filename="../../../src/plugins/qt4projectmanager/customwidgetwizard/plugingenerator.cpp" line="+60"/> <source>Cannot open icon file %1.</source> - <translation>DIe Icon-Datei %1 kann nicht geöffnet werden.</translation> + <translation>Die Icon-Datei %1 kann nicht geöffnet werden.</translation> </message> <message> <location line="+102"/> @@ -11733,7 +11750,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation> <name>Qt4ProjectManager::Internal::Qt4RunConfiguration</name> <message> <location filename="../../../src/plugins/qt4projectmanager/qt4runconfiguration.cpp" line="+72"/> - <location line="+458"/> + <location line="+459"/> <source>Qt4RunConfiguration</source> <translation>Qt4RunConfiguration</translation> </message> @@ -11880,7 +11897,7 @@ unter Versionsverwaltung (%2) gestellt werden?</translation> <translation><html><body><table><tr><td>Datei:</td><td><pre>%1</pre></td></tr><tr><td>Letzte Änderung:</td><td>%2</td></tr><tr><td>Größe:</td><td>%3 Bytes</td></tr></table></body></html></translation> </message> <message> - <location line="+124"/> + <location line="+126"/> <source>The Qt Version identified by %1 is not installed. Run make install</source> <translation>Die Qt-Version %1 ist nicht installiert. Führen Sie make install aus</translation> </message> @@ -12182,7 +12199,7 @@ Bitte prüfen Sie, ob das Gerät verbunden ist und die Anwendung 'TRK' <message> <location line="+8"/> <source>Debugger for Symbian Platform</source> - <translation>Debugger für Symbian-Platform</translation> + <translation>Debugger für Symbian-Plattform</translation> </message> <message> <location line="+12"/> @@ -12552,7 +12569,7 @@ Installiere Anwendung auf '%2'...</translation> <message> <location line="+40"/> <source><font color="#0000ff">Configuration unchanged, skipping QMake step.</font></source> - <translation><font color="#0000ff">Konfiguration unverändert, übersrpinge QMake-Schritt.</font></translation> + <translation><font color="#0000ff">Konfiguration unverändert, überspringe QMake-Schritt.</font></translation> </message> </context> <context> @@ -12643,7 +12660,7 @@ Installiere Anwendung auf '%2'...</translation> <context> <name>Qt4ProjectManager::QtVersionManager</name> <message> - <location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+351"/> + <location filename="../../../src/plugins/qt4projectmanager/qtversionmanager.cpp" line="+347"/> <source><not found></source> <translation><nicht gefunden></translation> </message> @@ -12679,7 +12696,7 @@ Installiere Anwendung auf '%2'...</translation> <translation>Vorgabe:</translation> </message> <message> - <location line="+8"/> + <location line="+7"/> <source>Compiler:</source> <translation>Compiler:</translation> </message> @@ -12697,7 +12714,7 @@ Installiere Anwendung auf '%2'...</translation> <context> <name>QApplication</name> <message> - <location line="+872"/> + <location line="+870"/> <source>The Qt Version has no toolchain.</source> <translation>Dieser Qt-Version ist keine Toolchain zugeordnet.</translation> </message> @@ -12868,15 +12885,14 @@ Installiere Anwendung auf '%2'...</translation> <context> <name>QtScriptEditor::Internal::QtScriptEditorActionHandler</name> <message> - <location filename="../../../src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp" line="+96"/> <source>Qt Script Error</source> - <translation>Fehler in Qt-Skript</translation> + <translation type="obsolete">Fehler in Qt-Skript</translation> </message> </context> <context> <name>QtScriptEditor::Internal::QtScriptEditorPlugin</name> <message> - <location filename="../../../src/plugins/qtscripteditor/qtscripteditorplugin.cpp" line="+97"/> + <location filename="../../../src/plugins/qtscripteditor/qtscripteditorplugin.cpp" line="+102"/> <source>Creates a Qt Script file.</source> <translation>Erzeugt eine Qt-Skript-Datei.</translation> </message> @@ -12891,20 +12907,18 @@ Installiere Anwendung auf '%2'...</translation> <translation>Qt</translation> </message> <message> - <location line="+56"/> <source>Run</source> - <translation>Ausführen</translation> + <translation type="obsolete">Ausführen</translation> </message> <message> - <location line="+2"/> <source>Ctrl+R</source> - <translation>Ctrl+R</translation> + <translation type="obsolete">Ctrl+R</translation> </message> </context> <context> <name>QtScriptEditor::Internal::ScriptEditor</name> <message> - <location filename="../../../src/plugins/qtscripteditor/qtscripteditor.cpp" line="+228"/> + <location filename="../../../src/plugins/qtscripteditor/qtscripteditor.cpp" line="+229"/> <source><Select Symbol></source> <translation><Symbol auswählen></translation> </message> @@ -13271,7 +13285,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <message> <location line="+12"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+1"/> @@ -13544,14 +13558,12 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <context> <name>SourceFilesModel</name> <message> - <location filename="../../../src/plugins/debugger/sourcefileswindow.cpp" line="-112"/> <source>Internal name</source> - <translation>Interner Name</translation> + <translation type="obsolete">Interner Name</translation> </message> <message> - <location line="+1"/> <source>Full name</source> - <translation>Vollständiger Name</translation> + <translation type="obsolete">Vollständiger Name</translation> </message> </context> <context> @@ -13802,7 +13814,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <message> <location line="+3"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+3"/> @@ -13825,12 +13837,12 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <translation>Die Ãœberprüfung der Beschreibung schlug fehl. Möchten Sie den Commit trotzdem ausführen?</translation> </message> <message> - <location line="+204"/> + <location line="+205"/> <source>The commit list spans several repositories (%1). Please commit them one by one.</source> <translation>Die abzugebenden Dateien umfassen mehrere Repositories (%1). Bitte geben Sie sie einzeln ab.</translation> </message> <message> - <location line="+283"/> + <location line="+286"/> <source>Executing: %1 %2 </source> <extracomment>Executing: <executable> <arguments></extracomment> @@ -13838,12 +13850,12 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich </translation> </message> <message> - <location line="-363"/> + <location line="-367"/> <source>The file has been changed. Do you want to revert it?</source> <translation>Die Datei wurde geändert. Möchten Sie sie zurücksetzen?</translation> </message> <message> - <location line="+98"/> + <location line="+99"/> <source>Another commit is currently being executed.</source> <translation>Es läuft bereits ein Abgabevorgang.</translation> </message> @@ -13858,7 +13870,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <translation>Es konnte keine temporäre Datei erstellt werden: %1</translation> </message> <message> - <location line="+186"/> + <location line="+189"/> <source>Describe</source> <translation>Beschreibe</translation> </message> @@ -13881,7 +13893,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <message> <location line="+3"/> <source>The process terminated abnormally.</source> - <translation>Der Prozess wurde in unnormaler Weise beendet.</translation> + <translation>Der Prozess wurde in anormaler Weise beendet.</translation> </message> <message> <location line="+3"/> @@ -13963,7 +13975,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <context> <name>TextEditor::BaseTextEditorEditable</name> <message> - <location line="+4311"/> + <location line="+4324"/> <source>Line: %1, Col: %2</source> <translation>Zeile: %1, Spalte: %2</translation> </message> @@ -14202,7 +14214,7 @@ Um es abzurufen, tippen Sie das Kürzel im Locator, gefolgt von einem Leerzeich <message> <location filename="../../../src/plugins/texteditor/codecselector.cpp" line="+72"/> <source>Text Encoding</source> - <translation>Text Encoding</translation> + <translation>Text-Encoding</translation> </message> <message> <location line="+4"/> @@ -14355,7 +14367,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation> <message> <location filename="../../../src/plugins/texteditor/linenumberfilter.h" line="+52"/> <source>Line in current document</source> - <translation>Zeile im aktuellenDokument</translation> + <translation>Zeile im aktuellen Dokument</translation> </message> <message> <location filename="../../../src/plugins/texteditor/linenumberfilter.cpp" line="+55"/> @@ -14411,7 +14423,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation> <message> <location filename="../../../src/plugins/texteditor/texteditoractionhandler.cpp" line="+117"/> <source>&Undo</source> - <translation>&Rückgangig</translation> + <translation>&Rückgängig</translation> </message> <message> <location line="+2"/> @@ -15569,7 +15581,7 @@ Namen <E-Mail> Alias <E-Mail?</translation> <context> <name>VCSManager</name> <message> - <location filename="../../../src/plugins/coreplugin/vcsmanager.cpp" line="+132"/> + <location filename="../../../src/plugins/coreplugin/vcsmanager.cpp" line="+144"/> <source>Version Control</source> <translation>Versionskontrolle</translation> </message> diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index ab8ef268bb8af55351299992387b425aae20a43f..bd86eecaae1611ece967ebffa266447978036975 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -42,6 +42,7 @@ #include <QtCore/QByteArray> #include <QtCore/QBitArray> +#include <QtCore/QDir> #include <QtCore/QtDebug> /*! @@ -108,7 +109,7 @@ private: Document::Document(const QString &fileName) - : _fileName(fileName), + : _fileName(QDir::cleanPath(fileName)), _globalNamespace(0), _revision(0) { @@ -173,7 +174,7 @@ QStringList Document::includedFiles() const void Document::addIncludeFile(const QString &fileName, unsigned line) { - _includes.append(Include(fileName, line)); + _includes.append(Include(QDir::cleanPath(fileName), line)); } void Document::appendMacro(const Macro ¯o) @@ -569,3 +570,8 @@ QStringList Snapshot::dependsOn(const QString &fileName) const return deps; } + +Document::Ptr Snapshot::value(const QString &fileName) const +{ + return QMap<QString, Document::Ptr>::value(QDir::cleanPath(fileName)); +} diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 596bee794b33aec14a1145ffbeea3d08cd7551d4..0f879b872d259978c8b754e901a094153a3c40c1 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -341,6 +341,7 @@ public: QStringList dependsOn(const QString &fileName) const; void insert(Document::Ptr doc); + Document::Ptr value(const QString &fileName) const; using _Base::insert; diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 8fe7762758f638830b906fb373665aef56879492..8d5016250195fc31d1ecfbc01df9912939b4fc4c 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -121,8 +121,7 @@ void FindUsages::reportResult(unsigned tokenIndex) const int len = tk.f.length; if (_future) { - const QString path = QDir::toNativeSeparators(_doc->fileName()); - _future->reportResult(Usage(path, line, lineText, col, len)); + _future->reportResult(Usage(_doc->fileName(), line, lineText, col, len)); } _references.append(tokenIndex); diff --git a/src/libs/utils/codegeneration.cpp b/src/libs/utils/codegeneration.cpp index c0b1a64356ac225b07d5db7ba4a0fa9e489b8a3d..f5975fe0fb6dc02e6829293058bdf1362fd164f0 100644 --- a/src/libs/utils/codegeneration.cpp +++ b/src/libs/utils/codegeneration.cpp @@ -35,7 +35,7 @@ namespace Utils { -static QString toAlphaNum(const QString &s) +QTCREATOR_UTILS_EXPORT QString fileNameToCppIdentifier(const QString &s) { QString rc; const int len = s.size(); @@ -55,9 +55,9 @@ static QString toAlphaNum(const QString &s) QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file) { const QFileInfo fi(file); - QString rc = toAlphaNum(fi.completeBaseName()).toUpper(); + QString rc = fileNameToCppIdentifier(fi.completeBaseName()).toUpper(); rc += QLatin1Char('_'); - rc += toAlphaNum(fi.suffix()).toUpper(); + rc += fileNameToCppIdentifier(fi.suffix()).toUpper(); return rc; } diff --git a/src/libs/utils/codegeneration.h b/src/libs/utils/codegeneration.h index 5c8fc746ce7aaf50901dd9670444a5dd5fc4b0ee..6f0ec6c7e1d357aa4b78d5b0a4475acf60baa9f2 100644 --- a/src/libs/utils/codegeneration.h +++ b/src/libs/utils/codegeneration.h @@ -40,6 +40,10 @@ QT_END_NAMESPACE namespace Utils { +// Convert a file name to a Cpp identifier (stripping invalid characters +// or replacing them by an underscore). +QTCREATOR_UTILS_EXPORT QString fileNameToCppIdentifier(const QString &s); + QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file); QTCREATOR_UTILS_EXPORT diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 3087894c8db231505068ae3fcb3dfcc7357e866e..3236d748216ff426a87f3e9e837299c4b9c1fb36 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -132,105 +132,122 @@ void StyleHelper::setBaseColor(const QColor &color) } } -void StyleHelper::verticalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) +static void verticalGradientHelper(QPainter *p, const QRect &spanRect, const QRect &rect) { - QString key; - key.sprintf("mh_toolbar %d %d %d %d %d", spanRect.width(), spanRect.height(), clipRect.width(), - clipRect.height(), StyleHelper::baseColor().rgb());; - QPixmap pixmap; - QPainter *p = painter; - QRect rect = clipRect; - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { - pixmap = QPixmap(clipRect.size()); - p = new QPainter(&pixmap); - rect = QRect(0, 0, clipRect.width(), clipRect.height()); - } - QColor base = StyleHelper::baseColor(); QLinearGradient grad(spanRect.topRight(), spanRect.topLeft()); - grad.setColorAt(0, highlightColor()); + grad.setColorAt(0, StyleHelper::highlightColor()); grad.setColorAt(0.301, base); - grad.setColorAt(1, shadowColor()); + grad.setColorAt(1, StyleHelper::shadowColor()); p->fillRect(rect, grad); QColor light(255, 255, 255, 80); p->setPen(light); p->drawLine(rect.topRight() - QPoint(1, 0), rect.bottomRight() - QPoint(1, 0)); +} + +void StyleHelper::verticalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) +{ + if (StyleHelper::usePixmapCache()) { + QString key; + key.sprintf("mh_vertical %d %d %d %d %d", + spanRect.width(), spanRect.height(), clipRect.width(), + clipRect.height(), StyleHelper::baseColor().rgb());; + + QPixmap pixmap; + if (!QPixmapCache::find(key, pixmap)) { + pixmap = QPixmap(clipRect.size()); + QPainter p(&pixmap); + QRect rect(0, 0, clipRect.width(), clipRect.height()); + verticalGradientHelper(&p, spanRect, rect); + p.end(); + QPixmapCache::insert(key, pixmap); + } - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { painter->drawPixmap(clipRect.topLeft(), pixmap); - p->end(); - delete p; - QPixmapCache::insert(key, pixmap); + } else { + verticalGradientHelper(painter, spanRect, clipRect); } - } -void StyleHelper::horizontalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) +static void horizontalGradientHelper(QPainter *p, const QRect &spanRect, const +QRect &rect) { - QString key; - key.sprintf("mh_toolbar %d %d %d %d %d", spanRect.width(), spanRect.height(), - clipRect.width(), clipRect.height(), StyleHelper::baseColor().rgb()); - QPixmap pixmap; - QPainter *p = painter; - QRect rect = clipRect; - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { - pixmap = QPixmap(clipRect.size()); - p = new QPainter(&pixmap); - rect = QRect(0, 0, clipRect.width(), clipRect.height()); - } - QColor base = StyleHelper::baseColor(); QLinearGradient grad(rect.topLeft(), rect.bottomLeft()); - grad.setColorAt(0, highlightColor().lighter(120)); - if (rect.height() == navigationWidgetHeight()) { - grad.setColorAt(0.4, highlightColor()); + grad.setColorAt(0, StyleHelper::highlightColor().lighter(120)); + if (rect.height() == StyleHelper::navigationWidgetHeight()) { + grad.setColorAt(0.4, StyleHelper::highlightColor()); grad.setColorAt(0.401, base); } - grad.setColorAt(1, shadowColor()); + grad.setColorAt(1, StyleHelper::shadowColor()); p->fillRect(rect, grad); QLinearGradient shadowGradient(spanRect.topLeft(), spanRect.topRight()); shadowGradient.setColorAt(0, QColor(0, 0, 0, 30)); - QColor highlight = highlightColor().lighter(130); + QColor highlight = StyleHelper::highlightColor().lighter(130); highlight.setAlpha(100); shadowGradient.setColorAt(0.7, highlight); shadowGradient.setColorAt(1, QColor(0, 0, 0, 40)); p->fillRect(rect, shadowGradient); - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { - painter->drawPixmap(clipRect.topLeft(), pixmap); - p->end(); - delete p; - QPixmapCache::insert(key, pixmap); - } } -void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) +void StyleHelper::horizontalGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) { - QString key; - key.sprintf("mh_toolbar %d %d %d %d %d", spanRect.width(), spanRect.height(), clipRect.width(), - clipRect.height(), StyleHelper::baseColor().rgb());; - QPixmap pixmap; - QPainter *p = painter; - QRect rect = clipRect; - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { - pixmap = QPixmap(clipRect.size()); - p = new QPainter(&pixmap); - rect = QRect(0, 0, clipRect.width(), clipRect.height()); + if (StyleHelper::usePixmapCache()) { + QString key; + key.sprintf("mh_horizontal %d %d %d %d %d", + spanRect.width(), spanRect.height(), clipRect.width(), + clipRect.height(), StyleHelper::baseColor().rgb()); + + QPixmap pixmap; + if (!QPixmapCache::find(key, pixmap)) { + pixmap = QPixmap(clipRect.size()); + QPainter p(&pixmap); + QRect rect = QRect(0, 0, clipRect.width(), clipRect.height()); + horizontalGradientHelper(&p, spanRect, rect); + p.end(); + QPixmapCache::insert(key, pixmap); + } + + painter->drawPixmap(clipRect.topLeft(), pixmap); + + } else { + horizontalGradientHelper(painter, spanRect, clipRect); } +} +static void menuGradientHelper(QPainter *p, const QRect &spanRect, const QRect &rect) +{ QLinearGradient grad(spanRect.topLeft(), spanRect.bottomLeft()); - QColor menuColor = mergedColors(StyleHelper::baseColor(), QColor(244, 244, 244), 25); + QColor menuColor = StyleHelper::mergedColors(StyleHelper::baseColor(), QColor(244, 244, 244), 25); grad.setColorAt(0, menuColor.lighter(112)); grad.setColorAt(1, menuColor); p->fillRect(rect, grad); +} + +void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const QRect &clipRect) +{ + if (StyleHelper::usePixmapCache()) { + QString key; + key.sprintf("mh_menu %d %d %d %d %d", + spanRect.width(), spanRect.height(), clipRect.width(), + clipRect.height(), StyleHelper::baseColor().rgb()); + + QPixmap pixmap; + if (!QPixmapCache::find(key, pixmap)) { + pixmap = QPixmap(clipRect.size()); + QPainter p(&pixmap); + QRect rect = QRect(0, 0, clipRect.width(), clipRect.height()); + menuGradientHelper(&p, spanRect, rect); + p.end(); + QPixmapCache::insert(key, pixmap); + } - if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { painter->drawPixmap(clipRect.topLeft(), pixmap); - p->end(); - delete p; - QPixmapCache::insert(key, pixmap); + } else { + menuGradientHelper(painter, spanRect, clipRect); } } diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 743d2f728e61733199e895fbc65b7a828647a862..93e59ff1594db9bdbcb764974525f0b3699ec22e 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -343,6 +343,7 @@ void EditorView::setCurrentEditor(IEditor *editor) { if (!editor || m_container->count() <= 0 || m_container->indexOf(editor->widget()) == -1) { + updateEditorStatus(0); // ### TODO the combo box m_editorList should show an empty item return; } @@ -377,6 +378,13 @@ void EditorView::updateEditorStatus(IEditor *editor) static const QIcon lockedIcon(QLatin1String(":/core/images/locked.png")); static const QIcon unlockedIcon(QLatin1String(":/core/images/unlocked.png")); + m_lockButton->setVisible(editor != 0); + + if (!editor) { + m_editorList->setToolTip(QString()); + return; + } + if (editor->file()->isReadOnly()) { m_lockButton->setIcon(lockedIcon); m_lockButton->setEnabled(!editor->file()->fileName().isEmpty()); diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 8cbd8240b360b73dbf21055c74df706c0956f295..edaab39fbdbc4a07cb393792494e8f9c993f8c72 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -106,6 +106,10 @@ public: */ virtual bool vcsDelete(const QString &filename) = 0; +signals: + void repositoryChanged(const QString &repository); + void filesChanged(const QStringList &files); + // TODO: ADD A WAY TO DETECT WHETHER A FILE IS MANAGED, e.g // virtual bool sccManaged(const QString &filename) = 0; }; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 282b2bf6815d4e6ff11752b547880f09d6362d8d..e7b8e7fa544bee79b93c339db8a4e5dd536715c6 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -126,7 +126,7 @@ MainWindow::MainWindow() : m_progressManager(new ProgressManagerPrivate()), m_scriptManager(new ScriptManagerPrivate(this)), m_variableManager(new VariableManager(this)), - m_vcsManager(new VCSManager()), + m_vcsManager(new VCSManager), m_viewManager(0), m_modeManager(0), m_mimeDatabase(new MimeDatabase), @@ -346,6 +346,7 @@ void MainWindow::extensionsInitialized() OutputPaneManager::instance()->init(); m_actionManager->initialize(); + m_vcsManager->extensionsInitialized(); readSettings(); updateContext(); diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index 33c7e484a0272fa8256c5b0b129369a4a50cc0c8..e07ba2ff12e6608afb17099d8542b7bbbf96d60b 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -57,7 +57,8 @@ struct VCSManagerPrivate { QMap<QString, IVersionControl *> m_cachedMatches; }; -VCSManager::VCSManager() : +VCSManager::VCSManager(QObject *parent) : + QObject(parent), m_d(new VCSManagerPrivate) { } @@ -67,6 +68,17 @@ VCSManager::~VCSManager() delete m_d; } +void VCSManager::extensionsInitialized() +{ + // Change signal connections + foreach (IVersionControl *versionControl, allVersionControls()) { + connect(versionControl, SIGNAL(filesChanged(QStringList)), + this, SIGNAL(filesChanged(QStringList))); + connect(versionControl, SIGNAL(repositoryChanged(QString)), + this, SIGNAL(repositoryChanged(QString))); + } +} + void VCSManager::setVCSEnabled(const QString &directory) { if (debug) diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index fa94efc618c9d95b6320440fb579f1bf5c613214..772243dd95767278786b0cdc306bdb1a3cbbd600 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -33,6 +33,7 @@ #include "core_global.h" #include <QtCore/QString> +#include <QtCore/QObject> namespace Core { @@ -49,13 +50,16 @@ class IVersionControl; // for the topmost directory it manages. This information is cached and // VCSManager thus knows pretty fast which IVersionControl * is responsible. -class CORE_EXPORT VCSManager +class CORE_EXPORT VCSManager : public QObject { + Q_OBJECT Q_DISABLE_COPY(VCSManager) public: - VCSManager(); + explicit VCSManager(QObject *parent = 0); virtual ~VCSManager(); + void extensionsInitialized(); + IVersionControl *findVersionControlForDirectory(const QString &directory); // Enable the VCS managing a certain directory only. This should @@ -69,6 +73,10 @@ public: // if a failure occurs bool showDeleteDialog(const QString &fileName); +signals: + void repositoryChanged(const QString &repository); + void filesChanged(const QStringList &files); + private: VCSManagerPrivate *m_d; }; diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 356f711ba9ed63eb2890961ccd4a797d06dde3e4..85d02021251984a1eacf6120e4e53b1ba8b06e71 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -41,8 +41,10 @@ const char * const SWITCH_DECLARATION_DEFINITION = "CppEditor.SwitchDeclarationD const char * const RENAME_SYMBOL_UNDER_CURSOR = "CppEditor.RenameSymbolUnderCursor"; const char * const FIND_USAGES = "CppEditor.FindUsages"; const char * const SEPARATOR = "CppEditor.Separator"; +const char * const SEPARATOR2 = "CppEditor.Separator2"; const char * const FIND_REFERENCES = "CppEditor.FindReferences"; const char * const JUMP_TO_DEFINITION = "CppEditor.JumpToDefinition"; +const char * const UPDATE_CODEMODEL = "CppEditor.UpdateCodeModel"; const char * const HEADER_FILE_TYPE = "CppHeaderFiles"; const char * const SOURCE_FILE_TYPE = "CppSourceFiles"; diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index f98fb6808738bf8fee1833be785b4fc28d66af86..a4476d6d90470b337f8db369c7dcbdae5b65c801 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -52,6 +52,7 @@ #include <texteditor/texteditorsettings.h> #include <texteditor/texteditorconstants.h> #include <cpptools/cpptoolsconstants.h> +#include <cpptools/cppmodelmanagerinterface.h> #include <QtCore/QFileInfo> #include <QtCore/QSettings> @@ -108,11 +109,26 @@ QStringList CppEditorFactory::mimeTypes() const ///////////////////////////////// CppPlugin ////////////////////////////////// +static inline + Core::Command *createSeparator(Core::ActionManager *am, + QObject *parent, + const QList<int> &context, + const char *id) +{ + QAction *separator = new QAction(parent); + separator->setSeparator(true); + return am->registerAction(separator, QLatin1String(id), context); +} + CppPlugin *CppPlugin::m_instance = 0; CppPlugin::CppPlugin() : m_actionHandler(0), - m_sortedMethodOverview(false) + m_sortedMethodOverview(false), + m_renameSymbolUnderCursorAction(0), + m_findUsagesAction(0), + m_updateCodeModelAction(0) + { m_instance = this; } @@ -192,6 +208,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT); Core::Command *cmd; + Core::ActionContainer *cppToolsMenu = am->actionContainer(QLatin1String(CppTools::Constants::M_TOOLS_CPP)); QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this); cmd = am->registerAction(jumpToDefinition, @@ -200,7 +217,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess connect(jumpToDefinition, SIGNAL(triggered()), this, SLOT(jumpToDefinition())); contextMenu->addAction(cmd); - am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); + cppToolsMenu->addAction(cmd); QAction *switchDeclarationDefinition = new QAction(tr("Switch between Method Declaration/Definition"), this); cmd = am->registerAction(switchDeclarationDefinition, @@ -209,14 +226,14 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess connect(switchDeclarationDefinition, SIGNAL(triggered()), this, SLOT(switchDeclarationDefinition())); contextMenu->addAction(cmd); - am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); + cppToolsMenu->addAction(cmd); m_findUsagesAction = new QAction(tr("Find Usages"), this); cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U"))); connect(m_findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages())); contextMenu->addAction(cmd); - am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); + cppToolsMenu->addAction(cmd); m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this); cmd = am->registerAction(m_renameSymbolUnderCursorAction, @@ -224,7 +241,17 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R")); connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor())); contextMenu->addAction(cmd); - am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); + cppToolsMenu->addAction(cmd); + + // Update context in global context + QList<int> globalContext; + globalContext.append(Core::Constants::C_GLOBAL_ID); + cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2)); + m_updateCodeModelAction = new QAction(tr("Update code model"), this); + cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext); + CppTools::CppModelManagerInterface *cppModelManager = CppTools::CppModelManagerInterface::instance(); + connect(m_updateCodeModelAction, SIGNAL(triggered()), cppModelManager, SLOT(updateModifiedSourceFiles())); + cppToolsMenu->addAction(cmd); m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR, TextEditor::TextEditorActionHandler::Format @@ -233,10 +260,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess m_actionHandler->initializeActions(); - QAction *separator = new QAction(this); - separator->setSeparator(true); - cmd = am->registerAction(separator, CppEditor::Constants::SEPARATOR, context); - contextMenu->addAction(cmd); + contextMenu->addAction(createSeparator(am, this, context, CppEditor::Constants::SEPARATOR)); cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION); contextMenu->addAction(cmd); @@ -308,6 +332,7 @@ void CppPlugin::onTaskStarted(const QString &type) if (type == CppTools::Constants::TASK_INDEX) { m_renameSymbolUnderCursorAction->setEnabled(false); m_findUsagesAction->setEnabled(false); + m_updateCodeModelAction->setEnabled(false); } } @@ -316,6 +341,7 @@ void CppPlugin::onAllTasksFinished(const QString &type) if (type == CppTools::Constants::TASK_INDEX) { m_renameSymbolUnderCursorAction->setEnabled(true); m_findUsagesAction->setEnabled(true); + m_updateCodeModelAction->setEnabled(true); } } diff --git a/src/plugins/cppeditor/cppplugin.h b/src/plugins/cppeditor/cppplugin.h index 3456bd9baf2eb4198aacb1a2cef301037508b95b..25687c300e03f2e4488623b57390652cb5ea61eb 100644 --- a/src/plugins/cppeditor/cppplugin.h +++ b/src/plugins/cppeditor/cppplugin.h @@ -90,6 +90,7 @@ private: bool m_sortedMethodOverview; QAction *m_renameSymbolUnderCursorAction; QAction *m_findUsagesAction; + QAction *m_updateCodeModelAction; }; class CppEditorFactory : public Core::IEditorFactory diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 72677abf6e296ff1e9f18e93e26707fd7bbfa89d..6d1c527bacd7d51f44b3f62be1c3d513a8c57e7f 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -110,7 +110,6 @@ static void find_helper(QFutureInterface<Usage> &future, Q_ASSERT(symbolId != 0); const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength()); - QStringList files(sourceFile); if (symbol->isClass() || symbol->isForwardClassDeclaration()) { @@ -126,9 +125,7 @@ static void find_helper(QFutureInterface<Usage> &future, } else { files += snapshot.dependsOn(sourceFile); } - files.removeDuplicates(); - //qDebug() << "done in:" << tm.elapsed() << "number of files to parse:" << files.size(); future.setProgressRange(0, files.size()); @@ -232,7 +229,6 @@ void CppFindReferences::findAll_helper(Symbol *symbol) const QMap<QString, QString> wl = _modelManager->workingCopy(); Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager(); - QFuture<Usage> result = QtConcurrent::run(&find_helper, wl, snapshot, symbol); m_watcher.setFuture(result); diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 5adc395870eb88e4d20f0837c67e60f972867376..38c4e61c8a0f371138e31ad25d0d7406154d4815 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -379,8 +379,8 @@ QString CppPreprocessor::tryIncludeFile(QString &fileName, IncludeType type) } } - foreach (const QString &includePath, m_includePaths) { - QString path = includePath; + for (int i = m_includePaths.size() - 1; i != -1; --i) { + QString path = m_includePaths.at(i); path += QLatin1Char('/'); path += fileName; path = QDir::cleanPath(path); @@ -532,7 +532,7 @@ void CppPreprocessor::sourceNeeded(QString &fileName, IncludeType type, return; QString contents = tryIncludeFile(fileName, type); - + fileName = QDir::cleanPath(fileName); if (m_currentDoc) { m_currentDoc->addIncludeFile(fileName, line); diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index bbc894390c8a225c9a2b99c3d2587e97383f2351..d321b7c39b3748079ed8b0552ec2a6964baa48da 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -47,6 +47,7 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/progressmanager/progressmanager.h> +#include <coreplugin/vcsmanager.h> #include <cppeditor/cppeditorconstants.h> #include <QtCore/QtConcurrentRun> @@ -97,6 +98,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) // Objects m_modelManager = new CppModelManager(this); + Core::VCSManager *vcsManager = core->vcsManager(); + connect(vcsManager, SIGNAL(repositoryChanged(QString)), + m_modelManager, SLOT(updateModifiedSourceFiles())); + connect(vcsManager, SIGNAL(filesChanged(QStringList)), + m_modelManager, SLOT(updateModifiedSourceFiles())); addAutoReleasedObject(m_modelManager); m_completion = new CppCodeCompletion(m_modelManager); diff --git a/src/plugins/cvs/cvscontrol.cpp b/src/plugins/cvs/cvscontrol.cpp index 51edeec5a69a2e08ca4e59875eb53f180ac550e9..1689f22052798b8bfa1d3d9143bf23cc8baf2c50 100644 --- a/src/plugins/cvs/cvscontrol.cpp +++ b/src/plugins/cvs/cvscontrol.cpp @@ -96,3 +96,14 @@ QString CVSControl::findTopLevelForDirectory(const QString &directory) const { return m_plugin->findTopLevelForDirectory(directory); } + +void CVSControl::emitRepositoryChanged(const QString &s) +{ + emit repositoryChanged(s); +} + +void CVSControl::emitFilesChanged(const QStringList &l) +{ + emit filesChanged(l); +} + diff --git a/src/plugins/cvs/cvscontrol.h b/src/plugins/cvs/cvscontrol.h index 52067ad37024b1046870274e4d4d488a9fb41c5e..c6adb7ffa9c019d617186446fd45123affee08aa 100644 --- a/src/plugins/cvs/cvscontrol.h +++ b/src/plugins/cvs/cvscontrol.h @@ -56,6 +56,9 @@ public: virtual bool vcsAdd(const QString &fileName); virtual bool vcsDelete(const QString &filename); + void emitRepositoryChanged(const QString &s); + void emitFilesChanged(const QStringList &l); + signals: void enabledChanged(bool); diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 654fce42bb307e28924f073b28b9f6d896ae5ff6..0fa8619e27047d9bb43a98b3c753c2bde6832037 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -551,9 +551,11 @@ void CVSPlugin::revertCurrentFile() QStringList args(QLatin1String("update")); args.push_back(QLatin1String("-C")); - const CVSResponse revertResponse = runCVS(args, QStringList(file), cvsShortTimeOut, true); + const QStringList files = QStringList(file); + const CVSResponse revertResponse = runCVS(args, files, cvsShortTimeOut, true); if (revertResponse.result == CVSResponse::Ok) { fcb.setModifiedReload(true); + m_versionControl->emitFilesChanged(files); } } @@ -734,7 +736,10 @@ void CVSPlugin::updateProject() if (!topLevels.empty()) { QStringList args(QLatin1String("update")); args.push_back(QLatin1String("-dR")); - runCVS(args, topLevels, cvsLongTimeOut, true); + const CVSResponse response = runCVS(args, topLevels, cvsLongTimeOut, true); + if (response.result == CVSResponse::Ok) + foreach(const QString &topLevel, topLevels) + m_versionControl->emitRepositoryChanged(topLevel); } } diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h index c0f63473b2b202d95871a7b3d5f73f4900b8fdc8..a1515cfc931431761ed10390c824135b8de00394 100644 --- a/src/plugins/cvs/cvsplugin.h +++ b/src/plugins/cvs/cvsplugin.h @@ -59,6 +59,7 @@ namespace CVS { namespace Internal { class CVSSubmitEditor; +class CVSControl; struct CVSResponse { @@ -153,7 +154,7 @@ private: void cleanCommitMessageFile(); CVSSettings m_settings; - Core::IVersionControl *m_versionControl; + CVSControl *m_versionControl; QString m_commitMessageFileName; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index 6c307af0c5a16c7860d75c717c92929f5832aa0f..08c552dab8b6e2ba6e99145ef79c1473da600669 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -1034,9 +1034,16 @@ static inline QString msgStepFailed(unsigned long executionStatus, int threadId, return QString::fromLatin1("Thread %1: Unable to step into: %2").arg(threadId).arg(why); } -// Step with DEBUG_STATUS_STEP_OVER ('p'-command) or +// Step out has to be done via executing 'gu'. TODO: Remove once it is +// accessible via normal API for SetExecutionStatus(). + +enum { CdbExtendedExecutionStatusStepOut = 7452347 }; + +// Step with DEBUG_STATUS_STEP_OVER ('p'-command), // DEBUG_STATUS_STEP_INTO ('t'-trace-command) or +// CdbExtendedExecutionStatusStepOut ("gu"-command) // its reverse equivalents in the case of single threads. + bool CdbDebugEngine::step(unsigned long executionStatus) { if (debugCDBExecution) @@ -1068,7 +1075,7 @@ bool CdbDebugEngine::step(unsigned long executionStatus) m_d->setCodeLevel(); // Step by instruction or source line setState(InferiorRunningRequested, Q_FUNC_INFO, __LINE__); bool success = false; - if (sameThread) { // Step event-triggering thread, use fast API + if (sameThread && executionStatus != CdbExtendedExecutionStatusStepOut) { // Step event-triggering thread, use fast API const HRESULT hr = m_d->m_cif.debugControl->SetExecutionStatus(executionStatus); success = SUCCEEDED(hr); if (!success) @@ -1077,8 +1084,18 @@ bool CdbDebugEngine::step(unsigned long executionStatus) // Need to use a command to explicitly specify the current thread QString command; QTextStream str(&command); - str << '~' << m_d->m_currentThreadId << ' ' - << (executionStatus == DEBUG_STATUS_STEP_OVER ? 'p' : 't'); + str << '~' << m_d->m_currentThreadId << ' '; + switch (executionStatus) { + case DEBUG_STATUS_STEP_OVER: + str << 'p'; + break; + case DEBUG_STATUS_STEP_INTO: + str << 't'; + break; + case CdbExtendedExecutionStatusStepOut: + str << "gu"; + break; + } manager()->showDebuggerOutput(tr("Stepping %1").arg(command)); const HRESULT hr = m_d->m_cif.debugControl->Execute(DEBUG_OUTCTL_THIS_CLIENT, command.toLatin1().constData(), DEBUG_EXECUTE_ECHO); success = SUCCEEDED(hr); @@ -1121,44 +1138,8 @@ void CdbDebugEngine::nextIExec() void CdbDebugEngine::stepOutExec() { - if (debugCDBExecution) - qDebug() << "stepOutExec"; - // emulate gdb 'exec-finish' (exec until return of current function) - // by running up to address of the above stack frame (mostly works). - const StackHandler* sh = manager()->stackHandler(); - const int idx = sh->currentIndex() + 1; - const QList<StackFrame> stackframes = sh->frames(); - if (idx < 0 || idx >= stackframes.size()) { - warning(QString::fromLatin1("Cannot step out of stack frame %1.").arg(idx)); - return; - } - // Set a temporary breakpoint and continue - const StackFrame& frame = stackframes.at(idx); - bool success = false; - QString errorMessage; - do { - const ULONG64 address = frame.address.toULongLong(&success, 16); - if (!success) { - errorMessage = QLatin1String("Cannot obtain address from stack frame"); - break; - } - manager()->showDebuggerOutput(LogMisc, tr("Running to 0x%1...").arg(address, 0, 16)); - IDebugBreakpoint2* pBP; - HRESULT hr = m_d->m_cif.debugControl->AddBreakpoint2(DEBUG_BREAKPOINT_CODE, DEBUG_ANY_ID, &pBP); - if (FAILED(hr) || !pBP) { - errorMessage = QString::fromLatin1("Cannot create temporary breakpoint: %1").arg(msgDebugEngineComResult(hr)); - break; - } - - pBP->SetOffset(address); - pBP->AddFlags(DEBUG_BREAKPOINT_ENABLED); - pBP->AddFlags(DEBUG_BREAKPOINT_ONE_SHOT); - if (!m_d->continueInferior(&errorMessage)) - break; - success = true; - } while (false); - if (!success) - warning(msgFunctionFailed(Q_FUNC_INFO, errorMessage)); + if (!manager()->isReverseDebugging()) + step(CdbExtendedExecutionStatusStepOut); } void CdbDebugEngine::continueInferior() diff --git a/src/plugins/debugger/cdb/cdbdebugengine.h b/src/plugins/debugger/cdb/cdbdebugengine.h index c96a0205961859e92e546b7c0ab91ef7700f05b1..077faf4e14fe1d2b6085af2c373971dfab106416 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.h +++ b/src/plugins/debugger/cdb/cdbdebugengine.h @@ -120,7 +120,6 @@ private: void startWatchTimer(); void killWatchTimer(); void processTerminated(unsigned long exitCode); - bool executeDebuggerCommand(const QString &command, QString *errorMessage); bool evaluateExpression(const QString &expression, QString *value, QString *type, QString *errorMessage); void evaluateWatcher(WatchData *wd); QString editorToolTip(const QString &exp, const QString &function); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 4a0b0f783eb10e5657e569e53282d6876efc49ba..52a483d9521942c80e0988e4cd740eb0a3952182 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -233,8 +233,8 @@ DebuggerSettings *DebuggerSettings::instance() item->setSettingsKey(debugModeGroup, QLatin1String("UseCodeModel")); item->setText(tr("Use code model")); item->setCheckable(true); - item->setDefaultValue(false); - item->setValue(false); + item->setDefaultValue(true); + item->setValue(true); instance->insertItem(UseCodeModel, item); item = new SavedAction(instance); diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index d78c00bef50604adab1130c5957d1821d6b12dbb..bcc21ba4b8e785926cdbb412420d6afe3b476741 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -121,6 +121,7 @@ public: QString debuggerCommand; int toolChainType; QString remoteDumperLib; + QString qtInstallPath; QString dumperLibrary; QStringList dumperLibraryLocations; diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index a924791f1689ade9021b4d2a34f329e75748e543..796684a5ad3e8a92403be9c2d54ac106faee25ac 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -31,6 +31,7 @@ #include "debuggermanager.h" +#include <projectexplorer/debugginghelper.h> #include <projectexplorer/environment.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> @@ -139,6 +140,21 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, runConfiguration->dumperLibrary(); m_startParameters->dumperLibraryLocations = runConfiguration->dumperLibraryLocations(); + + QString qmakePath = ProjectExplorer::DebuggingHelperLibrary::findSystemQt( + runConfiguration->environment()); + if (!qmakePath.isEmpty()) { + QProcess proc; + QStringList args; + args.append(QLatin1String("-query")); + args.append(QLatin1String("QT_INSTALL_HEADERS")); + proc.start(qmakePath, args); + proc.waitForFinished(); + QByteArray ba = proc.readAllStandardOutput().trimmed(); + QFileInfo fi(QString::fromLocal8Bit(ba) + "/.."); + m_startParameters->qtInstallPath = fi.absoluteFilePath(); + } + } DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, const DebuggerStartParametersPtr &startParameters) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b3328cb6a102dac72b2fc3f795a7605f52e6e760..1665061aad78efe156123905768862ab887e0b1b 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -285,6 +285,8 @@ void GdbEngine::initializeVariables() m_inbuffer.clear(); + m_commandTimer->stop(); + // ConverterState has no reset() function. m_outputCodecState.~ConverterState(); new (&m_outputCodecState) QTextCodec::ConverterState(); @@ -425,6 +427,8 @@ void GdbEngine::handleResponse(const QByteArray &buff) } if (asyncClass == "stopped") { handleStopResponse(result); + m_pendingLogStreamOutput.clear(); + m_pendingConsoleStreamOutput.clear(); } else if (asyncClass == "running") { // Archer has 'thread-id="all"' here } else if (asyncClass == "library-loaded") { @@ -1157,42 +1161,52 @@ void GdbEngine::handleStopResponse(const GdbMi &data) } setState(InferiorStopped); -#ifdef Q_OS_LINUX - // For some reason, attaching to a stopped process causes *two* stops - // when trying to continue (kernel i386 2.6.24-23-ubuntu, gdb 6.8). - // Interestingly enough, on MacOSX no signal is delivered at all. - if (!m_entryPoint.isEmpty()) { - if (reason == "signal-received" - && data.findChild("signal-name").data() == "SIGSTOP") { - GdbMi frameData = data.findChild("frame"); - if (frameData.findChild("addr").data() == m_entryPoint) { - continueInferiorInternal(); - return; + // Due to LD_PRELOADing the dumpers, these events can occur even before + // reaching the entry point. So handle it before the entry point hacks below. + if (reason.isEmpty() && m_gdbVersion < 70000 && !m_isMacGdb) { + // On Linux it reports "Stopped due to shared library event\n", but + // on Windows it simply forgets about it. Thus, we identify the response + // based on it having no frame information. + if (!data.findChild("frame").isValid()) { + m_modulesListOutdated = m_sourcesListOutdated = true; + // Each stop causes a roundtrip and button flicker, so prevent + // a flood of useless stops. Will be automatically re-enabled. + postCommand(_("set stop-on-solib-events 0")); +#if 0 + // The related code (handleAqcuiredInferior()) is disabled as well. + if (theDebuggerBoolSetting(SelectedPluginBreakpoints)) { + QString dataStr = _(data.toString()); + debugMessage(_("SHARED LIBRARY EVENT: ") + dataStr); + QString pat = theDebuggerStringSetting(SelectedPluginBreakpointsPattern); + debugMessage(_("PATTERN: ") + pat); + postCommand(_("sharedlibrary ") + pat); + showStatusMessage(tr("Loading %1...").arg(dataStr)); } +#endif + continueInferiorInternal(); + return; } - // We are past the initial stops. No need to waste time on further checks. - m_entryPoint.clear(); } -#endif -#if 0 - // The related code (handleAqcuiredInferior()) is disabled as well. - // When re-enabling, try something to avoid spurious source list updates - // due to unrelated no-reason stops. - const QByteArray &msg = data.findChild("consolestreamoutput").data(); - if (msg.contains("Stopped due to shared library event") || reason.isEmpty()) { - m_modulesListOutdated = m_sourcesListOutdated = true; - if (theDebuggerBoolSetting(SelectedPluginBreakpoints)) { - QString dataStr = _(data.toString()); - debugMessage(_("SHARED LIBRARY EVENT: ") + dataStr); - QString pat = theDebuggerStringSetting(SelectedPluginBreakpointsPattern); - debugMessage(_("PATTERN: ") + pat); - postCommand(_("sharedlibrary ") + pat); +#ifdef Q_OS_LINUX + if (!m_entryPoint.isEmpty()) { + GdbMi frameData = data.findChild("frame"); + if (frameData.findChild("addr").data() == m_entryPoint) { + // There are two expected reasons for getting here: + // 1) For some reason, attaching to a stopped process causes *two* SIGSTOPs + // when trying to continue (kernel i386 2.6.24-23-ubuntu, gdb 6.8). + // Interestingly enough, on MacOSX no signal is delivered at all. + // 2) The explicit tbreak at the entry point we set to query the PID. + // Gdb <= 6.8 reports a frame but no reason, 6.8.50+ reports everything. + // The case of the user really setting a breakpoint at _start is simply + // unsupported. + if (!inferiorPid()) // For programs without -pthread under gdb <= 6.8. + postCommand(_("info proc"), CB(handleInfoProc)); continueInferiorInternal(); - showStatusMessage(tr("Loading %1...").arg(dataStr)); return; } - // fall through + // We are past the initial stop(s). No need to waste time on further checks. + m_entryPoint.clear(); } #endif @@ -1270,11 +1284,6 @@ void GdbEngine::handleStop1(const GdbMi &data) if (m_sourcesListOutdated) reloadSourceFilesInternal(); // This needs to be done before fullName() may need it - // Older gdb versions do not produce "library loaded" messages - // so the breakpoint update is not triggered. - if (m_gdbVersion < 70000 && !m_isMacGdb) - postCommand(_("-break-list"), CB(handleBreakList)); - QByteArray reason = data.findChild("reason").data(); if (reason == "breakpoint-hit") { showStatusMessage(tr("Stopped at breakpoint.")); @@ -1292,8 +1301,8 @@ void GdbEngine::handleStop1(const GdbMi &data) "signal from the Operating System.<p>" "<table><tr><td>Signal name : </td><td>%1</td></tr>" "<tr><td>Signal meaning : </td><td>%2</td></tr></table>") - .arg(name.isEmpty() ? tr(" <Unknown> ") : _(name)) - .arg(meaning.isEmpty() ? tr(" <Unknown> ") : _(meaning)); + .arg(name.isEmpty() ? tr(" <Unknown> ", "name") : _(name)) + .arg(meaning.isEmpty() ? tr(" <Unknown> ", "meaning") : _(meaning)); showMessageBox(QMessageBox::Information, tr("Signal received"), msg); } @@ -1337,6 +1346,18 @@ void GdbEngine::handleStop1(const GdbMi &data) manager()->reloadRegisters(); } +#ifdef Q_OS_LINUX +void GdbEngine::handleInfoProc(const GdbResponse &response) +{ + if (response.resultClass == GdbResultDone) { + static QRegExp re(_("\\bprocess ([0-9]+)\n")); + QTC_ASSERT(re.isValid(), return); + if (re.indexIn(_(response.data.findChild("consolestreamoutput").data())) != -1) + maybeHandleInferiorPidChanged(re.cap(1)); + } +} +#endif + void GdbEngine::handleShowVersion(const GdbResponse &response) { //qDebug () << "VERSION 2:" << response.data.findChild("consolestreamoutput").data(); @@ -1399,7 +1420,6 @@ void GdbEngine::handleExecContinue(const GdbResponse &response) } else { if (state() == InferiorRunningRequested_Kill) { setState(InferiorStopped); - m_commandsToRunOnTemporaryBreak.clear(); shutdown(); return; } @@ -1416,7 +1436,6 @@ void GdbEngine::handleExecContinue(const GdbResponse &response) } else { showMessageBox(QMessageBox::Critical, tr("Execution Error"), tr("Cannot continue debugged process:\n") + QString::fromLocal8Bit(msg)); - m_commandsToRunOnTemporaryBreak.clear(); shutdown(); } } @@ -1461,6 +1480,7 @@ void GdbEngine::shutdown() // fall-through case AdapterStartFailed: // Adapter "did something", but it did not help if (m_gdbProc.state() == QProcess::Running) { + m_commandsToRunOnTemporaryBreak.clear(); postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit)); } else { setState(DebuggerNotReady); @@ -1470,6 +1490,7 @@ void GdbEngine::shutdown() case InferiorRunning: case InferiorStopping: case InferiorStopped: + m_commandsToRunOnTemporaryBreak.clear(); postCommand(_(m_gdbAdapter->inferiorShutdownCommand()), NeedsStop | LosesChild, CB(handleInferiorShutdown)); break; @@ -1478,6 +1499,7 @@ void GdbEngine::shutdown() case InferiorShutDown: case InferiorShutdownFailed: // Whatever case InferiorUnrunnable: + m_commandsToRunOnTemporaryBreak.clear(); postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit)); setState(EngineShuttingDown); // Do it after posting the command! break; @@ -1510,6 +1532,7 @@ void GdbEngine::handleGdbExit(const GdbResponse &response) { if (response.resultClass == GdbResultExit) { debugMessage(_("GDB CLAIMS EXIT; WAITING")); + m_commandsDoneCallback = 0; // don't set state here, this will be handled in handleGdbFinished() } else { QString msg = m_gdbAdapter->msgGdbStopFailed(_(response.data.findChild("msg").data())); @@ -2238,6 +2261,8 @@ void GdbEngine::reloadModulesInternal() { m_modulesListOutdated = false; postCommand(_("info shared"), NeedsStop, CB(handleModulesList)); + if (m_gdbVersion < 70000 && !m_isMacGdb) + postCommand(_("set stop-on-solib-events 1")); } void GdbEngine::handleModulesList(const GdbResponse &response) @@ -2278,7 +2303,7 @@ void GdbEngine::handleModulesList(const GdbResponse &response) module.symbolsRead = (item.findChild("state").data() == "Y"); module.startAddress = _(item.findChild("loaded_addr").data()); //: End address of loaded module - module.endAddress = tr("<unknown>"); + module.endAddress = tr("<unknown>", "address"); modules.append(module); } } @@ -2306,6 +2331,8 @@ void GdbEngine::reloadSourceFilesInternal() m_sourcesListOutdated = false; postCommand(_("-file-list-exec-source-files"), NeedsStop, CB(handleQuerySources)); postCommand(_("-break-list"), CB(handleBreakList)); + if (m_gdbVersion < 70000 && !m_isMacGdb) + postCommand(_("set stop-on-solib-events 1")); } @@ -4450,6 +4477,21 @@ void GdbEngine::handleAdapterStarted() void GdbEngine::handleInferiorPrepared() { + const QString qtInstallPath = m_startParameters->qtInstallPath; + if (!qtInstallPath.isEmpty()) { + QString qtBuildPath = + #if defined(Q_OS_WIN) + _("C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt"); + #elif defined(Q_OS_MAC) + QString(); + #else + _("/var/tmp/qt-x11-src-4.6.0"); + #endif + if (!qtBuildPath.isEmpty()) + postCommand(_("set substitute-path %1 %2") + .arg(qtBuildPath).arg(qtInstallPath)); + } + // Initial attempt to set breakpoints showStatusMessage(tr("Setting breakpoints...")); attemptBreakpointSynchronization(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index aafe05b96e08e22b62dcf101bc86ab9e61f386f9..dc1acf68fcc3feb27b3a642d0a8eca215b499d16 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -302,6 +302,8 @@ private: ////////// Inferior Management ////////// void maybeHandleInferiorPidChanged(const QString &pid); #ifdef Q_OS_LINUX + void handleInfoProc(const GdbResponse &response); + QByteArray m_entryPoint; #endif diff --git a/src/plugins/debugger/gdb/plaingdbadapter.cpp b/src/plugins/debugger/gdb/plaingdbadapter.cpp index 9f0d4c0e832e62e5cf82602f693d057cfd815651..fbcf96c860530d3a2c662e25b8ce144ab0eaeb39 100644 --- a/src/plugins/debugger/gdb/plaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/plaingdbadapter.cpp @@ -110,6 +110,13 @@ void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response) { QTC_ASSERT(state() == InferiorStarting, qDebug() << state()); if (response.resultClass == GdbResultDone) { +#ifdef Q_OS_LINUX + // Old gdbs do not announce the PID for programs without pthreads. + // Note that successfully preloading the debugging helpers will + // automatically load pthreads, so this will be unnecessary. + if (m_engine->m_gdbVersion < 70000) + m_engine->postCommand(_("info target"), CB(handleInfoTarget)); +#endif emit inferiorPrepared(); } else { QString msg = tr("Starting executable failed:\n") + @@ -118,6 +125,29 @@ void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response) } } +#ifdef Q_OS_LINUX +void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response) +{ + if (response.resultClass == GdbResultDone) { + // [some leading stdout here] + // >&" Entry point: 0x80831f0 0x08048134 - 0x08048147 is .interp\n" + // [some trailing stdout here] + QString msg = _(response.data.findChild("consolestreamoutput").data()); + QRegExp needle(_("\\bEntry point: 0x([0-9a-f]+)\\b")); + if (needle.indexIn(msg) != -1) { + m_engine->m_entryPoint = + "0x" + needle.cap(1).toLatin1().rightJustified(sizeof(void *) * 2, '0'); + m_engine->postCommand(_("tbreak *0x") + needle.cap(1)); + // Do nothing here - inferiorPrepared handles the sequencing. + } else { + emit inferiorStartFailed(_("Parsing start address failed")); + } + } else if (response.resultClass == GdbResultError) { + emit inferiorStartFailed(_("Fetching start address failed")); + } +} +#endif + void PlainGdbAdapter::startInferiorPhase2() { setState(InferiorRunningRequested); diff --git a/src/plugins/debugger/gdb/plaingdbadapter.h b/src/plugins/debugger/gdb/plaingdbadapter.h index 21545212af73e49ccac7ffaf350eb9087ae88d82..2a60a86643a126a965da88e8de094e8ce25c8ee1 100644 --- a/src/plugins/debugger/gdb/plaingdbadapter.h +++ b/src/plugins/debugger/gdb/plaingdbadapter.h @@ -62,6 +62,9 @@ public: private: void handleFileExecAndSymbols(const GdbResponse &response); void handleExecRun(const GdbResponse &response); +#ifdef Q_OS_LINUX + void handleInfoTarget(const GdbResponse &response); +#endif OutputCollector m_outputCollector; }; diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp index dcbe2851eea1998159ed0160c988e0bbdf3b22dd..3eab98ab2e785c94feb0491dab28ca542c8143be 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.cpp +++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp @@ -197,9 +197,17 @@ TrkGdbAdapter::TrkGdbAdapter(GdbEngine *engine, const TrkOptionsPtr &options) : m_running(false), m_trkDevice(new trk::TrkDevice), m_gdbAckMode(true), - m_verbose(2), + m_verbose(0), m_bufferedMemoryRead(true) { + const QByteArray trkVerbose = qgetenv("QTC_TRK_VERBOSE"); + if (!trkVerbose.isEmpty()) { + bool ok; + m_verbose = trkVerbose.toInt(&ok); + if (!ok) + m_verbose = 1; + } + m_gdbServer = 0; m_gdbConnection = 0; #ifdef Q_OS_WIN diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 6606776f0ea8fa5b321183a85e8127858c620c43..c8cf6b908296523b40971b3fc21f2cf6c7c9e317 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -214,6 +214,12 @@ struct Range : beginPos(qMin(b, e)), endPos(qMax(b, e)), rangemode(m) {} + QString toString() const + { + return QString("%1-%2 (mode: %3)").arg(beginPos).arg(endPos) + .arg(rangemode); + } + int beginPos; int endPos; RangeMode rangemode; @@ -660,6 +666,7 @@ void FakeVimHandler::Private::restoreWidget() EventResult FakeVimHandler::Private::handleKey(int key, int unmodified, const QString &text) { + //qDebug() << " CURSOR POS: " << m_undoCursorPosition; m_undoCursorPosition[m_tc.document()->availableUndoSteps()] = m_tc.position(); //qDebug() << "KEY: " << key << text << "POS: " << m_tc.position(); if (m_mode == InsertMode) @@ -1947,7 +1954,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) firstPositionInLine(endLine), RangeLineMode); QString contents = text(range); m_tc = tc; - qDebug() << "LINES: " << beginLine << endLine; + //qDebug() << "LINES: " << beginLine << endLine; bool handled = false; emit q->writeFileRequested(&handled, fileName, contents); // nobody cared, so act ourselves @@ -2500,8 +2507,12 @@ QString FakeVimHandler::Private::text(const Range &range) const } if (range.rangemode == RangeLineMode) { QTextCursor tc = m_tc; - tc.setPosition(firstPositionInLine(lineForPosition(range.beginPos)), MoveAnchor); - tc.setPosition(firstPositionInLine(lineForPosition(range.endPos)+1), KeepAnchor); + int firstPos = firstPositionInLine(lineForPosition(range.beginPos)); + int lastLine = lineForPosition(range.endPos); + int lastPos = lastLine == m_tc.document()->lastBlock().blockNumber() + 1 + ? lastPositionInDocument() : firstPositionInLine(lastLine + 1); + tc.setPosition(firstPos, MoveAnchor); + tc.setPosition(lastPos, KeepAnchor); return tc.selection().toPlainText(); } // FIXME: Performance? @@ -2591,7 +2602,7 @@ void FakeVimHandler::Private::removeText(const Range &range) beginEditBlock(); for (int i = beginLine; i <= endLine && block.isValid(); ++i) { int bCol = qMin(beginColumn, block.length() - 1); - int eCol = qMin(endColumn, block.length() - 1); + int eCol = qMin(endColumn + 1, block.length() - 1); tc.setPosition(block.position() + bCol, MoveAnchor); tc.setPosition(block.position() + eCol, KeepAnchor); fixMarks(block.position() + bCol, tc.selectionStart() - tc.selectionEnd()); @@ -2635,7 +2646,8 @@ void FakeVimHandler::Private::pasteText(bool afterCursor) case RangeBlockMode: { beginEditBlock(); QTextBlock block = m_tc.block(); - moveRight(); + if (afterCursor) + moveRight(); QTextCursor tc = m_tc; const int col = tc.position() - block.position(); //for (int i = lines.size(); --i >= 0; ) { @@ -2644,10 +2656,10 @@ void FakeVimHandler::Private::pasteText(bool afterCursor) tc.movePosition(StartOfLine, MoveAnchor); if (col >= block.length()) { tc.movePosition(EndOfLine, MoveAnchor); - fixMarks(position(), QString(col - line.size() + 1, QChar(' ')).length()); + fixMarks(position(), col - line.size() + 1); tc.insertText(QString(col - line.size() + 1, QChar(' '))); } else { - tc.movePosition(Right, MoveAnchor, col); + tc.movePosition(Right, MoveAnchor, col - 1 + afterCursor); } qDebug() << "INSERT " << line << " AT " << tc.position() << "COL: " << col; @@ -2656,12 +2668,13 @@ void FakeVimHandler::Private::pasteText(bool afterCursor) tc.movePosition(StartOfLine, MoveAnchor); tc.movePosition(Down, MoveAnchor, 1); if (tc.position() >= lastPositionInDocument() - 1) { - fixMarks(position(), QString(QChar('\n')).length()); + fixMarks(position(), 1); tc.insertText(QString(QChar('\n'))); tc.movePosition(Up, MoveAnchor, 1); } block = block.next(); } + moveLeft(); endEditBlock(); break; } @@ -2727,6 +2740,7 @@ QWidget *FakeVimHandler::Private::editor() const void FakeVimHandler::Private::undo() { + //qDebug() << " CURSOR POS: " << m_undoCursorPosition; int current = m_tc.document()->availableUndoSteps(); //endEditBlock(); EDITOR(undo()); diff --git a/src/plugins/find/searchresulttreeitemdelegate.cpp b/src/plugins/find/searchresulttreeitemdelegate.cpp index 5502069a1772fcca2b9d9f5d8949b90448599bde..88ac8d055357665e29e88dd917d2f3ba07ec1d5e 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.cpp +++ b/src/plugins/find/searchresulttreeitemdelegate.cpp @@ -109,7 +109,7 @@ int SearchResultTreeItemDelegate::drawLineNumber(QPainter *painter, const QStyle painter->setPen(isSelected ? option.palette.color(cg, QPalette::HighlightedText) : Qt::darkGray); painter->drawText(lineNumberAreaRect.adjusted(0, 0, -lineNumberAreaHorizontalPadding, 0), - Qt::AlignRight, QString::number(lineNumber)); + Qt::AlignRight | Qt::AlignVCenter, QString::number(lineNumber)); return lineNumberAreaWidth; } diff --git a/src/plugins/find/searchresulttreemodel.cpp b/src/plugins/find/searchresulttreemodel.cpp index b711e8c110549ecc0fd50813da10556858ed7093..3afb91d31da0a541b0274b68b2d1276b9a03fd45 100644 --- a/src/plugins/find/searchresulttreemodel.cpp +++ b/src/plugins/find/searchresulttreemodel.cpp @@ -33,6 +33,7 @@ #include <QtGui/QApplication> #include <QtGui/QFont> +#include <QtGui/QFontMetrics> #include <QtGui/QColor> #include <QtGui/QPalette> #include <QtCore/QDir> @@ -45,7 +46,7 @@ SearchResultTreeModel::SearchResultTreeModel(QObject *parent) , m_lastAppendedResultFile(0) , m_showReplaceUI(false) { - m_rootItem = new SearchResultTreeItem(); + m_rootItem = new SearchResultTreeItem; m_textEditorFont = QFont("Courier"); } @@ -61,7 +62,9 @@ void SearchResultTreeModel::setShowReplaceUI(bool show) void SearchResultTreeModel::setTextEditorFont(const QFont &font) { + layoutAboutToBeChanged(); m_textEditorFont = font; + layoutChanged(); } Qt::ItemFlags SearchResultTreeModel::flags(const QModelIndex &index) const @@ -143,7 +146,13 @@ QVariant SearchResultTreeModel::data(const QModelIndex &index, int role) const QVariant result; - if (item->itemType() == SearchResultTreeItem::ResultRow) + if (role == Qt::SizeHintRole) + { + const int appFontHeight = QApplication::fontMetrics().height(); + const int editorFontHeight = QFontMetrics(m_textEditorFont).height(); + result = QSize(0, qMax(appFontHeight, editorFontHeight)); + } + else if (item->itemType() == SearchResultTreeItem::ResultRow) { const SearchResultTextRow *row = static_cast<const SearchResultTextRow *>(item); result = data(row, role); @@ -243,7 +252,7 @@ QVariant SearchResultTreeModel::data(const SearchResultFile *file, int role) con break; case ItemDataRoles::FileNameRole: case Qt::ToolTipRole: - result = file->fileName(); + result = QDir::toNativeSeparators(file->fileName()); break; case ItemDataRoles::ResultLinesCountRole: result = file->childrenCount(); @@ -270,6 +279,10 @@ QVariant SearchResultTreeModel::headerData(int section, Qt::Orientation orientat void SearchResultTreeModel::appendResultFile(const QString &fileName) { +#ifdef Q_OS_WIN + if (fileName.contains(QLatin1Char('\\'))) + qWarning("SearchResultTreeModel::appendResultFile: File name with native separators added %s.\n", qPrintable(fileName)); +#endif m_lastAppendedResultFile = new SearchResultFile(fileName, m_rootItem); if (m_showReplaceUI) { diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 419784887f08802591ce8c2ecde796f199eaaa83..486196174af14489508f7d708bca781dfa2f8130 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -34,6 +34,7 @@ #include "gitconstants.h" #include "gitplugin.h" #include "gitsubmiteditor.h" +#include "gitversioncontrol.h" #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/coreconstants.h> @@ -43,6 +44,9 @@ #include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/uniqueidmanager.h> #include <coreplugin/filemanager.h> +#include <coreplugin/filemanager.h> +#include <coreplugin/iversioncontrol.h> + #include <texteditor/itexteditor.h> #include <utils/qtcassert.h> #include <vcsbase/vcsbaseeditor.h> @@ -55,6 +59,7 @@ #include <QtCore/QTime> #include <QtCore/QFileInfo> #include <QtCore/QDir> +#include <QtCore/QSignalMapper> #include <QtGui/QMainWindow> // for msg box parent #include <QtGui/QMessageBox> @@ -102,7 +107,8 @@ static QString formatCommand(const QString &binary, const QStringList &args) GitClient::GitClient(GitPlugin* plugin) : m_msgWait(tr("Waiting for data...")), m_plugin(plugin), - m_core(Core::ICore::instance()) + m_core(Core::ICore::instance()), + m_repositoryChangedSignalMapper(0) { if (QSettings *s = m_core->settings()) { m_settings.fromSettings(s); @@ -317,7 +323,8 @@ void GitClient::checkoutBranch(const QString &workingDirectory, const QString &b { QStringList arguments(QLatin1String("checkout")); arguments << branch; - executeGit(workingDirectory, arguments, 0, true); + GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true); + connectRepositoryChanged(workingDirectory, cmd); } void GitClient::checkout(const QString &workingDirectory, const QString &fileName) @@ -341,7 +348,8 @@ void GitClient::hardReset(const QString &workingDirectory, const QString &commit if (!commit.isEmpty()) arguments << commit; - executeGit(workingDirectory, arguments, 0, true); + GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true); + connectRepositoryChanged(workingDirectory, cmd); } void GitClient::addFile(const QString &workingDirectory, const QString &fileName) @@ -500,18 +508,19 @@ GitCommand *GitClient::createCommand(const QString &workingDirectory, } // Execute a single command -void GitClient::executeGit(const QString &workingDirectory, - const QStringList &arguments, - VCSBase::VCSBaseEditor* editor, - bool outputToWindow, - GitCommand::TerminationReportMode tm, - int editorLineNumber) +GitCommand *GitClient::executeGit(const QString &workingDirectory, + const QStringList &arguments, + VCSBase::VCSBaseEditor* editor, + bool outputToWindow, + GitCommand::TerminationReportMode tm, + int editorLineNumber) { VCSBase::VCSBaseOutputWindow::instance()->appendCommand(formatCommand(QLatin1String(Constants::GIT_BINARY), arguments)); GitCommand *command = createCommand(workingDirectory, editor, outputToWindow, editorLineNumber); command->addJob(arguments, m_settings.timeout); command->setTerminationReportMode(tm); command->execute(); + return command; } // Return fixed arguments required to run @@ -903,6 +912,8 @@ void GitClient::revert(const QStringList &files) QString errorMessage; switch (revertI(files, &isDirectory, &errorMessage)) { case RevertOk: + m_plugin->versionControl()->emitFilesChanged(files); + break; case RevertCanceled: break; case RevertUnchanged: { @@ -918,7 +929,8 @@ void GitClient::revert(const QStringList &files) void GitClient::pull(const QString &workingDirectory) { - executeGit(workingDirectory, QStringList(QLatin1String("pull")), 0, true, GitCommand::ReportStderr); + GitCommand *cmd = executeGit(workingDirectory, QStringList(QLatin1String("pull")), 0, true, GitCommand::ReportStderr); + connectRepositoryChanged(workingDirectory, cmd); } void GitClient::push(const QString &workingDirectory) @@ -952,7 +964,8 @@ void GitClient::stashPop(const QString &workingDirectory) { QStringList arguments(QLatin1String("stash")); arguments << QLatin1String("pop"); - executeGit(workingDirectory, arguments, 0, true); + GitCommand *cmd = executeGit(workingDirectory, arguments, 0, true); + connectRepositoryChanged(workingDirectory, cmd); } void GitClient::branchList(const QString &workingDirectory) @@ -1000,3 +1013,16 @@ void GitClient::setSettings(const GitSettings &s) m_binaryPath = m_settings.gitBinaryPath(); } } + +void GitClient::connectRepositoryChanged(const QString & repository, GitCommand *cmd) +{ + // Bind command success termination with repository to changed signal + if (!m_repositoryChangedSignalMapper) { + m_repositoryChangedSignalMapper = new QSignalMapper(this); + connect(m_repositoryChangedSignalMapper, SIGNAL(mapped(QString)), + m_plugin->versionControl(), SIGNAL(repositoryChanged(QString))); + } + m_repositoryChangedSignalMapper->setMapping(cmd, repository); + connect(cmd, SIGNAL(success()), m_repositoryChangedSignalMapper, SLOT(map()), + Qt::QueuedConnection); +} diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 341e177f35380a725a27ac454db9fdc2294cd156..76da31203479171106ff7c997bc1e5a0a6bbea18 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -33,7 +33,6 @@ #include "gitsettings.h" #include "gitcommand.h" -#include <coreplugin/iversioncontrol.h> #include <coreplugin/editormanager/ieditor.h> #include <QtCore/QString> @@ -41,6 +40,7 @@ QT_BEGIN_NAMESPACE class QErrorMessage; +class QSignalMapper; QT_END_NAMESPACE namespace Core { @@ -158,12 +158,12 @@ private: bool outputToWindow = false, int editorLineNumber = -1); - void executeGit(const QString &workingDirectory, - const QStringList &arguments, - VCSBase::VCSBaseEditor* editor = 0, - bool outputToWindow = false, - GitCommand::TerminationReportMode tm = GitCommand::NoReport, - int editorLineNumber = -1); + GitCommand *executeGit(const QString &workingDirectory, + const QStringList &arguments, + VCSBase::VCSBaseEditor* editor = 0, + bool outputToWindow = false, + GitCommand::TerminationReportMode tm = GitCommand::NoReport, + int editorLineNumber = -1); bool synchronousGit(const QString &workingDirectory, const QStringList &arguments, @@ -173,12 +173,14 @@ private: enum RevertResult { RevertOk, RevertUnchanged, RevertCanceled, RevertFailed }; RevertResult revertI(QStringList files, bool *isDirectory, QString *errorMessage); + void connectRepositoryChanged(const QString & repository, GitCommand *cmd); const QString m_msgWait; GitPlugin *m_plugin; Core::ICore *m_core; GitSettings m_settings; QString m_binaryPath; + QSignalMapper *m_repositoryChangedSignalMapper; }; diff --git a/src/plugins/git/gitcommand.cpp b/src/plugins/git/gitcommand.cpp index 3f7a97095e64f9e355ed4629fdc4c80b5e0aa98f..ea6c17dab1310e5fe1ae1f31a726e40d10a99ea3 100644 --- a/src/plugins/git/gitcommand.cpp +++ b/src/plugins/git/gitcommand.cpp @@ -177,6 +177,8 @@ void GitCommand::run() emit errorText(error); emit finished(ok, m_cookie); + if (ok) + emit success(); // As it is used asynchronously, we need to delete ourselves this->deleteLater(); } diff --git a/src/plugins/git/gitcommand.h b/src/plugins/git/gitcommand.h index 7acf167750f7c5e4f3a9b7aef0da52d6905357f9..8f1c5aad0ec4e7d2784bbfe15bdf2dfe21ddf82b 100644 --- a/src/plugins/git/gitcommand.h +++ b/src/plugins/git/gitcommand.h @@ -73,6 +73,7 @@ Q_SIGNALS: void outputData(const QByteArray&); void errorText(const QString&); void finished(bool ok, const QVariant &cookie); + void success(); private: struct Job { diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 7b51b39fbf895ca59654395d2ab2824ad41e7bc5..6e442bec7f240e3a0f8a5f062cb7421d3d61aa6f 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -142,6 +142,7 @@ GitPlugin::GitPlugin() : m_stashListAction(0), m_branchListAction(0), m_gitClient(0), + m_versionControl(0), m_changeSelectionDialog(0), m_submitActionTriggered(false) { @@ -215,8 +216,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) addAutoReleasedObject(new GitSubmitEditorFactory(&submitParameters)); - GitVersionControl *versionControl = new GitVersionControl(m_gitClient); - addAutoReleasedObject(versionControl); + m_versionControl = new GitVersionControl(m_gitClient); + addAutoReleasedObject(m_versionControl); addAutoReleasedObject(new CloneWizard); addAutoReleasedObject(new Gitorious::Internal::GitoriousCloneWizard); @@ -232,8 +233,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) gitContainer->menu()->setTitle(tr("&Git")); toolsContainer->addMenu(gitContainer); if (QAction *ma = gitContainer->menu()->menuAction()) { - ma->setEnabled(versionControl->isEnabled()); - connect(versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool))); + ma->setEnabled(m_versionControl->isEnabled()); + connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool))); } Core::Command *command; @@ -398,6 +399,11 @@ void GitPlugin::extensionsInitialized() { } +GitVersionControl *GitPlugin::versionControl() const +{ + return m_versionControl; +} + void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList &staged) { m_gitClient->diff(m_submitRepository, QStringList(), unstaged, staged); @@ -753,6 +759,7 @@ void GitPlugin::updateActions() m_statusProjectAction->setEnabled(false); m_logProjectAction->setParameter(repository); m_logProjectAction->setEnabled(false); + m_undoProjectAction->setEnabled(false); return; } @@ -772,6 +779,7 @@ void GitPlugin::updateActions() m_statusProjectAction->setParameter(project); m_logProjectAction->setEnabled(enabled); m_logProjectAction->setParameter(project); + m_undoProjectAction->setEnabled(enabled); } void GitPlugin::showCommit() diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index 4f934a893936a4f5dda262656a971f165e8a1348..0d6ad7fbdd5f412efedb67daf7b1d47c412a4ed6 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -59,6 +59,7 @@ namespace Git { namespace Internal { class GitPlugin; +class GitVersionControl; class GitClient; class ChangeSelectionDialog; class GitSubmitEditor; @@ -96,6 +97,7 @@ public: void setSettings(const GitSettings &s); GitClient *gitClient() const; + GitVersionControl *versionControl() const; public slots: void updateActions(); @@ -159,6 +161,7 @@ private: QAction *m_branchListAction; GitClient *m_gitClient; + GitVersionControl *m_versionControl; ChangeSelectionDialog *m_changeSelectionDialog; QString m_submitRepository; QStringList m_submitOrigCommitFiles; diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index 559d296220e4acd7521d9521a6293f2c6a5e0272..c64a683bea0622f92a9ed46e3c3358e3159556f1 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -96,5 +96,10 @@ QString GitVersionControl::findTopLevelForDirectory(const QString &directory) co return GitClient::findRepositoryForDirectory(directory); } +void GitVersionControl::emitFilesChanged(const QStringList &l) +{ + emit filesChanged(l); +} + } // Internal } // Git diff --git a/src/plugins/git/gitversioncontrol.h b/src/plugins/git/gitversioncontrol.h index 72908b0da226e8f2bedb2859c8f3f8f103088ba7..44598000638800f3ad57de9da892ffff926221e6 100644 --- a/src/plugins/git/gitversioncontrol.h +++ b/src/plugins/git/gitversioncontrol.h @@ -57,6 +57,8 @@ public: virtual bool vcsAdd(const QString &fileName); virtual bool vcsDelete(const QString &filename); + void emitFilesChanged(const QStringList &); + signals: void enabledChanged(bool); diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 7039798b0942a5788ce9a585fbf73acadb3c7c81..a80d8f559734d6bb7d8a00230e398ac0974a5cde 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -454,6 +454,8 @@ void PerforcePlugin::revertCurrentFile() Core::FileChangeBlocker fcb(fileName); fcb.setModifiedReload(true); PerforceResponse result2 = runP4Cmd(QStringList() << QLatin1String("revert") << fileName, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + if (!result2.error) + m_versionControl->emitFilesChanged(QStringList(fileName)); } void PerforcePlugin::diffCurrentFile() @@ -514,7 +516,10 @@ void PerforcePlugin::updateCheckout(const QStringList &dirs) { QStringList args(QLatin1String("sync")); args.append(dirs); - runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + const PerforceResponse resp = runP4Cmd(args, QStringList(), CommandToWindow|StdOutToWindow|StdErrToWindow|ErrorToWindow); + if (!dirs.empty()) + foreach(const QString &dir, dirs) + m_versionControl->emitRepositoryChanged(dir); } void PerforcePlugin::printOpenedFileList() diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 040692428d83c171daac4d841249f2b0923aedf2..ad915b2a2085f42ff63aec3e0da6fd8fc7d1d073 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -94,5 +94,15 @@ QString PerforceVersionControl::findTopLevelForDirectory(const QString &director return m_plugin->findTopLevelForDirectory(directory); } +void PerforceVersionControl::emitRepositoryChanged(const QString &s) +{ + emit repositoryChanged(s); +} + +void PerforceVersionControl::emitFilesChanged(const QStringList &l) +{ + emit filesChanged(l); +} + } // Internal } // Perforce diff --git a/src/plugins/perforce/perforceversioncontrol.h b/src/plugins/perforce/perforceversioncontrol.h index 2992e5518be1cc13fde2b506fc943eba52c2b09c..dd385061cbca5e80267a4ec43f54712381ca94bc 100644 --- a/src/plugins/perforce/perforceversioncontrol.h +++ b/src/plugins/perforce/perforceversioncontrol.h @@ -56,6 +56,9 @@ public: virtual bool vcsAdd(const QString &fileName); virtual bool vcsDelete(const QString &filename); + void emitRepositoryChanged(const QString &s); + void emitFilesChanged(const QStringList &l); + signals: void enabledChanged(bool); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 6aa8ea34de89d6927eebe82f4e51ab648aa00a0c..d99907bea5720321903f750d2039fa024b2fc8eb 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -61,7 +61,8 @@ bool RunConfiguration::isEnabled() const { if (!m_project) return false; - if (!m_project->activeBuildConfiguration()) + if (m_project->hasBuildSettings() + && !m_project->activeBuildConfiguration()) return false; return isEnabled(m_project->activeBuildConfiguration()); } diff --git a/src/plugins/qmleditor/qmleditor.cpp b/src/plugins/qmleditor/qmleditor.cpp index e82d9319d57c604e3e21b131465120654e6b652a..2819b87f68fb3fe365cc6148c993363dfef52a9d 100644 --- a/src/plugins/qmleditor/qmleditor.cpp +++ b/src/plugins/qmleditor/qmleditor.cpp @@ -762,7 +762,7 @@ TextEditor::BaseTextEditor::Link ScriptEditor::findLinkAt(const QTextCursor &cur void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) { - QMenu *menu = createStandardContextMenu(); + QMenu *menu = new QMenu(); if (Core::ActionContainer *mcontext = Core::ICore::instance()->actionManager()->actionContainer(QmlEditor::Constants::M_CONTEXT)) { QMenu *contextMenu = mcontext->menu(); @@ -778,6 +778,8 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) connect(a, SIGNAL(triggered()), this, SLOT(renameIdUnderCursor())); } + appendStandardContextMenuActions(menu); + menu->exec(e->globalPos()); menu->deleteLater(); } diff --git a/src/plugins/qmleditor/qmleditorplugin.cpp b/src/plugins/qmleditor/qmleditorplugin.cpp index e0bfedc94de34d8133ece81366b67bc15b758f51..078e88a719828680448fe336b9d98c8253e20de8 100644 --- a/src/plugins/qmleditor/qmleditorplugin.cpp +++ b/src/plugins/qmleditor/qmleditorplugin.cpp @@ -114,6 +114,13 @@ bool QmlEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err | TextEditor::TextEditorActionHandler::UnCollapseAll); m_actionHandler->initializeActions(); + Core::ActionManager *am = core->actionManager(); + Core::ActionContainer *contextMenu= am->createMenu(QmlEditor::Constants::M_CONTEXT); + Core::Command *cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION); + contextMenu->addAction(cmd); + cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION); + contextMenu->addAction(cmd); + m_completion = new QmlCodeCompletion(m_modelManager); addAutoReleasedObject(m_completion); diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp index 3c467bb1cb846e3dff87d2f897398f7b442d7fbf..ab4bb0df8df73aeb0bdfde09cb9ff6d1f5623895 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.cpp @@ -51,6 +51,17 @@ ToolChain::ToolChainType GCCEToolChain::type() const return ToolChain::GCCE; } +QByteArray GCCEToolChain::predefinedMacros() +{ + if (m_predefinedMacros.isEmpty()) { + ProjectExplorer::GccToolChain::predefinedMacros(); + m_predefinedMacros += "\n" + "#define __GCCE__\n" + "#define __SYMBIAN32__\n"; + } + return m_predefinedMacros; +} + QList<HeaderPath> GCCEToolChain::systemHeaderPaths() { if (m_systemHeaderPaths.isEmpty()) { diff --git a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h index 53cd0515c59db6045d8f97d55ba0f2756807641f..84d30909dc2f4ef39cbbf78f94ef9ca5a3550f1b 100644 --- a/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/gccetoolchain.h @@ -41,6 +41,7 @@ class GCCEToolChain : public ProjectExplorer::GccToolChain { public: GCCEToolChain(S60Devices::Device device, const QString &gcceCommand); + QByteArray predefinedMacros(); QList<ProjectExplorer::HeaderPath> systemHeaderPaths(); void addToEnvironment(ProjectExplorer::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp index f12c509f8287e8e8b4c1a6719aa8b49bafbae18a..46524f72d3079881a2aedbf9c7da95ecd62433a3 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp @@ -77,7 +77,7 @@ QByteArray RVCTToolChain::predefinedMacros() { // see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0205f/Babbacdb.html updateVersion(); - QByteArray ba = QString::fromLocal8Bit( + QByteArray ba = QString::fromLatin1( "#define __arm__arm__\n" "#define __ARMCC_VERSION %1%2%3%4\n" "#define __ARRAY_OPERATORS\n" @@ -93,10 +93,11 @@ QByteArray RVCTToolChain::predefinedMacros() "#define __TARGET_FEATURE_HALFWORD\n" "#define __TARGET_FEATURE_THUMB\n" "#define _WCHAR_T\n" + "#define __SYMBIAN32__\n" ).arg(m_major, 1, 10, QLatin1Char('0')) .arg(m_minor, 1, 10, QLatin1Char('0')) .arg("0") - .arg(m_build, 3, 10, QLatin1Char('0')).toLocal8Bit(); + .arg(m_build, 3, 10, QLatin1Char('0')).toLatin1(); return ba; } diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp index 572f1c76fb0df5145e96d575643dde018698e871..0d9b27cf8a98cbae0c23dac9dab10e7c2c78b4e3 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp @@ -29,6 +29,8 @@ #include "winscwtoolchain.h" +#include <QtCore/QByteArray> +#include <QtCore/QString> #include <QtDebug> using namespace ProjectExplorer; @@ -50,8 +52,7 @@ ToolChain::ToolChainType WINSCWToolChain::type() const QByteArray WINSCWToolChain::predefinedMacros() { - // TODO - return m_predefinedMacros; + return QByteArray("#define __SYMBIAN32__\n"); } QList<HeaderPath> WINSCWToolChain::systemHeaderPaths() @@ -67,10 +68,8 @@ QList<HeaderPath> WINSCWToolChain::systemHeaderPaths() QStringList WINSCWToolChain::systemIncludes() const { if (m_carbidePath.isEmpty()) { - qDebug() << "no carbide path set"; ProjectExplorer::Environment env = ProjectExplorer::Environment::systemEnvironment(); QString symIncludesValue = env.value("MWCSYM2INCLUDES"); - qDebug() << "includes:" << symIncludesValue.split(";"); if (!symIncludesValue.isEmpty()) return symIncludesValue.split(";"); } else { diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h index c37faaaf034b7cbfde87bda9311edb3bc5c649c2..54f25cba48436f832f87e6786a962123ab8803b5 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h @@ -57,7 +57,6 @@ private: QString m_deviceId; QString m_deviceName; QString m_deviceRoot; - QByteArray m_predefinedMacros; QList<ProjectExplorer::HeaderPath> m_systemHeaderPaths; }; diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index ff9f17efaef767c14638dca853cdd54622acbdf1..bcfd15cf379102494d819920154a396ce1f31c6f 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -110,6 +110,8 @@ bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configu if (type == ProjectExplorer::ToolChain::GCC_MAEMO) return false; #endif +#else + Q_UNUSED(configuration); #endif return true; } diff --git a/src/plugins/qt4projectmanager/qtoptionspage.cpp b/src/plugins/qt4projectmanager/qtoptionspage.cpp index 297ee8596275330ed04f5648141f8db7bae46a38..50fe634a878a141bc3d6f31f23950769878519d2 100644 --- a/src/plugins/qt4projectmanager/qtoptionspage.cpp +++ b/src/plugins/qt4projectmanager/qtoptionspage.cpp @@ -399,7 +399,9 @@ void QtOptionsPageWidget::updateState() m_ui->qmakePath->setEnabled(enabled && !isAutodetected); m_ui->mingwPath->setEnabled(enabled); m_ui->mwcPath->setEnabled(enabled); - m_ui->s60SDKPath->setEnabled(enabled && !isAutodetected); + bool s60SDKPathEnabled = enabled && + (isAutodetected ? version->s60SDKDirectory().isEmpty() : true); + m_ui->s60SDKPath->setEnabled(s60SDKPathEnabled); m_ui->gccePath->setEnabled(enabled); const bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty(); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index d3090e481f1d236e0b87b48f720b0cb3826d58be..a03f7f0bec922fe7521858297c0b20ce57214a13 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -128,11 +128,9 @@ QtVersionManager::QtVersionManager() autodetectionSource); version->setMingwDirectory(s->value("MingwDirectory").toString()); version->setMsvcVersion(s->value("msvcVersion").toString()); -#ifdef QTCREATOR_WITH_S60 version->setMwcDirectory(s->value("MwcDirectory").toString()); version->setS60SDKDirectory(s->value("S60SDKDirectory").toString()); version->setGcceDirectory(s->value("GcceDirectory").toString()); -#endif m_versions.append(version); } s->endArray(); @@ -266,11 +264,9 @@ void QtVersionManager::writeVersionsIntoSettings() s->setValue("isAutodetected", version->isAutodetected()); if (version->isAutodetected()) s->setValue("autodetectionSource", version->autodetectionSource()); -#ifdef QTCREATOR_WITH_S60 s->setValue("MwcDirectory", version->mwcDirectory()); s->setValue("S60SDKDirectory", version->s60SDKDirectory()); s->setValue("GcceDirectory", version->gcceDirectory()); -#endif } s->endArray(); } @@ -1219,7 +1215,6 @@ void QtVersion::updateToolChainAndMkspec() const m_toolChainUpToDate = true; } -#ifdef QTCREATOR_WITH_S60 QString QtVersion::mwcDirectory() const { return m_mwcDirectory; @@ -1248,7 +1243,6 @@ void QtVersion::setGcceDirectory(const QString &directory) { m_gcceDirectory = directory; } -#endif QString QtVersion::mingwDirectory() const { diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index 07e97d3f2894e089e73cb1ba5900e49d8b23d5b5..bbcdb51484548d443cba4829d3fbf5c472e1d48c 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -92,14 +92,13 @@ public: // Returns the PREFIX, BINPREFIX, DOCPREFIX and similar information QHash<QString,QString> versionInfo() const; -#ifdef QTCREATOR_WITH_S60 QString mwcDirectory() const; void setMwcDirectory(const QString &directory); QString s60SDKDirectory() const; void setS60SDKDirectory(const QString &directory); QString gcceDirectory() const; void setGcceDirectory(const QString &directory); -#endif + QString mingwDirectory() const; void setMingwDirectory(const QString &directory); QString msvcVersion() const; @@ -153,11 +152,10 @@ private: bool m_isAutodetected; QString m_autodetectionSource; bool m_hasDebuggingHelper; -#ifdef QTCREATOR_WITH_S60 + QString m_mwcDirectory; QString m_s60SDKDirectory; QString m_gcceDirectory; -#endif mutable bool m_toolChainUpToDate; mutable QString m_mkspec; // updated lazily diff --git a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp index 0cfbb7dcaa2a0fe59b7c80f6b447c213911e53f8..a658a6bc2234bd28f324280649a4e54238fd791f 100644 --- a/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp +++ b/src/plugins/qt4projectmanager/wizards/qtprojectparameters.cpp @@ -28,6 +28,7 @@ **************************************************************************/ #include "qtprojectparameters.h" +#include <utils/codegeneration.h> #include <QtCore/QTextStream> #include <QtCore/QDir> @@ -108,7 +109,7 @@ QString createMacro(const QString &name, const QString &suffix) if (extensionPosition != -1) rc.truncate(extensionPosition); rc += suffix; - return rc; + return Utils::fileNameToCppIdentifier(rc); } QString QtProjectParameters::exportMacro(const QString &projectName) diff --git a/src/plugins/qtscripteditor/qtscripteditor.cpp b/src/plugins/qtscripteditor/qtscripteditor.cpp index 403571b14ccf36467f277c596ca42bfdaf912bf3..d751a87d39560e9290ac29ccb7ed58840819dbda 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.cpp +++ b/src/plugins/qtscripteditor/qtscripteditor.cpp @@ -40,6 +40,7 @@ #include "parser/javascriptast_p.h" #include <indenter.h> +#include <utils/uncommentselection.h> #include <coreplugin/icore.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -395,7 +396,7 @@ void ScriptEditor::createToolBar(ScriptEditorEditable *editable) void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) { - QMenu *menu = createStandardContextMenu(); + QMenu *menu = new QMenu(); if (Core::ActionContainer *mcontext = Core::ICore::instance()->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) { QMenu *contextMenu = mcontext->menu(); @@ -403,9 +404,15 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e) menu->addAction(action); } + appendStandardContextMenuActions(menu); menu->exec(e->globalPos()); delete menu; } +void ScriptEditor::unCommentSelection() +{ + Utils::unCommentSelection(this); +} + } // namespace Internal } // namespace QtScriptEditor diff --git a/src/plugins/qtscripteditor/qtscripteditor.h b/src/plugins/qtscripteditor/qtscripteditor.h index 06e72371bd1692eeed2dfd9cfd66eff496fd3523..6556176a350c6c928f333837aa3c1607f7183833 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.h +++ b/src/plugins/qtscripteditor/qtscripteditor.h @@ -95,6 +95,8 @@ public: QList<Declaration> declarations() const; QStringList words() const; + void unCommentSelection(); // from basetexteditor + public slots: virtual void setFontSettings(const TextEditor::FontSettings &); diff --git a/src/plugins/qtscripteditor/qtscripteditor.pro b/src/plugins/qtscripteditor/qtscripteditor.pro index 7fd3ff19c6dbd23306e7620cbd57042ddb7d1846..2ff0c5699e75db66a4d99252dcacf114e2cf597a 100644 --- a/src/plugins/qtscripteditor/qtscripteditor.pro +++ b/src/plugins/qtscripteditor/qtscripteditor.pro @@ -13,14 +13,12 @@ HEADERS += qtscripteditor.h \ qtscripteditorfactory.h \ qtscripteditorplugin.h \ qtscripthighlighter.h \ -qtscripteditoractionhandler.h \ qtscriptcodecompletion.h SOURCES += qtscripteditor.cpp \ qtscripteditorfactory.cpp \ qtscripteditorplugin.cpp \ qtscripthighlighter.cpp \ -qtscripteditoractionhandler.cpp \ qtscriptcodecompletion.cpp RESOURCES += qtscripteditor.qrc diff --git a/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp b/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp deleted file mode 100644 index b00ac381ebace9dc7c65f8c6843cb97a704de908..0000000000000000000000000000000000000000 --- a/src/plugins/qtscripteditor/qtscripteditoractionhandler.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "qtscripteditoractionhandler.h" -#include "qtscripteditorconstants.h" -#include "qtscripteditor.h" - -#include <coreplugin/icore.h> -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/scriptmanager/scriptmanager.h> - -#include <QtCore/QDebug> -#include <QtGui/QAction> -#include <QtGui/QMainWindow> -#include <QtGui/QMessageBox> - -static QAction *actionFromId(const QString &id) -{ - Core::Command *cmd = Core::ICore::instance()->actionManager()->command(id); - if (!cmd) - return 0; - return cmd->action(); -} - -namespace QtScriptEditor { -namespace Internal { - -QtScriptEditorActionHandler::QtScriptEditorActionHandler() - : TextEditor::TextEditorActionHandler(QLatin1String(QtScriptEditor::Constants::C_QTSCRIPTEDITOR), - Format), - m_runAction(0) -{ -} - -void QtScriptEditorActionHandler::createActions() -{ - TextEditor::TextEditorActionHandler::createActions(); - m_runAction = actionFromId(QLatin1String(QtScriptEditor::Constants::RUN)); - connect(m_runAction, SIGNAL(triggered()), this, SLOT(run())); -} - - -void QtScriptEditorActionHandler::run() -{ - typedef Core::ScriptManager::Stack Stack; - if (!currentEditor()) - return; - - const QString script = currentEditor()->toPlainText(); - - // run - Stack errorStack; - QString errorMessage; - if (Core::ICore::instance()->scriptManager()->runScript(script, &errorMessage, &errorStack)) - return; - - // try to find a suitable error line in the stack - // ignoring 0 and other files (todo: open other files?) - int errorLineNumber = 0; - if (const int numFrames = errorStack.size()) { - for (int f = 0; f < numFrames; f++) { - if (errorStack[f].lineNumber && errorStack[f].fileName.isEmpty()) { - errorLineNumber = errorStack[f].lineNumber; - break; - } - } - } - if (errorLineNumber) - currentEditor()->gotoLine(errorLineNumber); - QMessageBox::critical(Core::ICore::instance()->mainWindow(), tr("Qt Script Error"), errorMessage); -} - -} // namespace Internal -} // namespace QtScriptEditor diff --git a/src/plugins/qtscripteditor/qtscripteditoractionhandler.h b/src/plugins/qtscripteditor/qtscripteditoractionhandler.h deleted file mode 100644 index 3272a77c2f793b856e9a38ae0eb8bfd54a420685..0000000000000000000000000000000000000000 --- a/src/plugins/qtscripteditor/qtscripteditoractionhandler.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef QTSCRIPTDITORACTIONHANDLER_H -#define QTSCRIPTDITORACTIONHANDLER_H - -#include <texteditor/texteditoractionhandler.h> - -namespace QtScriptEditor { -namespace Internal { - -class QtScriptEditorActionHandler : public TextEditor::TextEditorActionHandler -{ - Q_OBJECT - -public: - QtScriptEditorActionHandler(); - -private: - virtual void createActions(); - -private slots: - void run(); - -private: - QAction *m_runAction; -}; - -} // namespace Internal -} // namespace QtScriptEditor - -#endif // QTSCRIPTDITORACTIONHANDLER_H diff --git a/src/plugins/qtscripteditor/qtscripteditorconstants.h b/src/plugins/qtscripteditor/qtscripteditorconstants.h index 401697a8141284c59f93556328e7f52430821d54..0c7704ba0dea32f3efd502e83dad2009d0ed8ad8 100644 --- a/src/plugins/qtscripteditor/qtscripteditorconstants.h +++ b/src/plugins/qtscripteditor/qtscripteditorconstants.h @@ -34,8 +34,6 @@ namespace QtScriptEditor { namespace Constants { const char * const M_CONTEXT = "Qt Script Editor.ContextMenu"; -const char * const RUN = "QtScriptEditor.Run"; -const char * const RUN_SEP = "QtScriptEditor.Run.Separator"; const char * const C_QTSCRIPTEDITOR = "Qt Script Editor"; const char * const C_QTSCRIPTEDITOR_MIMETYPE = "application/javascript"; diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp index 03cf1b98449ffbfc06ab8e42b90dc2e5370e760d..7e4ae5715b22e21b9d076fee64b0beb810ee3f14 100644 --- a/src/plugins/qtscripteditor/qtscripteditorfactory.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorfactory.cpp @@ -29,11 +29,14 @@ #include "qtscripteditorfactory.h" #include "qtscripteditor.h" -#include "qtscripteditoractionhandler.h" #include "qtscripteditorconstants.h" #include "qtscripteditorplugin.h" +#include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> +#include <coreplugin/actionmanager/actionmanager.h> + +#include <texteditor/texteditorconstants.h> #include <QtCore/QFileInfo> #include <QtCore/QDebug> @@ -45,14 +48,12 @@ QtScriptEditorFactory::QtScriptEditorFactory(const Context &context, QObject *pa : Core::IEditorFactory(parent), m_kind(QLatin1String(C_QTSCRIPTEDITOR)), m_mimeTypes(QLatin1String(QtScriptEditor::Constants::C_QTSCRIPTEDITOR_MIMETYPE)), - m_context(context), - m_actionHandler(new QtScriptEditorActionHandler) + m_context(context) { } QtScriptEditorFactory::~QtScriptEditorFactory() { - delete m_actionHandler; } QString QtScriptEditorFactory::kind() const diff --git a/src/plugins/qtscripteditor/qtscripteditorfactory.h b/src/plugins/qtscripteditor/qtscripteditorfactory.h index 93c222daa98198edadea1c44f4c16206596d940d..0556f35f16c47202269abcf29a309bde85d25f5d 100644 --- a/src/plugins/qtscripteditor/qtscripteditorfactory.h +++ b/src/plugins/qtscripteditor/qtscripteditorfactory.h @@ -63,8 +63,6 @@ private: const QString m_kind; const QStringList m_mimeTypes; const Context m_context; - - TextEditor::TextEditorActionHandler *m_actionHandler; }; } // namespace Internal diff --git a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp index c3c06b7280ae42d3305ad1d199c5658d2029afaa..266d2d48204ffc20d0c66f3acacd30673cefd6fa 100644 --- a/src/plugins/qtscripteditor/qtscripteditorplugin.cpp +++ b/src/plugins/qtscripteditor/qtscripteditorplugin.cpp @@ -88,6 +88,11 @@ bool QtScriptEditorPlugin::initialize(const QStringList & /*arguments*/, QString m_context = m_scriptcontext; m_context << core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR); + m_actionHandler = new TextEditor::TextEditorActionHandler(QtScriptEditor::Constants::C_QTSCRIPTEDITOR, + TextEditor::TextEditorActionHandler::Format + | TextEditor::TextEditorActionHandler::UnCommentSelection + | TextEditor::TextEditorActionHandler::UnCollapseAll); + registerActions(); m_editor = new QtScriptEditorFactory(m_context, this); @@ -104,10 +109,6 @@ bool QtScriptEditorPlugin::initialize(const QStringList & /*arguments*/, QString wizardParameters, this); addObject(m_wizard); - m_actionHandler = new TextEditor::TextEditorActionHandler(QtScriptEditor::Constants::C_QTSCRIPTEDITOR, - TextEditor::TextEditorActionHandler::Format - | TextEditor::TextEditorActionHandler::UnCommentSelection - | TextEditor::TextEditorActionHandler::UnCollapseAll); m_completion = new QtScriptCodeCompletion(); addAutoReleasedObject(m_completion); @@ -145,18 +146,13 @@ void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEdit void QtScriptEditorPlugin::registerActions() { - Core::ActionManager *am = Core::ICore::instance()->actionManager(); - Core::ActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT); - - QAction *action = new QAction(this); - action->setSeparator(true); - Core::Command *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext); - mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE); - - action = new QAction(tr("Run"), this); - cmd = am->registerAction(action, QtScriptEditor::Constants::RUN, m_scriptcontext); - cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R"))); - mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE); + m_actionHandler->initializeActions(); + Core::ActionManager *am = Core::ICore::instance()->actionManager(); + Core::ActionContainer *contextMenu= am->createMenu(QtScriptEditor::Constants::M_CONTEXT); + Core::Command *cmd = am->command(TextEditor::Constants::AUTO_INDENT_SELECTION); + contextMenu->addAction(cmd); + cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION); + contextMenu->addAction(cmd); } Q_EXPORT_PLUGIN(QtScriptEditorPlugin) diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index 32ef57e5ecce1599bb52162981b563676bde26b8..ff0e0f1c81e872b85872d5990ded86f5089870ac 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -96,3 +96,13 @@ QString SubversionControl::findTopLevelForDirectory(const QString &directory) co { return m_plugin->findTopLevelForDirectory(directory); } + +void SubversionControl::emitRepositoryChanged(const QString &s) +{ + emit repositoryChanged(s); +} + +void SubversionControl::emitFilesChanged(const QStringList &l) +{ + emit filesChanged(l); +} diff --git a/src/plugins/subversion/subversioncontrol.h b/src/plugins/subversion/subversioncontrol.h index 42f64ab147e30abe9f806d98d96502a4b16e471c..325cfd10989bb9a4cb435d633c2d911125695852 100644 --- a/src/plugins/subversion/subversioncontrol.h +++ b/src/plugins/subversion/subversioncontrol.h @@ -56,6 +56,9 @@ public: virtual bool vcsAdd(const QString &fileName); virtual bool vcsDelete(const QString &filename); + void emitRepositoryChanged(const QString &); + void emitFilesChanged(const QStringList &); + signals: void enabledChanged(bool); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 676ffc2b8ad517e15f9ced6e1de2906b475627e1..0060e0239535c3ca1edee3e7e6a6675fa2ac1b90 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -574,6 +574,7 @@ void SubversionPlugin::revertCurrentFile() const SubversionResponse revertResponse = runSvn(args, subversionShortTimeOut, true); if (!revertResponse.error) { fcb.setModifiedReload(true); + m_versionControl->emitFilesChanged(QStringList(file)); } } @@ -750,7 +751,10 @@ void SubversionPlugin::updateProject() QStringList args(QLatin1String("update")); args.push_back(QLatin1String(nonInteractiveOptionC)); args.append(topLevels); - runSvn(args, subversionLongTimeOut, true); + const SubversionResponse response = runSvn(args, subversionLongTimeOut, true); + if (!response.error) + foreach(const QString &repo, topLevels) + m_versionControl->emitRepositoryChanged(repo); } void SubversionPlugin::annotateCurrentFile() diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 1dcfce680324d1ffe7de4e3c8cf71c1bc3e888f8..6e3dab7e5d35235893bd2638fc755dfb01077589 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -56,6 +56,7 @@ namespace Subversion { namespace Internal { class SubversionSubmitEditor; +class SubversionControl; struct SubversionResponse { @@ -131,7 +132,7 @@ private: const QStringList m_svnDirectories; SubversionSettings m_settings; - Core::IVersionControl *m_versionControl; + SubversionControl *m_versionControl; QString m_commitMessageFileName; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index cd406907e038af12d4c1156206f87ba44192abaa..278ea7f0f2062530762f4f967a40fee4090f4e48 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2489,8 +2489,6 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e) int markWidth = 0; if (d->m_marksVisible) markWidth += fm.lineSpacing(); -// if (documentLayout->doubleMarkCount) -// markWidth += fm.lineSpacing() / 3; const int collapseColumnWidth = d->m_codeFoldingVisible ? collapseBoxWidth(fm): 0; const int extraAreaWidth = d->m_extraArea->width() - collapseColumnWidth; @@ -2519,6 +2517,12 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e) nextVisibleBlockNumber = nextVisibleBlock.blockNumber(); } + if (bottom < e->rect().top()) { + block = nextVisibleBlock; + blockNumber = nextVisibleBlockNumber; + continue; + } + painter.setPen(pal.color(QPalette::Dark)); if (d->m_codeFoldingVisible || d->m_marksVisible) { @@ -3411,6 +3415,16 @@ void BaseTextEditor::reindent(QTextDocument *doc, const QTextCursor &cursor) const QTextBlock end = doc->findBlock(cursor.selectionEnd()).next(); const TabSettings &ts = d->m_document->tabSettings(); + + // skip empty blocks + while (block.isValid() && block != end) { + QString bt = block.text(); + if (ts.firstNonSpace(bt) < bt.size()) + break; + indentBlock(doc, block, QChar::Null); + block = block.next(); + } + int previousIndentation = ts.indentationColumn(block.text()); indentBlock(doc, block, QChar::Null); int currentIndentation = ts.indentationColumn(block.text()); @@ -4654,6 +4668,7 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source) } cursor.beginEditBlock(); + cursor.removeSelectedText(); bool insertAtBeginningOfLine = ts.cursorIsAtBeginningOfLine(cursor); @@ -4664,8 +4679,6 @@ void BaseTextEditor::insertFromMimeData(const QMimeData *source) return; } - cursor.removeSelectedText(); - int reindentBlockStart = cursor.blockNumber() + (insertAtBeginningOfLine?0:1); bool hasFinalNewline = (text.endsWith(QLatin1Char('\n')) diff --git a/src/tools/qpatch/files-to-patch-windows b/src/tools/qpatch/files-to-patch-windows index 38545a7defc758085c74baf44ccb31618a219d64..a1fd431f9a2bc76147228a1eb4f108e9f4395f22 100644 --- a/src/tools/qpatch/files-to-patch-windows +++ b/src/tools/qpatch/files-to-patch-windows @@ -1,28 +1,27 @@ -bin/Qt3Supportd4.dll +bin/qmake.exe +bin/QtCore4.dll bin/QtCored4.dll -bin/QtGuid4.dll -bin/QtHelpd4.dll -bin/QtMultimediad4.dll -bin/QtNetworkd4.dll -bin/QtOpenGLd4.dll -bin/QtScriptd4.dll -bin/QtScriptToolsd4.dll -bin/QtSqld4.dll -bin/QtSvgd4.dll -bin/QtTestd4.dll -bin/QtWebKitd4.dll -bin/QtXmld4.dll -bin/QtXmlPatternsd4.dll -plugins/accessible/qtaccessiblecompatwidgetsd4.dll -plugins/accessible/qtaccessiblewidgetsd4.dll -plugins/codecs/qcncodecsd4.dll -plugins/codecs/qjpcodecsd4.dll -plugins/codecs/qkrcodecsd4.dll -plugins/codecs/qtwcodecsd4.dll -plugins/iconengines/qsvgicond4.dll -plugins/imageformats/qgifd4.dll -plugins/imageformats/qjpegd4.dll -plugins/imageformats/qmngd4.dll -plugins/imageformats/qsvgd4.dll -plugins/imageformats/qtiffd4.dll -plugins/sqldrivers/qsqlited4.dll +%% +mkspecs/default/qmake.conf +demos/shared/libdemo_shared.prl +lib/libQt3Support.prl +lib/libQtAssistantClient.prl +lib/libQtCLucene.prl +lib/libQtCore.prl +lib/libQtDBus.prl +lib/libQtDesignerComponents.prl +lib/libQtDesigner.prl +lib/libQtGui.prl +lib/libQtHelp.prl +lib/libQtMultimedia.prl +lib/libQtNetwork.prl +lib/libQtOpenGL.prl +lib/libQtScript.prl +lib/libQtScriptTools.prl +lib/libQtSql.prl +lib/libQtSvg.prl +lib/libQtTest.prl +lib/libQtUiTools.prl +lib/libQtWebKit.prl +lib/libQtXmlPatterns.prl +lib/libQtXml.prl diff --git a/src/tools/qtlibspatcher/qtlibspatchermain.cpp b/src/tools/qtlibspatcher/qtlibspatchermain.cpp index b478c02dd98e3859496c144ec6a4775fbd60cf2b..bf92cb3c1a6f802875cda62a125bcbf10729915b 100644 --- a/src/tools/qtlibspatcher/qtlibspatchermain.cpp +++ b/src/tools/qtlibspatcher/qtlibspatchermain.cpp @@ -38,7 +38,7 @@ #include <QtCore/QDebug> #ifdef Q_OS_WIN -# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.5.0/qt"; +# define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt"; const char * const oldInstallBase = QT_INSTALL_DIR; const char * const oldSourceBase = QT_INSTALL_DIR; @@ -170,6 +170,7 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) { "/bin/QtGuid4.dll" }, { "/bin/QtHelpd4.dll" }, { "/bin/QtNetworkd4.dll" }, + { "/bin/QtNetworkd4.dll" }, { "/bin/QtOpenGLd4.dll" }, { "/bin/QtScriptd4.dll" }, { "/bin/QtScriptToolsd4.dll" }, @@ -179,20 +180,6 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) { "/bin/QtWebKitd4.dll" }, { "/bin/QtXmld4.dll" }, { "/bin/QtXmlPatternsd4.dll" }, - { "/lib/Qt3Supportd4.dll" }, - { "/lib/QtCored4.dll" }, - { "/lib/QtGuid4.dll" }, - { "/lib/QtHelpd4.dll" }, - { "/lib/QtNetworkd4.dll" }, - { "/lib/QtOpenGLd4.dll" }, - { "/lib/QtScriptd4.dll" }, - { "/lib/QtScriptToolsd4.dll" }, - { "/lib/QtSqld4.dll" }, - { "/lib/QtSvgd4.dll" }, - { "/lib/QtTestd4.dll" }, - { "/lib/QtWebKitd4.dll" }, - { "/lib/QtXmld4.dll" }, - { "/lib/QtXmlPatternsd4.dll" }, { "/plugins/accessible/qtaccessiblecompatwidgetsd4.dll" }, { "/plugins/accessible/qtaccessiblewidgetsd4.dll" }, { "/plugins/codecs/qcncodecsd4.dll" }, @@ -445,26 +432,27 @@ bool patchDebugLibrariesWithQtPath(const char *baseQtPath) { "/examples/xmlpatterns/filetree/filetree" }, { "/examples/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel" }, { "/examples/xmlpatterns/recipes/recipes" }, - { "/lib/libQt3Support.so.4.5.0" }, - { "/lib/libQtAssistantClient.so.4.5.0" }, - { "/lib/libQtCLucene.so.4.5.0" }, - { "/lib/libQtCore.so.4.5.0" }, - { "/lib/libQtDBus.so.4.5.0" }, - { "/lib/libQtDesigner.so.4.5.0" }, - { "/lib/libQtDesignerComponents.so.4.5.0" }, - { "/lib/libQtGui.so.4.5.0" }, - { "/lib/libQtHelp.so.4.5.0" }, - { "/lib/libQtNetwork.so.4.5.0" }, - { "/lib/libQtOpenGL.so.4.5.0" }, - { "/lib/libQtScript.so.4.5.0" }, - { "/lib/libQtScriptTools.so.4.5.0" }, - { "/lib/libQtSql.so.4.5.0" }, - { "/lib/libQtSvg.so.4.5.0" }, - { "/lib/libQtTest.so.4.5.0" }, + { "/lib/libQt3Support.so" }, + { "/lib/libQtAssistantClient.so" }, + { "/lib/libQtCLucene.so" }, + { "/lib/libQtCore.so" }, + { "/lib/libQtDBus.so" }, + { "/lib/libQtDesigner.so" }, + { "/lib/libQtDesignerComponents.so" }, + { "/lib/libQtGui.so" }, + { "/lib/libQtHelp.so" }, + { "/lib/libQtMultimedia.so" }, + { "/lib/libQtNetwork.so" }, + { "/lib/libQtOpenGL.so" }, + { "/lib/libQtScript.so" }, + { "/lib/libQtScriptTools.so" }, + { "/lib/libQtSql.so" }, + { "/lib/libQtSvg.so" }, + { "/lib/libQtTest.so" }, { "/lib/libQtUiTools.a" }, - { "/lib/libQtWebKit.so.4.5.0" }, - { "/lib/libQtXml.so.4.5.0" }, - { "/lib/libQtXmlPatterns.so.4.5.0" }, + { "/lib/libQtWebKit.so" }, + { "/lib/libQtXml.so" }, + { "/lib/libQtXmlPatterns.so" }, { "/plugins/accessible/libqtaccessiblecompatwidgets.so" }, { "/plugins/accessible/libqtaccessiblewidgets.so" }, { "/plugins/codecs/libqcncodecs.so" }, @@ -572,6 +560,7 @@ const char * const textFileFileNames[] = "/lib/libQtDesigner.prl", "/lib/libQtGui.prl", "/lib/libQtHelp.prl", + "/lib/libQtMultimedia.prl", "/lib/libQtNetwork.prl", "/lib/libQtOpenGL.prl", "/lib/libQtScript.prl",