Bug 295683 - 'Add private/public member' functionality made adding function to private/public slots except to private/public
Summary: 'Add private/public member' functionality made adding function to private/pub...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.7.1
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-10 14:32 UTC by Piotr Mierzwinski
Modified: 2021-03-10 18:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
test case (498 bytes, application/bzip2)
2012-12-23 14:30 UTC, Piotr Mierzwinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2012-03-10 14:32:30 UTC
In my class declaration (header file) I have following sections: "public:", "private:", "private slots:" (in this order). I'm writing calling new function - example into constructor's definition (cpp file): "newFunction()". When I'm putting semi at the end of calling this function then shows me additional menu: "Declare 'void newFunction()' as: 1 - public function in NewClass   2 - private function in NewClass   0 - Hide". When I choose 2 ("private:") then declaration is inserted in section "private slots:" except "private:".
Comment 1 Piotr Mierzwinski 2012-03-29 18:36:35 UTC
Example:
class MyClass {
   Q_OBJECT
public:
   MyClass();
private:
    void foo();
public slots:
  void slotFoo();
};

MyClass::MyClass() {
    newFoo();
}

Below header file after using assistant: Declare 'void newFoo()' as: 1 - public function in MyClass   2 - private function in NewClass   0 - Hide". And selected Alt+1 (public function).

class MyClass {
   Q_OBJECT
public:
   MyClass();
private:
    void foo();
public slots:
  void slotFoo();
  void newFoo();
};

Declaration: "void newFoo();" should be in section "public".

And one thing KDevelop not respect set (in configuration) separators when inserts new function's declaration. I will request new bug.
Comment 2 Piotr Mierzwinski 2012-12-23 14:30:24 UTC
Created attachment 75978 [details]
test case

Archive contains a sample classes to testing bug.
Instruction:
1. Extract all files from directory: testcase_myclass/myclass_before to any project
2. open in KDevelop file myclass.cpp
3. move the cursor to the end of the line: "     newFoo();"
4. select "3 - public" in popuping window: "Declare 'void newFoo()' as member ...."
5. check file: myclass.h (should look like file in: testcase_myclass/myclass_after)

In class are two section of the public: "public:" and "public slots:". KDevelop should give a choice to what section add new member/method.
Comment 3 Justin Zobel 2021-03-09 22:48:07 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 4 Piotr Mierzwinski 2021-03-10 18:43:49 UTC
Feature where I found this bug just disappeared.
There is no proper status for this so I need to select 'RESOLVED'.