#tde-devs < 2023/01/11 > |
[10:11] | SlavekB has quit (Quit: Kopete 0.12.7 : http://trinitydesktop.org) |
[10:59] | SlavekB has joined |
[12:45] | |akh|: Question about moc |
[12:47] | |akh|: I have a number of slots in my code that are only used on certain plaforms so I've surrounded their declarations and definitions with #ifdefs |
[12:48] | |akh|: moc seems to be ignoring the #ifdefs and generates code in the moc file (in tqt_invoke) for the inactive methods |
[12:54] | |akh|: this causes the compile to fail with "'slotMethodName' wias not declared in this scope" if the define isn't set (which makes sense since the declaration/definition has been #ifdef'ed out) |
[12:54] | |akh|: while I could make the slots in question be stub methods for unsupported platforms I'd rather completely remove the slot code with #ifdefs; is there a way to do this? |
[12:55] | denk: https://stackoverflow.com/questions/12754007/does-qts-moc-preprocessor-need-all-c-preprocessor-flags |
[12:55] | tde-bot: Page title: Does Qt's moc Preprocessor Need All C++ Preprocessor Flags - Stack Overflow |
[12:57] | denk: #if defined(__sparc__) should affect the moc result |
[12:58] | denk: in such case I just add #error Ok somewhere inside a code |
[12:59] | denk: cpp must stop on this directive |
[13:03] | |akh|: (Just noting that my problem is opposite to the SO question: moc is acting, I think, as if the #ifdef isn't there at all.) |
[13:04] | denk: btw, it could be a cause why they used #if OS(XXX) instead of direct #ifdef XXX |
[13:06] | |akh|: In my case the code is: |
[13:06] | |akh|: #if defined(_OS_LINUX_) || defined(__gnu_linux__) |
[13:06] | |akh|: #define IS_LINUX |
[13:06] | |akh|: #endif |
[13:06] | SlavekB: If I remember well, there is feasible way to always define all slots and for some architectures / platforms their function will be empty == body of methods will be in #ifdefs. |
[13:08] | |akh|: I'm testing that my code functions correctly on non-Linux platforms while compiling under Linux by undefining the IS_LINUX macro |
[13:09] | |akh|: Using stub methods should get the job done but if there's a better way I'd rather go that route |
[13:11] | denk: live example: |
[13:11] | denk: private slots: |
[13:11] | denk: void focusProxyDestroyed(); |
[13:11] | denk: #if defined(Q_WS_X11) |
[13:11] | denk: void destroyInputContext(); |
[13:11] | denk: #endif |
[13:12] | denk: from ntqwidget.h |
[13:15] | blu256 has joined |
[13:50] | SlavekB: Blue256, thank you, TDE/tdebase#304 looks like a good thing. |
[13:50] | tde-bot: [TGW][tdebase] #304 - WIP: Various KXkb improvements |
[13:50] | tde-bot: https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/304 |
[14:05] | denk: thanks for the link, I just remember my account to gitea :) |
[14:19] | |akh|: I did some more testing and it looks like moc is completely ignoring the preprocessor directives. Weird |
[14:37] | denk: a big idea to you, modify moc to use an external CPP to preprocess the file |
[14:40] | denk: yyin = fopen( (const char *)g->fileName, "r" ); |
[14:40] | denk: replace by popen() with cpp |
[14:43] | |akh|: Thanks for the idea denk. I'm going to go the stub route though |
[14:44] | |akh|: To further clarity what I'm seeing, moc sees this: |
[14:44] | |akh|: #ifdef FOO |
[14:44] | |akh|: void something(); |
[14:44] | |akh|: #else |
[14:44] | |akh|: void another(); |
[14:44] | |akh|: #endif |
[14:44] | |akh|: How moc sees it: |
[14:45] | |akh|: void something(); |
[14:45] | |akh|: void another(); |
[14:45] | |akh|: IOW, all the preprocessor directives seem to be stripped in moc |
[14:47] | denk: I don't see the moc recognizes some preprocessor directives, see in moc.y |
[14:49] | denk: try the same with moc from qt4/5, maybe then you merge the code into tqmoc |
[14:53] | denk: huh, they completely rewrote it |
[14:53] | |akh|: just tested with qt5 moc and it does respect the preprocessor directives |
[14:54] | denk: do a backport then |
[14:54] | |akh|: i may just do that |
[14:54] | |akh|: should i file a bug report? |
[14:55] | denk: +1 for the backport from me |
[14:57] | |akh|: I'll file a bug report. If it looks like something I could handle I'll see about backporting (or making the change you suggested) |
[15:08] | blu256: SlavekB, it's a thing that has been on my TODO list for quite a long time |
[15:10] | SlavekB: Originally I was afraid that this is a big change, where the preparation will take a long time - that it is not expected for R14.1.0. But as I see, it will be ready soon, which is good news. |
[15:12] | blu256: It was not as much as I had expected either, but the kkbswitch source code proved to be helpful (even though in the end I chose a little different approach) |
[15:15] | blu256: By the way, I'm having trouble with the mailing lists. I can't resubscribe to users and devels lists |
[15:15] | SlavekB: The confirmation mail will not come? |
[15:16] | blu256: No, it did not |
[15:17] | blu256: Mailman says "You have a subscription request pending. If you don't hear back soon, please contact the list owners." |
[15:17] | |akh|: @blu256 |
[15:18] | blu256: And I can't see the e-mail I sent about #304 to the users list, so I don't think it aactually reached anyone in the list |
[15:18] | |akh|: I had trouble getting the email too. It turned out to be a crypto issue on my mailserver |
[15:18] | blu256: This address is @gmail |
[15:18] | |akh|: I turned off imaps and requested the email to be resent |
[15:19] | |akh|: sorry, not imaps, smtps |
[15:20] | SlavekB: I tried to log you manually to devels, it looks successful there. But I see a message about pending request in users. |
[15:21] | SlavekB: I canceled the original pending request and made subscribe manually - this time successfully. |
[15:22] | blu256: Indeed, I see it now via Mailman, thank you very much! |
[15:24] | SlavekB: Occasionally there are problems with delivery to GMail, as they are tightening the rules that should meet mails. |
[15:25] | SlavekB: I tried to change so that the sender's address was always replaced there and all mails have given DKIM signature. |
[15:40] | |akh|: I filed a bug report regarding moc: https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/issues/65 |
[15:47] | blu256: I've re-sent the e-mail to users but it hasn't shown up in Mailman, strange. |
[15:47] | blu256: I wonder if it has actually reached the list |
[15:56] | blu256 sighs |
[15:56] | blu256: E-mail is difficult :/ |
[15:58] | blu256: Sending via Mailman web interface didn't work either |
[16:22] | blu256: Okay, I've signed up to the lists with ProtonMail which receives the confirmations ok. I've re-sent the message and it says it's being held for moderation (that's progress at last!) |
[16:25] | blu256 has quit (Quit: Konversation terminated!) |
[16:29] | SlavekB: Sorry, I was away from the machine... Now I look at Mailman and I see a total of three mails for approval - two from the Gmail address, one from the Proton mail. |
[19:55] | SlavekB has quit (Quit: TDE Kopete : https://trinitydesktop.org) |
[20:59] | SlavekB has joined |
#tde-devs < 2023/01/11 > |