Commit Graph

32962 Commits

Author SHA1 Message Date
Orgad Shaneh
6bbee89653 QtSupport: Deduplicate code in QtOutputFormatter
Change-Id: I79a1c51fb52c66561d44acfb9c26c5ec24ca6e52
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-02-04 13:22:17 +00:00
Orgad Shaneh
3f1fd49c71 RemoteLinux: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: Id48e46fdfed83b82071551f4375fab3310ed1f6e
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-02-04 13:21:40 +00:00
Tobias Hunger
bfcce472e1 DiffEditor: Remove unnecessary instance() method from DiffEditorManager
The interface is static and the only slot that one can connect to is
private.

Change-Id: Iebd3747fecd24e0250d02e663de405e3f9217acb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-02-04 13:14:05 +00:00
Tobias Hunger
0a402aecd0 DiffEditor: Remove unused methods
The guicontroller is managed by the diffeditor, which is the only one able
to access these objects, so there is no need to ever return the pointer.

Change-Id: I6388a78bcadae67dae669bf7e96298444983c3e8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-02-04 13:13:51 +00:00
Tobias Hunger
d195807cc0 DiffEditor: Remove m_controller member
Not needed, we can just get the controller from the document at any time

Change-Id: I4a4ad9e3e343a147096e46406b9175b3f52f31a6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-02-04 13:13:40 +00:00
Tobias Hunger
e5cb8b1cd8 DiffEditor: Assert that document is passed in
Do not bother to check after that assert.

Change-Id: I4d8d8c8aa40420880824b7832005ab3f06df4aa7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-02-04 13:13:26 +00:00
hjk
d4a32fd6b3 Debugger: Implement native mixed breakpoints with LLDB
Breakpoints are hit, stack frames are identified as JS or native.
No further data yet.

Change-Id: I84a02422fd36dc7645003114dd8519bedd913c06
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 12:46:02 +00:00
Przemyslaw Gorszkowski
955e28f954 C++: fix auto declaration in if condition
Fix for auto completion in case of auto declaration inside if condition:

struct Foo { int bar; };
void func()
{
    if (auto s = new Foo)
        s->; // auto completion does not work
}

Task-number: QTCREATORBUG-13805
Change-Id: Ia1776e8cc04e6040a6bf5f43cf82cfd6ce6dde7a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 11:55:04 +00:00
hjk
7d4b9c4ba0 Debugger: Move some 'mixed native' code to DumperBase
Prepares reuse in LLDB.

Change-Id: I2238a94937411b80a9ec84ab738aba2146bba50e
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 11:30:27 +00:00
Orgad Shaneh
5d1e13fbd2 ProjectExplorer: Use explicit namespace
Change-Id: I923b856170f1c4ddd48da2434bf77d4b46da8d99
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-04 10:26:12 +00:00
Nikolai Kosjar
f0aea93b44 CppEditor: Tests: Move doxygen tests in separate test class
Change-Id: If27b4e11deafaefd95a5815466fc5fdac23ba30a
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-04 09:21:42 +00:00
Nikolai Kosjar
4f7eb4e6b8 Plugin Tests: Support additional test objects/classes
So far tests running within Qt Creator could be implemented with a
private slot in the plugin class starting with "test".

Binding the test functions to the plugin object/class is fine for test
functions without side effects. But as soon as side effects come into
play we need proper initialization and cleanup as it's provided by
init(), cleanup(), initTestCase() and cleanupTestCase(). However,
implementing these functions in the plugin class is not appropriate
since they would affect (potentially quite diverse) test functions.

This patch enables us to provide 'ordinary' test classes in which we can
handle initialization and clean up the usual way.

In addition to the current test invocations, e.g.:

    # (1) Run all test functions of the plugin
    ./qtcreator -test CppTools

    # (2) Run selected test functions of the plugin by stating them
    ./qtcreator -test CppTools,test_completion,test_builtinsymbolsearcher

    # (3) Run selected test functions of the plugin by a wild card
    # expression
    ./qtcreator -test "CppTools,*pointerdeclaration*"

    # (4) Run a test function of the plugin with certain test data
    ./qtcreator -test CppTools,test_completion:template_1

it's now also possible to state the test class in order to execute all
test functions of that class:

    # Run all test functions of a certain class:
    ./qtcreator -test CppTools,SomeClassWithTests

As long as the test class does not start with "test", there should not
be any problems.

Further, an invocation like (1) now additionally execute all test
functions of all test classes. For invocations of type (2), (3) and (4)
all test functions of all test classes are considered, too.

Change-Id: Ief08a6e9e451c599fd0109b8b8e57f92e3ee19f2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-04 09:14:45 +00:00
Nikolai Kosjar
2992653a4d CppTools: Remove workaround for quotes in defines
...since by now we get the defines in the correct format from
QMakeProject.

See the change this one depends on.

Tested with:

    Qbs:   cpp.defines: [ 'PATH1="/some/path"', "PATH2=\"/some/path\"" ]
    QMake: DEFINES += PATH1=\\\"/some/path\\\" "PATH2=\\\"/some/path\\\""
    CMake: add_definitions(-DPATH1="/some/path" "-DPATH2=\"/some/path\"")

All these lines translate to

    #define PATH1 "/some/path"
    #define PATH2 "/some/path"

for the code model.

Change-Id: Ifc3d3acff3abab6897ccbd0c5fafd5c415dfb53c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-02-04 09:05:58 +00:00
Orgad Shaneh
b1c17b39bc Qnx: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I78a70180927d085822e215ffb2b8ad256301e4a7
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:56:01 +00:00
Orgad Shaneh
b001e54599 Valgrind: Do not use native separators at all
Since valgrind only runs on POSIX systems, all the paths it produces are
normalized.

We have no mapping to local directory, so having a path like
\home\user\project\file.cpp is confusing.

Change-Id: Idff339729231ab662aa4fcb6bb732058c1a04f7c
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:53:12 +00:00
Orgad Shaneh
4e8e75d88e Debugger: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I1aa1a2b6ccbafeb1a8f3053fffa39b3f96992591
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:52:39 +00:00
hjk
3a9b34f232 Debugger: Re-use base infrastructure for LLDB breakpoint handling
Change-Id: If32b1f421e45dc4ee446e193e03c959d7c700948
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:50:19 +00:00
Eike Ziller
d9af2e0551 FileSystemFilter: Use QFileInfo::fileName instead of FileName::fileName
The input can well be relative, and contain slashes at the end...

Change-Id: Id4fd65474f2b9c23824f7a822c6e29cf443e1058
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-04 08:27:26 +00:00
Orgad Shaneh
58d53ebd41 Callgrind: Convert to Qt5-style connect
Change-Id: Id8851f31cf3a4005d7d4573bfb3dc9093932a4c2
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:19:34 +00:00
Orgad Shaneh
7d469ff1fb DiffEditor: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I04454108cf2818bb88237849169a8359dd408de9
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 07:37:06 +00:00
Lorenz Haas
59d6fbd533 CppEditor: MoveAllFuncDef now ignores generated function definitions
Task-number: QTCREATORBUG-13900
Change-Id: I394ed96072c590df627bc29f1962cdab4f7d34d7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 17:05:02 +00:00
Christian Kandeler
99c8992aed QbsPM: Remove existing qbs profile before recreating from kit.
Otherwise, "remove" operations on a kit such as clearing out the sysroot
or removing the Qt version will leave the old entries in the profile.

Change-Id: I70be926472c8d290b80e3479fc49286113f71380
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-03 15:29:07 +00:00
Christian Kandeler
b6a0dbeec7 CppTools: Make CompilerOptionsBuilder hide intrinsics.
Change-Id: I8b677fc82672ca5fd36bae18480467ef95201dcc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 15:19:18 +00:00
Christian Kandeler
773b41ff61 QbsProjectManager: Prevent excessively long profile names.
Kit names can get quite long (default ones, too), so cut the name off
after eight characters. Then append the Core::Id to guarantee
uniqueness.

Change-Id: Id6a0c2c56c22a6092430d6906389ce70901cf337
Task-number: QBS-734
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-02-03 14:30:11 +00:00
Orgad Shaneh
75a943ef57 C++: Fix crash when #if[def] nesting is deeper than 512 levels
Change-Id: I5e86da3a36514545834f554470b147ad8be43344
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 12:03:29 +00:00
Christian Stenger
72036361ba Designer: Fix connected signal
Introduced with 0df6780176.

Change-Id: I8dd1a8671413b599de4544d019df1578987f34e3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 11:12:50 +00:00
Orgad Shaneh
27a3e1c0b4 C++: Reduce FileName indirection
Change-Id: Ib7dfa4d3984f807985b7ce2ee0e58fb0565adc06
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 10:20:19 +00:00
Eike Ziller
ea4ad95241 Plain text editor: Do not register for all kinds of mime types
The default mime type 'text/plain' is perfectly enough, since the mime
types that the generic highlighting files might be interested in must be
children of 'text/plain' anyhow.

Change-Id: I9fdaf67676ccb3d511d8ae4e514ab438c8e1e8a5
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-02-02 16:04:20 +00:00
David Schulz
d7e5d41494 Editor: Fix crash in generic highlighter.
Make sure that the progress data object is deleted before the rule.

Task-number: QTCREATORBUG-13883
Change-Id: Ie0d1825e695f0bfa7d46ee6dd807a94c95a08cd7
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-02 14:46:19 +00:00
hjk
ba05edc6bb Debugger: Move LldbEngine::Command to debuggerprotocol
Better re-usable over there.

Change-Id: I75b70054d691771efaf5b19680d8a93d2943b5ba
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-02 14:46:16 +00:00
Orgad Shaneh
98723e4557 De-noise some ProjectExplorer/Utils qualifications
Change-Id: Iaec01ca0e7a43592528bcaf4252540561e109919
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-02 13:04:03 +00:00
Kai Koehne
74ce6e409d Make sure qmlviewer/qmlscene application output is printed
Qmlscene and qmlviewer are GUI applications. The heuristic to detect
where to print application output (windows log or stderr) has changed
in Qt 5.4, which caused the qmlscene, qmlviewer external tools to
not print output anymore into General Messages.

Work around this by forcing the tools to always print to stderr.

Task-number: QTCREATORBUG-13753
Change-Id: Iceee600dd402032674fd3ee11e0bd920793659d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-02 12:28:18 +00:00
Kai Koehne
09ad56a67b V8Debugger: Don't send watcher requests if qml engine has not stopped
This fixes a regression introduced in a8ebf535b829dac. We shouldn't
send watcher evaluation commands while the QML engine hasn't actually
stopped, because this might lead to an assert on the server side.

Task-number: QTCREATORBUG-13916
Change-Id: I300e2f73c0a1a03e0e6187a5357abeba408f72a0
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-02 12:10:18 +00:00
hjk
7a188fe70a Debugger: Properly delete breakpoints when triggered from view
If the removal is triggered from the view, the engine needs
to be informed. If it's triggered from the engine, the view
needs to be informed.

Change-Id: I3505130c5b4b0b3752401a94599af9a06662f002
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-02 11:43:30 +00:00
Orgad Shaneh
067ea9cdd6 CMake: Cleanup QString/FileName conversions
Change-Id: Ifba5afcc98823aea2f789b65b6be4de8ebf050a1
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-02-02 10:32:56 +00:00
hjk
38ec4dd6ae Debugger: Show confirmed state on breakpoint removal
So far we cheated by pretending removal always succeeds
immediately. Now just draw in grey in the view and remove
fully after the backend confirmed removal.

Change-Id: I0bd607774a3db0fe302b9654798be9dcc50abe8a
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-02 10:22:41 +00:00
Orgad Shaneh
f99e2570fb Support multiple instances listening for debug output...
... only not simultaneously

Task-number: QTCREATORBUG-3443
Change-Id: Ie88ee305a1ad134d81a19cece42f7fd81fc08f16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-02-02 09:09:50 +00:00
Orgad Shaneh
349f415067 Valgrind: Replace QDir::separator with slash
Change-Id: I8f8192dc065702cb1c6bb218b8d992bb9775cd10
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-02 08:43:04 +00:00
Orgad Shaneh
1bcfa137a3 Do not use QDir::separator() for internal paths
Internal paths are supposed to be normalized

Change-Id: Ic6943ce13ad389dfdb44054a9e6f03da8c6cd88d
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-02 08:32:59 +00:00
Orgad Shaneh
704f3d539b Wizard: Use normalized path separators
Task-number: QTCREATORBUG-13903
Change-Id: Ie7fc4bbf793a6379dbb8410c6ec23a48504beed0
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-02 07:50:26 +00:00
Nikita Baryshnikov
102e49ca37 ManageDefinitionsDialog: download exact url in sorted TableWidget
If TableWidget was sorted by user, position in QList of metadata and in
View differs.
Side effects:
- QTableWidget sorted by first column by default
- Connections are moved to Qt5 style

Change-Id: I4a15e2cc9394431719ed1e2dd88f713af43c40d0
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-02-02 07:39:04 +00:00
Orgad Shaneh
a9014e074d Utils: Use FileName in reloadPrompt
Change-Id: I170208e1c49bcab9c78b1651669252ed0d162bb3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-02-02 07:02:59 +00:00
Lorenz Haas
d9f31aa635 CppEditor: Use local cached function call result
Change-Id: If268d2109c4efae9d3c93fd2bf5953cca2b41dd1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-02 06:27:54 +00:00
Christian Stenger
4919a97444 DiffEditor: Fix compile for Qt less than 5.4
Change-Id: I0f70bcb0cb7b872c3b8183c4530b59a4845e5475
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-02 06:23:23 +00:00
Kai Koehne
40ba5f947b Disable broken debugger tooltips for QML
Looks like the proper handling of tooltips while debugging a QML app
is broken since commit 7f09d0b756 . Just disable the functionality
for now.

Task-number: QTCREATORBUG-13854
Change-Id: I346058f6f9753475ec209ec8befdd5425bbd83d0
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 18:57:04 +00:00
Christian Kandeler
c356a276ec QbsProjectManager: Fix command-line representations.
- All except the one for "qbs build" were incomplete, which is fixed
  now.
- The new implementation is centralized, so maintenance will be simpler.
- The command lines are also completely self-contained now, so they can
  be pasted as-is into a shell with no assumptions about the working
  directory etc.

Change-Id: I2c684141bcdc5c6da0e1af60ce60278fc4dcd088
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2015-01-30 16:32:50 +00:00
hjk
aa39916c41 Debugger: Invert LLDB/Python startup order
Instead of starting LLDB through a Python script this now starts
LLDB directly. This did not work a while ago but seems fine nowaday.

Change-Id: I20e915070cd6addf260817c311f4160d010aa861
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 15:35:20 +00:00
hjk
2d81c18028 Test compile fix after 063251eb
Change-Id: I3bf9d65b73a4ab1619c8e48815792f35e2359f45
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 12:05:22 +00:00
Tobias Hunger
250d8abe2d DiffEditor: Remove a bit of fluff
Change-Id: Ie1b2df8eb336078ced59d1406020ae57d2b53682
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-01-30 10:42:01 +00:00
Montel Laurent
063251ebbc Port to new connect api
Change-Id: I873a36601d54065b61d0666558b93dc839ad0dfc
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 10:40:25 +00:00