Commit Graph

174 Commits

Author SHA1 Message Date
Christian Kandeler
e210bcf3eb CppEditor: Offer to create getters and setters for all class members
Fixes: QTCREATORBUG-14504
Change-Id: I12c687492b12c6997064eb7f137b6ccb189d2009
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-10 08:07:16 +00:00
Christian Kandeler
5b3aece387 CppEditor: Make "Add curly braces" quickfix more robust
Anchor the opening brace at the closing parenthesis, rather than at the
statement. This way, we won't get troubled by macro weirdness in the
statement part.

Fixes: QTCREATORBUG-13921
Change-Id: I05af24d1642e6b62c78bb2f47a1ef0b1fea326d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-07 14:13:37 +00:00
Christian Kandeler
934641f45c TextEditor: Sort indent ranges before applying
It can easily happen that callers insert indent ranges out of order, and
without sorting the indentation done earlier in the file is not
considered for the later parts, leading to inconsistent results.

Fixes: QTCREATORBUG-18929
Change-Id: Ice2abe92d54446bcdd102c6a1f822262a8533543
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-06-15 13:46:11 +00:00
Christian Kandeler
e100939ba7 CppEditor: Extend "Add Include" quickfix
... so it works for all kinds of symbols, not just Qt classes.

Fixes: QTCREATORBUG-21
Change-Id: I2d329c09b64cd8f7eef8cce7d9f022aca8586c0d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-05 14:56:21 +00:00
Christian Kandeler
d811e7773f CppEditor: Do not treat friend declaration as member function
... when trying to create definitions from declarations.
Instead, we completely ignore friends in this context, arguing that the
respective function normally should have a proper declaration somewhere
else.

Fixes: QTCREATORBUG-7164
Change-Id: I3ddb89cefecbc494f9c7e63600b65fd6288b7169
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-05 14:51:18 +00:00
Christian Kandeler
2262af087a CplusPlus: Fix type information for anonymous enums
Variables declared like this:
    enum { E1, E2 } e;
would not get assigned a proper type.

Task-number: QTCREATORBUG-7487
Change-Id: I4362f22feb0f2e4e1e754e9c623e5576fa31f4bc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 11:24:56 +00:00
Christian Kandeler
39047fac5b CPlusPlus: Add missing type information for enum variables
Consider these two variable declarations:
  enum EX { EX1, EX2};
  EX ex;
  emum EY { EY1, EY2} ey;
The ex variable would correctly get assigned type EX, but the ey
variable would not have any type.
This is now fixed.

Task-number: QTCREATORBUG-7487
Change-Id: I3e09c5766fdb9e6baf3a8d7bc6f2fc581f2d824b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 10:23:39 +00:00
Christian Kandeler
c8d7c074f5 CppEditor: Consider namespaces in "extract function" quickfix
Fixes: QTCREATORBUG-23256
Change-Id: I99b1271907767c3607e35adb49bd4109f3eca18c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-29 09:02:49 +00:00
Christian Kandeler
6c4b8b10b7 CppEditor: Add quickfix for creating a forward declaration
In header files, a forward declaration is often preferable to including
another header file, so let's offer this as a quickfix.

Fixes: QTCREATORBUG-23444
Change-Id: Ib50550abb5337098e4122e65e2af42a66742d6f6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-27 13:25:19 +00:00
David Schulz
1ab9dc9464 CppEditor: generate valid code via "Convert to Pointer/Stack Variable"
Adding a "= new <TypeName>" after converting a stack variable without
assignment or initializer to pointer.
Also remove the assignment when converting from pointer to stack
variable as this works better with explicit constructors.

Fixes: QTCREATORBUG-23181
Change-Id: I377ec32a1b66cf4b96db14cfcb4b71fb96c80c98
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-08 09:21:25 +00:00
Nikolai Kosjar
54fefd89b8 C++: Transfer noexcept specifier for refactoring actions
This applies for e.g.

* "Add Definition..." (on function decl)
* "Move Definition..." (on function decl)
* "Insert Virtual Functions of Base Class" (on class specifier)

Fixes: QTCREATORBUG-11849
Fixes: QTCREATORBUG-19699
Change-Id: I0d259bc1782470f3b3f19617230005a5594a5cca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-10-08 09:20:10 +00:00
Tobias Hunger
1df553a683 ProjectExplorer: Rename IncludePathType to HeaderPathType
It is the type used by the HeaderPath class, so reflect that in
the name.

I also considered to rename HeaderPath to IncludePath, but
that name is reflected in a lot of users, which would also need
to be adjusted for consistency. That would blow up the patch size
for little value IMHO.

Change-Id: I51421dbd3ab8b2874dc32fc82dc394c9b93ce5e9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-13 11:32:31 +00:00
Marco Bubke
3abaf647d0 Add system include path to HeaderPath and merge ProjectPartHeaderPath
System include paths are appended after other includes by the compiler. So
we should set them as system includes and not as normal includes. Otherwise
we change the include order. Headers in system include paths are not
cluttering the screen with unwanted warning and by the way improve
performance too.

ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them.

Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-10 09:31:32 +00:00
hjk
289f2b170a CppEditor: Do not add QuickFixFactories to object pool anymore
Not needed anymore.

Also some cleanup, no 'using' in headers etc.

Change-Id: I8c4547d80d0c0ffd989d1efbc74687c9f56096a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-02-02 12:26:32 +00:00
Ivan Donchevskii
96ef6c797b CppEditor: split CppEditor and CppEditorWidget
Change-Id: Id3c815184f7f3bace0276e947f6b6f76e61ec6de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-12 15:05:38 +00:00
Przemyslaw Gorszkowski
c6771c39c1 CppEditor: Fix quickfix for adding include for static functions
Task-number: QTCREATORBUG-14499
Change-Id: Id3e962ed310f43c33b91c7834a1f9ca074519a38
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-23 11:47:24 +00:00
Nikolai Kosjar
d8d1511be1 CppEditor: Fix InsertQtPropertyMembers test
Broken by

  commit d6e81eb49e
  CppEditor: Emit member variable for qproperty refactoring

Change-Id: I5e86f0fb1942a497c4242b6f1890e74eb55b687c
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-02-27 11:40:45 +00:00
hjk
56409f5afa Replace a few occurrences of QStringList() << ...
... by something shorter.

Change-Id: I363b4e509adb07997517b2d233246a333aea4aea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-08 11:21:45 +00:00
hjk
8f12ade7bd CppEditor: Compile fix after 3b1308bb
Change-Id: I55f8f175e8cd49b455b94872770a7bd02baa7492
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-18 13:41:29 +00:00
Lorenz Haas
49c6710b42 CppEditor: Fix GenerateGetterSetter for reference types
Change-Id: Iad332cf023c6bff0c7f5ae46fb56f0393c9c7b29
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-10-31 16:00:17 +00:00
Orgad Shaneh
34baa3ec47 CppEditor: Add enclosing template on "Move Definition Outside"
The template id for the class name is missing, but it's better than
nothing.

For example:

template<class T>
class Foo
{
    void func() {} // Move Definition Outside Class
};

// The following lines are added
template<class T>
void Foo::func() {} // Should be Foo<T>::func

Task-number: QTCREATORBUG-16649
Change-Id: Icb560e0b87f563cbda18f4742f44bb8ef4d8a900
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-09-06 13:23:18 +00:00
Orgad Shaneh
d0d1f43e8f CppEditor: Add enclosing template on "Add Definition"
The template id for the class name is missing, but it's better than
nothing.

For example:

template<class T>
class Foo
{
  void func(); // Add Definition
};

// The following lines are added
template<class T>
void Foo::func() // Should be Foo<T>::func
{
}

Change-Id: I60a0cbd348985def3dfb7037067786e942278593
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-09-06 13:23:12 +00:00
Orgad Shaneh
5a40bddf08 CppEditor: Add template enclosing scope on "Insert Declaration"
Change-Id: Iff4893193b56c2ed86b4b9515a1a1df847528369
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-19 14:41:25 +00:00
Orgad Shaneh
2890966ec3 CppEditor: Prevent "Add Declaration" for existing template functions
class Foo
{
    template<class T>
    void func();
};

template<class T>
void Foo::func() {} // Add Declaration should not be triggered at all

Change-Id: Ifff733d8381177300dae017ae419200cfdf5c425
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-19 14:41:17 +00:00
Orgad Shaneh
65dc6d0fc2 CppEditor: Fix "Move Definition to Class" for template member functions
class Foo
{
    template<class T>
    void func();
};

template<class T>
void Foo::func() {} // Move to class

It currently doesn't trigger at all.

Change-Id: I63d561771a8dd455f01e99dd836abbd23eec71b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-19 14:41:11 +00:00
Orgad Shaneh
e920921f27 CppEditor: Fix "Move Definition to Class" for function in template class
template<class T>
class Foo { void func(); };

template<class T>
void Foo<T>::func() {} // Move to class

Prior to this change, this currently leaves behind `template<class T>`
where the definition used to be:

template<class T>
class Foo { void func() {} };

template<class T>

Task-number: QTCREATORBUG-14354
Change-Id: I8e1f75a3ae50619a7bae9c63d3798b16bcfea545
Reviewed-by: Lorenz Haas <lorenz.haas@histomatics.de>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-19 13:00:42 +00:00
Orgad Shaneh
03923fc5a2 CppEditor: Add a failing test for move outside class with template
Task-number: QTCREATORBUG-16649
Change-Id: I29c42c23f4dc44b0401fb07c0dc6d0008dcaf096
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-22 06:35:09 +00:00
Nikolai Kosjar
1ea6404337 CppTools: Allow prefering getter names with "get" prefix
We default to "foo()" for e.g. a member variable "m_foo", but other
coding styles require "getFoo()".

Task-number: QTCREATORBUG-16452
Change-Id: I9ccfdf88e4c469bc1c06fde855ad754faf2bd238
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2016-06-22 12:22:57 +00:00
Nikita Baryshnikov
5f91cb0d68 CppTools: fix metatype registration macro usage
in places where we do not need it

Change-Id: Ibf35f8144da859fffa3e0a7b6bb262284ec2292a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-03-24 08:15:44 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Marco Bubke
2b4cadf1fe CppTools: Move ProjectPart in its own header file
Also extracting inline HeaderPath class and change projects list in vector
because the size is  larger than a pointer.

Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-13 14:46:56 +00:00
Orgad Shaneh
e99aaf23b9 CppEditor: Fix ConvertQt4Connect for different namespace
Change-Id: I152d7cda02bb034bf817eeeb4b467667e1188b2f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-15 10:49:49 +00:00
Orgad Shaneh
dc8dab3d01 CppEditor: Add a failing test for add include for static function
Task-number: QTCREATORBUG-14499
Change-Id: I21d4281a01028d8c4cd5462d64da6428133219a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-21 12:01:26 +00:00
Nikolai Kosjar
45778539d8 CppEditor: Fix crash with invalid switch/case statement
Task-number: QTCREATORBUG-14925
Change-Id: Iea2cf17070d9db48924e76f6c7febca0d52e4686
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-08-18 09:44:40 +00:00
Nikolai Kosjar
892cb154b2 C++: Do not let ASTPath calculate line/column for generated tokens
ASTPath uses TranslationUnit::getPosition(), which returns reasonable
results for:

    1. non-expanded tokens
    2. expanded but not generated tokens

The expanded *and* generated tokens case is not handled since there is
no reasonable mapping from generated tokens to a continuous line/column
information. Consider:

    #define DECLARE_FOO int foo; // Multiple generated tokens
    DECLARE_FOO // ...can be mapped to this line, but to which columns?

Since the result where not valid for the expanded and generated case,
ASTPath took the wrong branches. Avoid this by skipping generated
tokens.

Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563
Task-number: QTCREATORBUG-13386
Task-number: QTCREATORBUG-13390
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-07-31 11:01:02 +00:00
Orgad Shaneh
b1e0731d55 CppEditor: Add a failing test for ConvertToPointer with macro
Task-number: QTCREATORBUG-14801
Change-Id: Ie34b131de4e6f701aeac29567a09be54e2e63bd8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-07-28 19:54:36 +00:00
Lorenz Haas
7389f46959 CppEditor: ExtractFunction quick fix asks for access specifier
Task-number: QTCREATORBUG-12127
Change-Id: Ifb6ff22282f0f181e49a260e57307ec937f5dfb2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-09 11:17:20 +00:00
Lorenz Haas
7879aa5fae CppEditor: Fix added newlines for GenerateGetterSetter quick fix
As a nice side effect superfluous new lines - introduced by quick fixes
that are using InsertionPointLocator::methodDefinition - vanished.

Task-number: QTCREATORBUG-13872
Change-Id: Ib3df2b2acbc22449f16f4444092a57ae93d53d35
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-06-09 10:11:56 +00:00
Joerg Bornemann
4b5315bd7c CppEditor: fix "Convert to Stack Variable" for empty initializer lists
The "Convert to Stack Variable" quick fix generated invalid code for
the following snippet: QString s = new QString();

Task-number: QTCREATORBUG-14279
Change-Id: I1f5e33d2089bc2d5713eae1e9f4dc5986523112c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-04-20 16:14:43 +00:00
Lorenz Haas
0ea753ad63 CppEditor: Respect current getter coding style
With a simple check GenerateGetterSetter looks for symbols starting with
"get". If such symbols are found it is most likely that the current
class uses "getFoo" for getters and thus the quick fix uses this coding
style for generating the getter name.

Change-Id: I9ff8ef8bb936572abaaf9e671b8985553c1018f1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-24 16:08:01 +00:00
Lorenz Haas
0913eb8660 CppEditor: GenerateGetterSetter now ignores symbols in Q_PROPERTY
Since the Q_PROPERTY's name equals the typical getter name the "Generate
Getter" quick fix was not offered.

Q_PROPERTY(int a ...) // <-- a is "recognized" as "int a();"
int m_a;

Task-number: QTCREATORBUG-14166
Change-Id: I35709a1b6492b68309d02427d60251df4fd76cfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-24 16:07:27 +00:00
Nikolai Kosjar
6a94f7e355 CppEditor: Add basic test for ExtractFunction
Change-Id: I44f2edb2905e202669630ab5da85066011491fae
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-03-13 13:41:37 +00:00
Orgad Shaneh
dbb9891f43 CppEditor: Support implicit pointers in Qt5 connect conversion
Task-number: QTCREATORBUG-14104
Change-Id: I157dbcb0e06ed1bf49d2df01bdbad215e35a4c3a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-09 13:27:12 +00:00
Orgad Shaneh
683540bee7 CppEditor: Expand templates for Qt5 connect conversion
Fixes at least explicit data() calls for templated pointers:

QPointer<QAction> action;
connect(action.data(), SIGNAL(triggered()), this, SLOT(slot()));

Change-Id: I7f76c1f556c0f271936728d611751424969916a7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-03-09 13:16:06 +00:00
Libor Tomsik
0038e82782 Refactor: Comment out delete statement of heap variables
Convert to Stack Variable generates crashing code.

Task-number: QTCREATORBUG-13685
Change-Id: I4555de223e50bc8d75e97205d273aa0f09f652fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-26 17:12:58 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Lorenz Haas
a51acf42ef CppEditor: Create only getter or setter member function
In addition to create both getter and setter member functions at once it
can now be decided to only create a getter or setter member function.

Task-number: QTCREATORBUG-13874
Change-Id: I9127a31b7d87dc91619abb2e2335bd8221f170a2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-09 15:53:22 +00:00
Lorenz Haas
c131160c67 CppEditor: Use proper argument name in QtProperty quick fix
Instead of using "arg" for the generated getter/setter/signal argument
try to detect a proper name.

Task-number: QTCREATORBUG-12656
Change-Id: Iddaeb1f1d490af003d172d515033d85d778c10df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 16:42:02 +00:00
Orgad Shaneh
65e7db42b8 C++: 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: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-04 15:27:22 +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