Bug 315167 - "update signature" should not be shown for signals
Summary: "update signature" should not be shown for signals
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.4.1
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: 4.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-14 22:00 UTC by Rolf Eike Beer
Modified: 2013-05-26 21:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed fix (only compile-tested) (1.78 KB, patch)
2013-02-16 19:43 UTC, Rolf Eike Beer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer 2013-02-14 22:00:07 UTC
You need a class like this:

class bla : public QObject {
	Q_OBJECT
signals:
	void bar(int x);
};

The cpp file should #include the moc file. If you now go and change the "int x" to e.g. "double x" KDevelop offers to update the signature. This doesn't make any sense for a signal even if it would be technically possible to change the moc file.

Side note: it also often triggers bug 306695 for me, at least on one system.

Reproducible: Always
Comment 1 Rolf Eike Beer 2013-02-16 19:43:23 UTC
Created attachment 77370 [details]
Proposed fix (only compile-tested)
Comment 2 Aleix Pol 2013-02-27 15:49:38 UTC
Hi Rolf, can you post the patch in a reviewboard? It will be easier to comment on it there
Comment 3 Rolf Eike Beer 2013-02-27 19:47:20 UTC
https://git.reviewboard.kde.org/r/109197/
Comment 4 Kevin Funk 2013-05-22 09:54:30 UTC
That's only triggered in case KDevelop is able to actually parse the included moc file. E.g. doing an #include "foo.moc" won't work because of the file suffix.

Reproduced  the bug on current master.
Comment 5 Milian Wolff 2013-05-24 12:22:52 UTC
Git commit 3fb98a757308f615ffc6a13c678c7a87ca3fa79d by Milian Wolff.
Committed on 24/05/2013 at 14:21.
Pushed by mwolff into branch 'master'.

Do not offer signature assistant for changes in Qt signals.

Based on the work of Rolf Eike Beer minus the regression of
not showing the assistant for non-Qt function declarations.

Sorry for taking so long for this :-/
REVIEW: 109197

M  +18   -1    languages/cpp/codegen/signatureassistant.cpp

http://commits.kde.org/kdevelop/3fb98a757308f615ffc6a13c678c7a87ca3fa79d
Comment 6 Milian Wolff 2013-05-26 21:42:57 UTC
Git commit 1700655993676f1e3cf8f71c02dbf5d3c1cffa49 by Milian Wolff.
Committed on 24/05/2013 at 14:21.
Pushed by mwolff into branch '4.5'.

backport: Do not offer signature assistant for changes in Qt signals.

Based on the work of Rolf Eike Beer minus the regression of
not showing the assistant for non-Qt function declarations.

Sorry for taking so long for this :-/
REVIEW: 109197

Backport of commit 3fb98a757308f615ffc6a13c678c7a87ca3fa79d in master.

M  +19   -2    languages/cpp/codegen/signatureassistant.cpp

http://commits.kde.org/kdevelop/1700655993676f1e3cf8f71c02dbf5d3c1cffa49