Review Request: fix 'file already exists' in new class wizard by a bit of refactoring (essentially creating project model items earlier)

Milian Wolff mail at milianw.de
Mon Apr 12 19:32:33 UTC 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3576/
-----------------------------------------------------------

Review request for KDevelop.


Summary
-------

refactors CppNewClass generation to create the ProjectFiles before the documentchangeset gets applied. This way we don't get these bugger messages about "file already exists" because the project file manager picks the file creations up (KDirWatch)... my former hack that queried the project file manager didn't work reliably, this should be a proper fix.

And imo it looks quite well also, much more encapsulated (yet the whole code could really benefit from a cleanup ;-)).

note: this works since generate() is called in the accept() method of the createclasswizard.

note2: the "problem" is when we create a class again, it's contents will just be added to the existing files, but afaik that should have been like that even before?


This addresses bug https://bugs.kde.org/show_bug.cgi?id=234178.
    https://bugs.kde.org/show_bug.cgi?id=https://bugs.kde.org/show_bug.cgi?id=234178


Diffs
-----

  /trunk/extragear/sdk/kdevelop/languages/cpp/codegen/cppnewclass.h 1114032 
  /trunk/extragear/sdk/kdevelop/languages/cpp/codegen/cppnewclass.cpp 1114032 
  /trunk/extragear/sdk/kdevelop/languages/cpp/codegen/simplerefactoring.cpp 1114032 

Diff: http://reviewboard.kde.org/r/3576/diff


Testing
-------

created a few classes


Thanks,

Milian





More information about the KDevelop-devel mailing list