Review Request 120804: Initial port to KF5

Aleix Pol Gonzalez aleixpol at kde.org
Mon Oct 27 11:54:05 UTC 2014



> On Oct. 27, 2014, 12:43 a.m., Aleix Pol Gonzalez wrote:
> > src/telepathy-base-job.cpp, line 139
> > <https://git.reviewboard.kde.org/r/120804/diff/1/?file=322076#file322076line139>
> >
> >     That change shouldn't be needed...?
> 
> Martin Klapetek wrote:
>     Yep, in fact you shouldn't need to include .moc files unless there is a Q_OBJECT class declared in the .cpp.
> 
> David Edmundson wrote:
>     you need this if you use Q_PRIVATE_SLOT
> 
> Martin Klapetek wrote:
>     No; that's also handled by autmoc. The problem here in particular is because of header inclusions - building without this #include fails because the .h file does not have #include ".._p.h" and so the moc file does not have the _p.h and fails with "unknown class" while the .cpp file has the #include "_p.h" and so when the moc is included here, it does not fail.
>     
>     Given this would require changes in the other #includes in 3 files, I'd say let's do it this way.
>     
>     (for completness, here's how it would need changing:
>     
>      
>      src/telepathy-base-job.cpp | 2 +-
>      src/telepathy-base-job.h   | 3 ++-
>      src/telepathy-base-job_p.h | 3 ++-
>      3 files changed, 5 insertions(+), 3 deletions(-)
>     
>     diff --git a/src/telepathy-base-job.cpp b/src/telepathy-base-job.cpp
>     index 3dab71e..eef3cc5 100644
>     --- a/src/telepathy-base-job.cpp
>     +++ b/src/telepathy-base-job.cpp
>     @@ -18,7 +18,7 @@
>       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>       */
>      
>     -#include "telepathy-base-job_p.h"
>     +#include "telepathy-base-job.h"
>      
>      #include <TelepathyQt/PendingOperation>
>      
>     diff --git a/src/telepathy-base-job.h b/src/telepathy-base-job.h
>     index 66fab23..e181358 100644
>     --- a/src/telepathy-base-job.h
>     +++ b/src/telepathy-base-job.h
>     @@ -21,6 +21,8 @@
>      #ifndef LIBKTP_TELEPATHY_BASE_JOB_H
>      #define LIBKTP_TELEPATHY_BASE_JOB_H
>      
>     +#include "telepathy-base-job_p.h"
>     +
>      #include <kdemacros.h>
>      #include <KJob>
>      
>     @@ -82,7 +84,6 @@ enum JobError {
>          KTpError = 300
>      };
>      
>     -class TelepathyBaseJobPrivate;
>      class KDE_EXPORT TelepathyBaseJob : public KJob
>      {
>          Q_OBJECT
>     diff --git a/src/telepathy-base-job_p.h b/src/telepathy-base-job_p.h
>     index 455ac2a..cfa0059 100644
>     --- a/src/telepathy-base-job_p.h
>     +++ b/src/telepathy-base-job_p.h
>     @@ -20,7 +20,6 @@
>      #ifndef LIBKTP_TELEPATHY_BASE_JOB_P_H
>      #define LIBKTP_TELEPATHY_BASE_JOB_P_H
>      
>     -#include "telepathy-base-job.h"
>      
>      #include <QTime>
>      
>     @@ -32,6 +31,8 @@ class PendingOperation;
>      namespace KTp
>      {
>      
>     +class TelepathyBaseJob;
>     +
>      class TelepathyBaseJobPrivate
>      {
>          Q_DECLARE_PUBLIC(TelepathyBaseJob)
>          
>     
>     )
> 
> David Edmundson wrote:
>     You can't put #include "foo_p.h" in foo.h. That just defeats the enitre point of having it private.
> 
> Martin Klapetek wrote:
>     Right, I meant let's keep the #include moc, I was just pointing out that including the moc is not needed for Q_PRIVATE_SLOT

FWIW, when I said the change was not necessary is because cmake moc implementation uses "#include "filename.moc"

Sometimes the include is indeed necessary.


- Aleix


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120804/#review69182
-----------------------------------------------------------


On Oct. 26, 2014, 12:26 a.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120804/
> -----------------------------------------------------------
> 
> (Updated Oct. 26, 2014, 12:26 a.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Repository: ktp-filetransfer-handler
> 
> 
> Description
> -------
> 
> Initial port to KF5
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 5664e52 
>   src/CMakeLists.txt ebd892c 
>   src/handle-incoming-file-transfer-channel-job.cpp 36b8310 
>   src/handle-outgoing-file-transfer-channel-job.cpp 762bd12 
>   src/main.cpp 5382122 
>   src/telepathy-base-job.cpp 3dab71e 
> 
> Diff: https://git.reviewboard.kde.org/r/120804/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20141027/bd149ad4/attachment.html>


More information about the KDE-Telepathy mailing list