Re: KF5 Conversion problems
El diumenge, 11 de març de 2018, a les 14:40:56 CET, Robin Atwood va escriure: > On Sunday 11 March 2018, Michael Pyne wrote: > > > Yes, but the problem is the /usr/include/kdialog.h when it should be > > > finding /usr/include/KF5/KDELibs4Support/kdialog.h. I have > > > find_package(Qt5 Widgets... already. > > > > Sounds like 2 problems I think. > > > > First you need to fix the kdialog.h include in your software (or help > > us identify where it is broken in the KF5 build system). Is your build > > system already looking for KF5::KDELibs4Support, and marking your build > > target as depending on that library? > > > > Even with this incorrect kdialog, you would think it would still find > > the right QDialog though. That's why it sounds like there's 2 problems. > > I think the issue here is that there is no longer a QtGui/QDialog. The > > right path would be in QtWidgets/QDialog with Qt5. It's better (and now > > recommended) just to use a '#include ' (and in general, > > #include ). > > I added KF5::KDE4Support to the target link libraries and that problem went > away. This raises the problem: how do I know which link libraries I need? Is > there a list of dependencies somewhere? That's kind of a weird question. You know which libraries you need to link to because you're using classes that reside in them. How do i know that I need to link to QtWidget? Because you're using QLabel and the documentation says so. How do you know that I need to link to KConfigWidgets? Because you're using KColorScheme and the documentation says so. Cheers, Albert > > Thanks > Robin
Re: Is it possible to mock an external drive (for unit testing)?
El dissabte, 10 de març de 2018, a les 18:27:51 CET, Michael Heidelbach va escriure: > Hi! > > Is it? How? > > Do examples exist? You'll really need to be more specific, my initial answer would be, why would you care if something is a external drive? Cheers, Albert > > > Thanks in advance, > > Michael
Re: Q_ASSERT(!FalseSecurity)
On Saturday, 10 March 2018 00:53:24 PDT Michael Heidelbach wrote: > Hi! > > Am I getting something wrong? Or is > > "Q_ASSERT(m_writeTrans); > > m_writeTrans->commit();" > > providing false security? This is not false security. It's not security, period. You use a Q_ASSERT when a violation indicates a bug that needs to be fixed, instead of a normal condition. So the above code is fine. > Shouldn't it better be > > "Q_ASSERT(m_writeTrans); > > if (m_writeTrans) { > > m_writeTrans->commit(); ? It should definitely NOT be this. Use either Q_ASSERT or the if, not both. -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel Open Source Technology Center
Re: KF5 Conversion problems
On Sun, Mar 11, 2018 at 08:40:56PM +0700, Robin Atwood wrote: > On Sunday 11 March 2018, Michael Pyne wrote: > > > Yes, but the problem is the /usr/include/kdialog.h when it should be > > > finding /usr/include/KF5/KDELibs4Support/kdialog.h. I have > > > find_package(Qt5 Widgets... already. > > > > Sounds like 2 problems I think. > > > > First you need to fix the kdialog.h include in your software (or help > > us identify where it is broken in the KF5 build system). Is your build > > system already looking for KF5::KDELibs4Support, and marking your build > > target as depending on that library? > > > > Even with this incorrect kdialog, you would think it would still find > > the right QDialog though. That's why it sounds like there's 2 problems. > > I think the issue here is that there is no longer a QtGui/QDialog. The > > right path would be in QtWidgets/QDialog with Qt5. It's better (and now > > recommended) just to use a '#include ' (and in general, > > #include ). > > I added KF5::KDE4Support to the target link libraries and that problem went > away. This raises the problem: how do I know which link libraries I need? Is > there a list of dependencies somewhere? I don't know of anything quite that direct. https://community.kde.org/Frameworks/Porting_Notes is the best reference, but you should also look at the kde-dev-scripts git repository (part of our "KDE SDK" offerings), under the kf5/ directory, where a bunch of auto-migration scripts can be found. Easier to automate the migration to the extent possible, then use the Porting_Notes wiki page to get guidance on the rest. There will undoubtedly still be a few mysteries to solve after that, especially if you decide to also start migrating over to some of the new Qt5-based features in the process. But between those two resources you can get most, if not all, of a working migration completed. Regards, - Michael Pyne
Re: KF5 Conversion problems
On Sunday 11 March 2018, Michael Pyne wrote: > > Yes, but the problem is the /usr/include/kdialog.h when it should be > > finding /usr/include/KF5/KDELibs4Support/kdialog.h. I have > > find_package(Qt5 Widgets... already. > > Sounds like 2 problems I think. > > First you need to fix the kdialog.h include in your software (or help > us identify where it is broken in the KF5 build system). Is your build > system already looking for KF5::KDELibs4Support, and marking your build > target as depending on that library? > > Even with this incorrect kdialog, you would think it would still find > the right QDialog though. That's why it sounds like there's 2 problems. > I think the issue here is that there is no longer a QtGui/QDialog. The > right path would be in QtWidgets/QDialog with Qt5. It's better (and now > recommended) just to use a '#include ' (and in general, > #include ). I added KF5::KDE4Support to the target link libraries and that problem went away. This raises the problem: how do I know which link libraries I need? Is there a list of dependencies somewhere? Thanks Robin -- -- Robin Atwood. "Ship me somewheres east of Suez, where the best is like the worst, Where there ain't no Ten Commandments an' a man can raise a thirst" from "Mandalay" by Rudyard Kipling -- -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.