~ubuntu-branches/ubuntu/utopic/kdevelop/utopic-proposed

« back to all changes in this revision

Viewing changes to languages/cpp/codegen/signatureassistant.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-10 17:21:01 UTC
  • mfrom: (1.7.17)
  • Revision ID: package-import@ubuntu.com-20130610172101-wyeovt5ueu1pm0gv
Tags: 4:4.5.1-0ubuntu1
* New upstream release
* Merge with Debian git packaging, remaining changes
 - replaces/conflucts kdevelop-custom-buildsystem, now build into KDevelop

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
#include "cppduchain.h"
34
34
#include "renameaction.h"
 
35
#include "qtfunctiondeclaration.h"
35
36
 
36
37
using namespace KDevelop;
37
38
using namespace Cpp;
83
84
  if(!funDecl || !funDecl->type<FunctionType>())
84
85
    return;
85
86
 
 
87
  if(QtFunctionDeclaration* classFun = dynamic_cast<QtFunctionDeclaration*>(funDecl)) {
 
88
    if (classFun->isSignal()) {
 
89
      // do not offer to change signature of a signal, as the implementation will be generated by moc
 
90
      return;
 
91
    }
 
92
  }
 
93
 
86
94
  Declaration* otherSide = 0;
87
95
  FunctionDefinition* definition = dynamic_cast<FunctionDefinition*>(funDecl);
88
96
  if (definition)
211
219
  DUContext *functionCtxt = DUChainUtils::getFunctionContext(functionDecl);
212
220
  if (!functionCtxt)
213
221
    return;
 
222
  if(QtFunctionDeclaration* classFun = dynamic_cast<QtFunctionDeclaration*>(functionDecl)) {
 
223
    if (classFun->isSignal()) {
 
224
      // do not offer to change signature of a signal, as the implementation will be generated by moc
 
225
      return;
 
226
    }
 
227
  }
214
228
  //ParseJob having finished, get the signature that was modified
215
229
  Signature newSignature = getDeclarationSignature(functionDecl, functionCtxt, false);
216
230
 
224
238
    setDefaultParams(newSignature, oldPositions); //restore default parameters before updating the declarations
225
239
  else
226
240
    renameActions = getRenameActions(newSignature, oldPositions); //rename as needed when updating the definition
227
 
  addAction(IAssistantAction::Ptr(new AdaptSignatureAction(m_otherSideId, m_otherSideTopContext, m_oldSignature, newSignature, m_editingDefinition, renameActions)));
 
241
 
 
242
  addAction(IAssistantAction::Ptr(new AdaptSignatureAction(m_otherSideId, m_otherSideTopContext,
 
243
                                                           m_oldSignature, newSignature,
 
244
                                                           m_editingDefinition, renameActions)));
228
245
 
229
246
  emit actionsChanged();
230
247
}
231
248
 
232
 
#include "signatureassistant.moc"
 
 
b'\\ No newline at end of file'
 
249
#include "signatureassistant.moc"