https://bugs.kde.org/show_bug.cgi?id=276794 Summary: "Create Slot" completion gives invalid code if in same file as class declaration Product: kdevelop Version: 4.2.3 Platform: Compiled Sources OS/Version: Linux Status: NEW Severity: normal Priority: NOR Component: Language Support: CPP AssignedTo: kdevelop-bugs@kdevelop.org ReportedBy: nicolas.alvarez@gmail.com Test case: class Main: public QObject { Q_OBJECT signals: int mysig(); public slots: int existingSlot(); private: int func() { } }; Inside func, type "connect(this, SIGNAL(mysig()), mynewslot" and invoke completion, which will suggest creating a slot called "mynewslot()". Selecting that option adds the new slot declaration inside the 'public slots' section, below existingSlot, thus moving the func() declaration one line down. KDevelop doesn't handle that line change properly, and func turns into: int func() { SLOT(mynewslot())); connect(this, SIGNAL(mysig()), mynewslot } This problem happens any time the code being completed is in the same file and after the place where the slot declaration is added; not only if func() is being defined inside the class declaration. -- Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ KDevelop-bugs mailing list KDevelop-bugs@kdevelop.org https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs